freetype
[Top][All Lists]
Advanced

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

[ft] Proposal for ftdump to show languageID, too


From: suzuki toshiya
Subject: [ft] Proposal for ftdump to show languageID, too
Date: Tue, 13 Jul 2010 13:00:50 +0900
User-agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080406)

Dear Werner,

Thank your hard work for releasing freetype-2.4.0.

While I'm working with the cmap subtable reordering
in a face loading, I wished if ftdump shows languageID
in addition to platformID & encodingID. The patch
is very small, aslike:

diff --git a/src/ftdump.c b/src/ftdump.c
index 840af91..3bb7fc0 100644
--- a/src/ftdump.c
+++ b/src/ftdump.c
@@ -12,6 +12,7 @@
#include FT_FREETYPE_H
#include FT_SFNT_NAMES_H
#include FT_TRUETYPE_IDS_H
+#include FT_TRUETYPE_TABLES_H

/* the following header shouldn't be used in normal programs */
#include FT_INTERNAL_DEBUG_H
@@ -508,10 +509,11 @@

for( i = 0; i < face->num_charmaps; i++ )
{
- printf( " %d: platform %d, encoding %d",
+ printf( " %d: platform %d, encoding %d, language %d",
i,
face->charmaps[i]->platform_id,
- face->charmaps[i]->encoding_id );
+ face->charmaps[i]->encoding_id,
+ (FT_UInt)FT_Get_CMap_Language_ID( face->charmaps[i] ) );
if ( i == active )
printf( " (active)" );
printf ( "\n" );


Please give me comment.

Regards,
mpsuzuki



P.S.
Microsoft TrueType spec (older than OpenType) requests
cmap subtables should not share same platform & encoding
IDs, but I found some Apple TrueType fonts share same
platform & encoding ID but different language IDs, like this:

There is 1 face in this file.

----- Face number: 0 -----

font name entries
family: Apple Chancery
style: Chancery
postscript: Apple-Chancery

font type entries
FreeType driver: truetype
sfnt wrapped: yes
type: scalable
direction: horizontal
fixed width: no
glyph names: yes
EM size: 2048
global BBox: (-2224,-952):(3380,2289)
ascent: 2289
descent: -952
text height: 3241
glyph count: 1058

charmaps
0: platform 0, encoding 3, language 0 (active)
1: platform 1, encoding 0, language 0
2: platform 1, encoding 0, language 3
3: platform 1, encoding 0, language 16
4: platform 1, encoding 0, language 18
5: platform 1, encoding 0, language 19
6: platform 1, encoding 0, language 31
7: platform 1, encoding 0, language 38
8: platform 1, encoding 29, language 0




reply via email to

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