diff -uNrp fontconfig-2.2.1.orig/fonts.conf.in fontconfig-2.2.1/fonts.conf.in --- fontconfig-2.2.1.orig/fonts.conf.in 2003-04-17 06:04:42.000000000 +0800 +++ fontconfig-2.2.1/fonts.conf.in 2003-11-10 11:00:58.000000000 +0800 #@@ -21,10 +21,8 @@ # Keith Packard # --> # #- #- #- @FC_DEFAULT_FONTS@ #- @FC_FONTPATH@ #+ /usr/X11R6/lib/X11/fonts #+ /usr/share/fonts # ~/.fonts # # - - GulimChe - false - - - - DotumChe - false - - - - BatangChe - false - - - - GungsuhChe - false - - + + + + medium + + + + bold + + + + + + + mono + + + false + + + + + + + true + + + true + + + + + + + true + diff -uNrp fontconfig-2.2.1.orig/src/fccfg.c fontconfig-2.2.1/src/fccfg.c --- fontconfig-2.2.1.orig/src/fccfg.c 2003-04-22 14:29:21.000000000 +0800 +++ fontconfig-2.2.1/src/fccfg.c 2003-11-10 11:00:58.000000000 +0800 @@ -70,6 +70,8 @@ FcConfigCreate (void) config->rescanTime = time(0); config->rescanInterval = 30; + /* Add by Firefly (firefly@firefly.idv.tw) */ + config->otherFamily = FcFalse; return config; diff -uNrp fontconfig-2.2.1.orig/src/fcfreetype.c fontconfig-2.2.1/src/fcfreetype.c --- fontconfig-2.2.1.orig/src/fcfreetype.c 2003-04-30 23:17:58.000000000 +0800 +++ fontconfig-2.2.1/src/fcfreetype.c 2003-11-10 11:03:18.000000000 +0800 #@@ -57,7 +57,9 @@ # # #if (FREETYPE_MINOR > 1 || (FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 4)) # #include #+#if (FREETYPE_MAJOR <= 2 && FREETYPE_MINOR <= 1 && FREETYPE_PATCH < 6) # #include #+#endif # #define USE_FTBDF # #define HAS_BDF_PROPERTY(f) ((f) && (f)->driver && \ # (f)->driver->root.clazz->get_interface) @@ -285,6 +287,9 @@ FcFreeTypeQuery (const FcChar8 *file, FcBool style_allocated = FcFalse; int family_prio = 0; int style_prio = 0; + /* Add by firefly@firfly.idv.tw */ + FcChar8 *Other_family = 0; /* 非英文/拉丁語系的字型名稱 */ + /*------------------------------*/ if (FT_Init_FreeType (&ftLibrary)) return 0; @@ -540,6 +545,10 @@ FcFreeTypeQuery (const FcChar8 *file, switch (sname.name_id) { case TT_NAME_ID_FONT_FAMILY: case TT_NAME_ID_PS_NAME: + /* 找到非英語/拉丁語系的字型名稱, 先暫存起來 */ + if ((prio & FC_NAME_PRIO_LANG) == FC_NAME_PRIO_LANG_NONE && !Other_family) + Other_family = FcStrCopy(utf8); + /*-------------------------------------------*/ if (!family || prio > family_prio) { if (family) @@ -612,6 +621,16 @@ FcFreeTypeQuery (const FcChar8 *file, if (family_allocated) free (family); + /*---------------------------------------------------------------------- + * 如果有非英語系/拉丁語系的字型名稱, 就將這個名稱附加在現有字型名稱之後 + */ + if (Other_family) + { + FcPatternAddString(pat, FC_FAMILY, Other_family); + FcStrFree(Other_family); + } + /*--------------------------------------------------------------------*/ + if (style) { if (!FcPatternAddString (pat, FC_STYLE, style)) @@ -623,6 +642,11 @@ FcFreeTypeQuery (const FcChar8 *file, if (style_allocated) free (style); } + /* Add by Firefly (firefly@firefly.idv.tw) + if no style found, default with "Regular" */ + else + if (!FcPatternAddString (pat, FC_STYLE, "Regular")) + goto bail1; if (!FcPatternAddString (pat, FC_FILE, file)) goto bail1; @@ -861,11 +885,13 @@ FcFreeTypeQuery (const FcChar8 *file, if (!FcPatternAddInteger (pat, FC_WIDTH, width)) goto bail1; +#if 0 if(foundry) { if(!FcPatternAddString (pat, FC_FOUNDRY, foundry)) goto bail1; } +#endif /* * Compute the unicode coverage for the font diff -uNrp fontconfig-2.2.1.orig/src/fcint.h fontconfig-2.2.1/src/fcint.h --- fontconfig-2.2.1.orig/src/fcint.h 2003-04-16 07:38:06.000000000 +0800 +++ fontconfig-2.2.1/src/fcint.h 2003-11-10 11:00:58.000000000 +0800 @@ -328,6 +328,8 @@ struct _FcConfig { */ time_t rescanTime; /* last time information was scanned */ int rescanInterval; /* interval between scans */ + /* Add by Firefly (firefly@firefly.idv.tw) */ + FcBool otherFamily; /* output non engliah/latin family name */ }; extern FcConfig *_fcConfig; diff -uNrp fontconfig-2.2.1.orig/src/fclist.c fontconfig-2.2.1/src/fclist.c --- fontconfig-2.2.1.orig/src/fclist.c 2003-03-05 13:52:31.000000000 +0800 +++ fontconfig-2.2.1/src/fclist.c 2003-11-10 11:00:58.000000000 +0800 @@ -394,6 +394,10 @@ FcFontSetList (FcConfig *config, FcListHashTable table; int i; FcListBucket *bucket; + /* Add By Firefly (firefly@firefly.idv.tw) */ + int family_id; + FcPattern *dup_font; + FcChar8 *family_name; if (!config) { @@ -415,9 +419,37 @@ FcFontSetList (FcConfig *config, if (!s) continue; for (f = 0; f < s->nfont; f++) + { if (FcListPatternMatchAny (p, s->fonts[f])) - if (!FcListAppend (&table, s->fonts[f], os)) - goto bail1; + { + family_id = 0; /* 從第一個名稱開始, 依序取出 */ + while (FcPatternGetString(s->fonts[f], FC_FAMILY, family_id, &family_name) == FcResultMatch) + { + /* 複製一個一模一樣的 pattern */ + dup_font = FcPatternDuplicate(s->fonts[f]); + if (dup_font) + { + /* 刪除字型名稱 */ + if (!FcPatternDel(dup_font, FC_FAMILY)) + goto bail1; + /* 加入剛剛取得的字型名稱 */ + if (!FcPatternAddString(dup_font, FC_FAMILY, family_name)) + goto bail1; + + if (!FcListAppend (&table, dup_font, os)) + goto bail1; + + /* 釋放記憶體 */ + FcPatternDestroy(dup_font); + } + /* 如果指定了輸出非英語字型名稱就繼續, 否則立即終止 */ + if (config->otherFamily) + family_id++; + else + break; + } + } + } } #if 0 { diff -uNrp fontconfig-2.2.1.orig/src/fcxml.c fontconfig-2.2.1/src/fcxml.c --- fontconfig-2.2.1.orig/src/fcxml.c 2003-04-16 07:38:06.000000000 +0800 +++ fontconfig-2.2.1/src/fcxml.c 2003-11-10 11:00:58.000000000 +0800 @@ -311,6 +311,8 @@ typedef enum _FcElement { FcElementBlank, FcElementRescan, + /* Add by Firefly (firefly@firefly.idv.tw) */ + FcElementOtherFamily, FcElementPrefer, FcElementAccept, @@ -367,6 +369,8 @@ FcElementMap (const XML_Char *name) { "blank", FcElementBlank }, { "rescan", FcElementRescan }, + /* Add by Firefly (firefly@firefly.idv.tw) */ + { "other_family", FcElementOtherFamily }, { "prefer", FcElementPrefer }, { "accept", FcElementAccept }, @@ -894,6 +898,23 @@ FcParseRescan (FcConfigParse *parse) } } +/* Add by Firefly (firefly@firefly.idv.tw) + * 解析 標籤 + */ +static void +FcParseOtherFamily (FcConfigParse *parse) +{ + int n = FcVStackElements (parse); + while (n-- > 0) + { + FcVStack *v = FcVStackFetch (parse, n); + if (v->tag != FcVStackBool) + FcConfigMessage (parse, FcSevereWarning, "non-bool other_family"); + else + parse->config->otherFamily = v->u.bool; + } +} + static void FcParseInt (FcConfigParse *parse) { @@ -1722,6 +1743,10 @@ FcEndElement(void *userData, const XML_C case FcElementRescan: FcParseRescan (parse); break; + /* Add by Firefly (firefly@firefly.idv.tw) */ + case FcElementOtherFamily: + FcParseOtherFamily (parse); + break; case FcElementPrefer: FcParseFamilies (parse, FcVStackPrefer);