[haiku-development] Help needed on font fallback system

  • From: PulkoMandy <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 5 Jul 2010 18:27:57 +0200

Hello,
I'm trying to design a glyph fallback system for Haiku. This would allow 
rendering glyphs using a font different from the
one asked by the user, if the glyphs are nt available. For example, Haiku could 
render Japanese fonts out of the box even if
VL Gothic is not the default system font. Currently selecting Japanese in the 
locale preflet makes Haiku display only squares
instead of the glyphs.

However, I'm not very familiar with the internals of the app_server. I've found 
that the actual text rendering occurs in
GlyphLayoutEngine::LayoutGlyphs, itself calling FontCacheEntry->Glyph() to get 
the glyph for each character it needs to draw.
I'm not sure this is the right place to handle things. Currently, a missing 
glyph is replaced with a square, this is'nt done
by any of these functions, so I guess at this point of the drawing it's already 
too late and the square glyph was already
inserted. I have no idea where this happens and how to check for it.

a) Where is this replacement with a square done ?
b) I will remove the replacement with a square, should I replace it with 
loading another font for finding the glyph, or would that better be done 
elsewhere (knowing that the method that returned the square would now error 
out, I could do it
in FontCacheEntry::Glyph, for example). If so, where should this fallback be 
done ?

Thanks,
-- 
Adrien.



Other related posts: