FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fonts! Some sizes glitchy with some fonts

 
Post new topic   Reply to topic     Forum Index -> Schooner
View previous topic :: View next topic  
Author Message
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Sat Feb 17, 2007 9:27 am    Post subject: Fonts! Some sizes glitchy with some fonts Reply with quote

In the ftgldemo on Windows, if I choose to use the fonts 'msmincho.ttc' or 'msgothic.ttc', then FaceSize 18 which is used for the infoFont doesn't work. All the characters look like garbage. Sizes 10--22 are all bad in fact. Smaller is ok, and bigger is also ok.

Those are the only two fonts I've found that have the problem, though I haven't tried them all.
If you don't have them in you c:\windows\fonts dir you can get them by enabling Japanese in the "Regional and Language Options" control panel, then click on "Install files for East Asian langauges".

Any idea what the problem is?
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Sat Feb 17, 2007 7:59 pm    Post subject: Reply with quote

No. I don't off-hand have an idea what the problem is. As a workaround, can you use one of the larger sizes and scale it down with OpenGL?

I won't be able to look into this immediately. My Windows is behaving very badly, I need to reinstall Windows first.
Back to top
View user's profile Send private message
rsl



Joined: 04 Jan 2006
Posts: 47

PostPosted: Wed Feb 21, 2007 3:31 am    Post subject: Reply with quote

That problem is caused by embedded bitmap.
'msgothic.ttc' use embedded bitmap, font size 10-22.

it need to pass FT_LOAD_NO_BITMAP to FT_Load_Glyph.
or disable TT_CONFIG_OPTION_EMBEDDED_BITMAPS when build freetype.
Back to top
View user's profile Send private message Send e-mail
baxissimo



Joined: 23 Oct 2006
Posts: 241
Location: Tokyo, Japan

PostPosted: Wed Feb 21, 2007 11:58 am    Post subject: Reply with quote

rsl wrote:
That problem is caused by embedded bitmap.
'msgothic.ttc' use embedded bitmap, font size 10-22.

it need to pass FT_LOAD_NO_BITMAP to FT_Load_Glyph.
or disable TT_CONFIG_OPTION_EMBEDDED_BITMAPS when build freetype.


Excellent tip rsl! That makes a lot of sense. And sure enough, if I change infoFont in the ftgldemo.d from a FTGLPixmapFont into an FTGLBitmapFont, everything works fine.

Also confirmed that adding the FT_LOAD_NO_BITMAP flag to ftglpixmap.d:107 fixes it:
Code:

      FTGlyph MakeGlyph(uint g) {
          FT_GlyphSlot ftGlyph = face.Glyph( g, FT_LOAD_NO_HINTING|FT_LOAD_NO_BITMAP);
      
          if( ftGlyph)
          {
              FTPixmapGlyph tempGlyph = new FTPixmapGlyph( ftGlyph);
              return tempGlyph;
          }
      
          err = face.Error();
          return null;
      }


I'm not sure what the thinking is behind the embedded bitmaps, but I did find that with a 10 pt MSMINCHO font, pixmaps were pretty much illegible, while bitmaps were still ok. At 18pts however, the pixmaps looked as good as the bitmaps (a little better really because of the antialiasing).

So that suggests to me that the FT_LOAD_NO_BITMAP should just be set by default in the MakeGlyph methods of all non-bitmap font types. Let the user decide whether or not to use embedded bitmaps based on choice of FTGL font type. That seems to make the most sense given FTGL's purposes.
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Wed Feb 21, 2007 4:23 pm    Post subject: Reply with quote

baxissimo wrote:
So that suggests to me that the FT_LOAD_NO_BITMAP should just be set by default in the MakeGlyph methods of all non-bitmap font types. Let the user decide whether or not to use embedded bitmaps based on choice of FTGL font type. That seems to make the most sense given FTGL's purposes.


I agree. I'll make that change soon.

Thanks for tracking this down.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Schooner All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group