freetype
[Top][All Lists]
Advanced

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

[ft] A couple of problems with 2.3.5


From: Jonathan Blow
Subject: [ft] A couple of problems with 2.3.5
Date: Wed, 13 Feb 2008 07:44:17 -0800
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Apologies if the answer to this is available somewhere, but I checked the archives and didn't see it.

Firstly -- I was having crashes when using some TrueType fonts. I quickly found that the callbacks for hinting were set to NULL. I avoided the crash by pre-checking the pointers before using them:

---------------------(afloader.c:169)
     // @BraidModification
     if (metrics->clazz->script_hints_apply)
     metrics->clazz->script_hints_apply( hints,
                                         &gloader->current.outline,
                                         metrics );
---------------------(afloader.c:521)
       // @BraidModification
       if ( metrics->clazz->script_hints_init ) {
error = metrics->clazz->script_hints_init( &loader->hints, metrics );
       if ( error )
         goto Exit;
       }  // End @BraidModification
---------------------

But of course this is not ideal and the code wasn't expecting this. I would have thought this was maybe just a problem in the font, but it happened with a lot of TrueType fonts so I concluded it was a bug in 2.3.5.


This application (it's an Xbox 360 game) is rendering text in multiple languages, but unfortunately, the sizes of different glyphs are coming out very differently for Asian languages. In a test with Japanese, the Latin characters are coming out at the proper sizes, but the Japanese characters seem to be improperly scaled. (In fact, I checked through the debugging code, and they seem to come out *unscaled* -- they are rendered at the em width of the source font data.) However, the advance values / etc all come out properly. See the following screenshot for illustration of what happens:

http://number-none.com/kanji_size_problem.jpg

(In this example, the em width of the font is 1000; I am requesting, using FT_SIZE_REQUEST_TYPE_NOMINAL, a size of 4800 for all characters. Due to the bug, the kanji characters are being rendered at about 1000, but the Latin characters are at about 4800).

Here is the font I am using:

http://number-none.com/japanese.ttf



One obvious question is whether these two things are related -- if the anti-crash checks that I inserted fail to initialize something in the metrics that is only used for the Japanese characters, thus causing these problems.

Another obvious question is whether anyone has encountered this before and if it is fixed in one of the development snapshots.

Thanks for any help you can provide!

 -Jonathan.










reply via email to

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