How do I remove spurious vertical lines from spriteFont?

Get help using Construct 2

Post » Fri Oct 21, 2016 11:28 am

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:
Image

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.
B
14
S
3
Posts: 29
Reputation: 870

Post » Fri Oct 21, 2016 11:48 am

Taweel wrote:
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 :)
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Sat Oct 22, 2016 11:14 pm

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.
B
14
S
3
Posts: 29
Reputation: 870

Post » Mon Oct 24, 2016 7:55 pm

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.
B
14
S
3
Posts: 29
Reputation: 870


Return to How do I....?

Who is online

Users browsing this forum: dop2000, LogoGuy2017, OddConfection and 25 guests