freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Problem with drawing of Japanese characters ( the face size


From: Detlef Würkner
Subject: Re: [Devel] Problem with drawing of Japanese characters ( the face size is 10 )
Date: Sun, 07 Jul 2002 10:48:07 +0200

address@hidden wrote:

> I have used the FreeType 2 and FTGL libraries and wanted to draw a Japanese
> characters. I set the size of my font less then 22 and received black screen
> (empty screen). Look at the part of my code:
[...]
>     if (!font->Open("c:\winnt\Fonts\msmincho.ttc"))
[...]
> But when I change the face size into 23 or greater the result is OK.
> 
> (Embedded image moved to file: pic30027.pcx)
> 
> Why do I receive the black screen (empty screen) when I set the face size to 
> 10
> ?

msmincho.ttc contains embedded bitmaps for sizes up to 22.
A common mistake is to call FT_Glyph_To_Bitmap() when the
glyph is already(!) in bitmap format. Searched for this
mistake in the source code of FTGL 1.32 and found it.
Dont know if this patch fixes all problems of FTGL with
embedded bitmaps, maybe the second common mistake must also
be fixed (not specifying FT_LOAD_NO_BITMAP but later needing
an outline, not a bitmap, for e.g. transformation/rotation etc).

Try this fix and send this mail to the FTGL developers:
----8<----
--- ftgl_dist/src/FTPixmapGlyph.cpp.ori Thu Feb 21 08:55:29 2002
+++ ftgl_dist/src/FTPixmapGlyph.cpp     Sun Jul  7 08:35:08 2002
@@ -11,8 +11,9 @@
        numGreys(0),
        data(0)
 {
-       // This function will always fail if the glyph's format isn't 
scalable????
-       FT_Error err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
+       FT_Error err = 0;
+       if( ft_glyph_format_bitmap != glyph->format)
+               err = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_normal, 0, 1);
        if( err || ft_glyph_format_bitmap != glyph->format)
        {
                return;
----8<----

Ciao, Detlef
-- 
_ // address@hidden
\X/  Detlef Wuerkner, Langgoens/Germany



reply via email to

[Prev in Thread] Current Thread [Next in Thread]