How do I remove spurious vertical lines from spriteFont?

0 favourites
  • 4 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hello all,

    I have been trying to use the spriteFont to show Arabic letters. For some reason, it seems to add random vertical lines at the side of some letters. I have searched the forum for similar issues but the only post that I found was related to scaling. In my case I am using a scale of 1.

    In the image below the red lines point to where the spurious lines are appearing:

    If I change the zoom levels in Chrome, the lines change position.

    I have put a capx and the spriteFont png on oneDrive here:

    https://1drv.ms/f/s!AsobMPtnfQiBgSqATVvT6kN3eR7p

    Has anyone seen a similar issue before? Am I using it wrong?

    Does the spriteFont object assume that characters have a space between them (most Arabic letters connect together). Any help on this is highly appreciated.

  • Has anyone seen a similar issue before? Am I using it wrong?

    Does the spriteFont object assume that characters have a space between them (most Arabic letters connect together). Any help on this is highly appreciated.

    You are right, SpriteFonts need padding or spaces of 1 or 2 pixels between the characters or you get problems with the anti-aliasing. You can set the width of any character individual, if the spacing make a gap after the character in the text. Use the action: set character width.

    For example if you want an 'i' smaller than the rest of the characters from start of your program:

    System | On start of layout->SpriteFont|Set character width to 'any width you want' for "i"

    'any width you want' is the width you want

  • Thanks Asmodean. Such an important aspect of the SpriteFont should be added to the manual.

    I'll try the solution you suggested and if it works I'll mark the subject solved.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I tried the solution suggested by Asmodean. It does remove the vertical lines but now there is the problem of a 1 pixel separator between characters so my characters never fully connect. I am using the excellent "Sprite Font Generator by BlackHornet. It creates the characters left justified with a (1 pixel wide) column of empty pixels to the left of each char.

    Setting the width of each char, tells "Construct 2" how wide is each character. Is there a way to tell the Spritefont to ignore the "1 pixel column"?

    I tried moving the characters to the edge of the cell (shifting them one pixel to the left) but that brings the old problem back

    If it can't be done, I'll have to live with either the gap between chars or the vertical lines. Not sure which one is less professional.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)