Hi,
I'm using some TTF fonts but they looks truncated, any idea about this?
Thanks.
Truncated TTF glyphes fonts
-
- Bronze Sponsor
- Posts: 153
- Joined: Mon Jul 31, 2006 8:29 pm
- Location: France
- x 7
-
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
Re: Truncated TTF glyphes fonts
Could you be a bit more vague?
Start with explaining where you are "using some TTF fonts".
Start with explaining where you are "using some TTF fonts".
-
- Bronze Sponsor
- Posts: 153
- Joined: Mon Jul 31, 2006 8:29 pm
- Location: France
- x 7
Re: Truncated TTF glyphes fonts
I can be more vague : "Hey, i have a problem, can you help me?"
nah sorry
I mean, i'm using textOverlays with TTF fonts, so i load them and set parameters, specially char_width/height, but as you can see on the pic the characters looks truncated on the right for some reason...like if the width would not be large enough for some glyphes...
Otherwise they are regular fonts with their .fontdef files like:
Any idea what am i missing?
Thanks.
nah sorry
I mean, i'm using textOverlays with TTF fonts, so i load them and set parameters, specially char_width/height, but as you can see on the pic the characters looks truncated on the right for some reason...like if the width would not be large enough for some glyphes...
Otherwise they are regular fonts with their .fontdef files like:
Code: Select all
brawl
{
type truetype
source font/brawl.ttf
size 16
resolution 72
}
Thanks.
-
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
Re: Truncated TTF glyphes fonts
Where did the .ttf come from? It looks like it's not set up properly. Are there any sizes that work right?
-
- Bronze Sponsor
- Posts: 153
- Joined: Mon Jul 31, 2006 8:29 pm
- Location: France
- x 7
Re: Truncated TTF glyphes fonts
Yes, the font comes from a website, not sure which one, i tried different width/height size without success.
But i do have one simple fixed font i generally use to display things which works just fine:
(the pixelated look is totaly ok, the font is called "arcade", and no crop or anything like in the previous one)
Now here is a try with another stylised font http://font-styles.com/cool-fonts-61.html,
which looks like:
and in Ogre:
Either my font setup is wrong, missing some config/parameters, i dunno, or there is something special with theses fonts :/
But i do have one simple fixed font i generally use to display things which works just fine:
(the pixelated look is totaly ok, the font is called "arcade", and no crop or anything like in the previous one)
Now here is a try with another stylised font http://font-styles.com/cool-fonts-61.html,
which looks like:
and in Ogre:
Either my font setup is wrong, missing some config/parameters, i dunno, or there is something special with theses fonts :/
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: Truncated TTF glyphes fonts
Try .font files instead of .fontdef (which I think is deprecated?) you can specify horizontal and vertical resolution in a .font file.
Alternatively, try this tool:
Font Studio
Please notice that this tool exports to Ogre/CEGUI font definitions.
Alternatively, try this tool:
Font Studio
Please notice that this tool exports to Ogre/CEGUI font definitions.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Bronze Sponsor
- Posts: 153
- Joined: Mon Jul 31, 2006 8:29 pm
- Location: France
- x 7
Re: Truncated TTF glyphes fonts
Hi, thanks, well i want to use TTF over Bitmaps because of the large choice of fonts, and simplicity to use everywhere.
The .fontdef are correctly parsed(the manual is still using .fontdef), i' m using Ogre 1.6 atm, i can change to .font, np.
btw there is no char_width parameter...
---
I start to believe it is a bug when Ogre is generating the texture/UVs, however if someone could confirm me he got the same problem with the brooklyn font i linked previously, that would be great!
(that font is working just fine in the Gimp or Blender)
---
This is definitly a bug when Ogre is generating the texture, strange that nobody spotted this before...
here are the glyphs within the generated texture(+an overlay ABCDEF...):
---
Ok, i got it somehow fixed for now...
If someone has this problem while waiting for a better solution, in OgreFont.cpp, loadResource() there is a variable named char_spacer which is set to 5 for some reason, you can play with this value so that characters aren't eating each others in the generated texture, then you need to modify u2/v2 in the setGlyphTexCoords call later. However this is not the good way to fix this...
The .fontdef are correctly parsed(the manual is still using .fontdef), i' m using Ogre 1.6 atm, i can change to .font, np.
btw there is no char_width parameter...
---
I start to believe it is a bug when Ogre is generating the texture/UVs, however if someone could confirm me he got the same problem with the brooklyn font i linked previously, that would be great!
(that font is working just fine in the Gimp or Blender)
---
This is definitly a bug when Ogre is generating the texture, strange that nobody spotted this before...
here are the glyphs within the generated texture(+an overlay ABCDEF...):
---
Ok, i got it somehow fixed for now...
If someone has this problem while waiting for a better solution, in OgreFont.cpp, loadResource() there is a variable named char_spacer which is set to 5 for some reason, you can play with this value so that characters aren't eating each others in the generated texture, then you need to modify u2/v2 in the setGlyphTexCoords call later. However this is not the good way to fix this...
-
- Orc
- Posts: 424
- Joined: Wed Aug 01, 2007 8:13 pm
- Location: Venice, CA, USA
- x 7
Re: Truncated TTF glyphes fonts
Ha! I knew there had to be some kind of a empty-space parameter. I've been trying to figure out how OGRE maps the UV for the glyphs. I think you just sent me in the right direction. I'll check out the OgreFont class. Thanks!