On 16 Apr 2010, at 16:24, manolo gouy wrote: >> >>> The issue is whether we want to draw all of UTF, and it's far too >>> big >>> to be memorized glyph per glyph, or only latin characters, and the >>> single glyph texture approach becomes possible and preferable. >> >> Ah - but no text is really all that likely to use all the glyphs, >> so a >> mechanism to render glyphs that are used "on demand" and then >> cache them >> for re-use later (on the basis that a given bit of text is very >> likely >> to re-use the same glyphs...) > > I would think this assumption holds for alphabetic scripts, but not > for Chinese and friends.
How so? For the scripts that are rendered using CJK fonts, it is usually the case that a fairly small set of glyphs cover a substantial amount of text - recall also that a lot of Japanese and Korean text is substantially more "alphabetic" than "ideographic" in practice. Even if the text was entirely ideographic, how many glyphs would we be caching? If the text was even a few thousand words long, that's only a few thousand glyphs... Which puts us in the same ballpark as the current texture cache in the OSX build anyway... How much text do we expect to be rendering into a GL context in practice? > I don't succeed here in having FLTK-XFT to render CJK characters. > It works with Greek, Cyrillic, though. And I know I have the > font somewhere because my file manager displays chinese filenames > correctly. Yup - this is a recurring problem. Note that your file manager is probably using pango (I assume Gnome here) or equivalent to "search" the fonts on your system and find the ones you need: Note that with XFT (and Fontconfig) it is possible to create a sort of "super font" that is a union of several actual fonts, thus providing better glyph coverage than any one font on its own. Fltk does not do that, so if you want to display glyphs that are not in the default fonts on your system (which are probably only providing baseline LGC coverage) then you need to explicitly load a font that provides those glyphs. Try the test/utf8 demo, from a shell, and see what it does - you'll find which fonts on your system have CJK coverage and can then load then for the widgets that need CJK glyphs. Longer term, it'd be nice if we could extend the fltk font handling to do the "super font" thing, but that may be a little tricky and unlikely to happen quickly... > It seems that my FLTK does not know how to fish the fonts > that contain CJK characters. I assume the problem will be the > same if fl_draw() is directed to a bitmap. > > This was my point. > > Your reaction suggests that I may have missed something (may be in > FLTK + XFT compilation ?). I refer to a Debian 32-bit OS. Only that you need to explicitly load a font that has the glyphs you need... Other than that, I doubt there's anything else. -- Ian _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev