diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2007-06-12 00:07:24 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2007-06-12 00:07:24 +0000 |
commit | 19290cba0704aec45d7cceb81c283f80a79db933 (patch) | |
tree | 9c2adc8f2b8ad1942269e0018fd79e67be52f2d4 | |
parent | 238cd14f991b00a9499e1bd4b6a1d9a27113e16d (diff) | |
download | pango-19290cba0704aec45d7cceb81c283f80a79db933.tar.gz |
New engine public macros:
2007-06-11 Behdad Esfahbod <behdad@gnome.org>
* pango/pango-ot.h: New engine public macros:
PANGO_OT_TAG_MAKE()
PANGO_OT_TAG_MAKE_FROM_STRING()
* docs/pango-sections.txt:
* docs/tmpl/opentype.sgml:
Update.
2007-06-11 Behdad Esfahbod <behdad@gnome.org>
Bug 446018 – Bus error in the pango_ot_tag_from_language()
* pango/pango-ot-tag.c (pango_ot_tag_from_script),
(pango_ot_tag_to_script), (pango_ot_tag_from_language),
(pango_ot_tag_to_language): Make sure int access is
aligned.
svn path=/trunk/; revision=2344
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | docs/pango-sections.txt | 2 | ||||
-rw-r--r-- | docs/tmpl/opentype.sgml | 30 | ||||
-rw-r--r-- | pango/pango-ot-tag.c | 545 | ||||
-rw-r--r-- | pango/pango-ot.h | 19 | ||||
-rw-r--r-- | pango/pangocairo-fontmap.c | 1 |
6 files changed, 337 insertions, 280 deletions
@@ -1,3 +1,23 @@ +2007-06-11 Behdad Esfahbod <behdad@gnome.org> + + * pango/pango-ot.h: New engine public macros: + + PANGO_OT_TAG_MAKE() + PANGO_OT_TAG_MAKE_FROM_STRING() + + * docs/pango-sections.txt: + * docs/tmpl/opentype.sgml: + Update. + +2007-06-11 Behdad Esfahbod <behdad@gnome.org> + + Bug 446018 – Bus error in the pango_ot_tag_from_language() + + * pango/pango-ot-tag.c (pango_ot_tag_from_script), + (pango_ot_tag_to_script), (pango_ot_tag_from_language), + (pango_ot_tag_to_language): Make sure int access is + aligned. + 2007-06-12 Richard Hult <richard@imendio.com> * pango/pangoatsui-fontmap.c (pango_atsui_face_is_synthesized): diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt index e4247991..6b07e8c8 100644 --- a/docs/pango-sections.txt +++ b/docs/pango-sections.txt @@ -947,6 +947,8 @@ PangoOTRuleset PangoOTRulesetDescription PangoOTTableType PangoOTFeatureMap +PANGO_OT_TAG_MAKE +PANGO_OT_TAG_MAKE_FROM_STRING PANGO_OT_ALL_GLYPHS PANGO_OT_NO_FEATURE PANGO_OT_NO_SCRIPT diff --git a/docs/tmpl/opentype.sgml b/docs/tmpl/opentype.sgml index 20910f82..dd049964 100644 --- a/docs/tmpl/opentype.sgml +++ b/docs/tmpl/opentype.sgml @@ -22,9 +22,8 @@ Part of Pango's engine API, but stable <!-- ##### TYPEDEF PangoOTTag ##### --> <para> The <type>PangoOTTag</type> typedef is used to represent TrueType and OpenType -four letter tags inside Pango. Use the <function>FT_MAKE_TAG()</function> macro -defined in the FreeType2 header <filename>freetype/freetype.h</filename> to -create <type>PangoOTTag</type>s manually. +four letter tags inside Pango. Use PANGO_OT_TAG_MAKE() +or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create <type>PangoOTTag</type>s manually. </para> @@ -120,6 +119,31 @@ represented as a char array instead of a #PangoOTTag for convenience. pango_ot_ruleset_add_feature() for details. @Since: 1.18 +<!-- ##### MACRO PANGO_OT_TAG_MAKE ##### --> +<para> +Creates a #PangoOTTag from four characters. This is similar and +compatible with the <function>FT_MAKE_TAG()</function> macro from +FreeType. +</para> + +@c1: First character. +@c2: Second character. +@c3: Third character. +@c4: Fourth character. + + +<!-- ##### MACRO PANGO_OT_TAG_MAKE_FROM_STRING ##### --> +<para> +Creates a #PangoOTTag from a string. The string should be at least +four characters long (pad with space characters if needed), and need +not be nul-terminated. This is a convenience wrapper around +PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for +example, as a switch expression, as it dereferences pointers. +</para> + +@s: The string representation of the tag. + + <!-- ##### MACRO PANGO_OT_ALL_GLYPHS ##### --> <para> This is used as the property bit in pango_ot_ruleset_add_feature() when a diff --git a/pango/pango-ot-tag.c b/pango/pango-ot-tag.c index 74038b7b..e12d8f4e 100644 --- a/pango/pango-ot-tag.c +++ b/pango/pango-ot-tag.c @@ -23,78 +23,83 @@ #include "pango-ot.h" +typedef union { + char string[4]; + guint32 integer; +} Tag; + /* * complete list at: * http://www.microsoft.com/typography/developers/opentype/scripttags.aspx */ -static const char ot_scripts[][4] = { - "DFLT", /* PANGO_SCRIPT_COMMON */ - "DFLT", /* PANGO_SCRIPT_INHERITED */ - "arab", /* PANGO_SCRIPT_ARABIC */ - "armn", /* PANGO_SCRIPT_ARMENIAN */ - "beng", /* PANGO_SCRIPT_BENGALI */ - "bopo", /* PANGO_SCRIPT_BOPOMOFO */ - "cher", /* PANGO_SCRIPT_CHEROKEE */ - "copt", /* PANGO_SCRIPT_COPTIC */ - "cyrl", /* PANGO_SCRIPT_CYRILLIC */ - "dsrt", /* PANGO_SCRIPT_DESERET */ - "deva", /* PANGO_SCRIPT_DEVANAGARI */ - "ethi", /* PANGO_SCRIPT_ETHIOPIC */ - "geor", /* PANGO_SCRIPT_GEORGIAN */ - "goth", /* PANGO_SCRIPT_GOTHIC */ - "grek", /* PANGO_SCRIPT_GREEK */ - "gujr", /* PANGO_SCRIPT_GUJARATI */ - "guru", /* PANGO_SCRIPT_GURMUKHI */ - "hani", /* PANGO_SCRIPT_HAN */ - "hang", /* PANGO_SCRIPT_HANGUL */ - "hebr", /* PANGO_SCRIPT_HEBREW */ - "kana", /* PANGO_SCRIPT_HIRAGANA */ - "knda", /* PANGO_SCRIPT_KANNADA */ - "kana", /* PANGO_SCRIPT_KATAKANA */ - "khmr", /* PANGO_SCRIPT_KHMER */ - "lao ", /* PANGO_SCRIPT_LAO */ - "latn", /* PANGO_SCRIPT_LATIN */ - "mlym", /* PANGO_SCRIPT_MALAYALAM */ - "mong", /* PANGO_SCRIPT_MONGOLIAN */ - "mymr", /* PANGO_SCRIPT_MYANMAR */ - "ogam", /* PANGO_SCRIPT_OGHAM */ - "ital", /* PANGO_SCRIPT_OLD_ITALIC */ - "orya", /* PANGO_SCRIPT_ORIYA */ - "runr", /* PANGO_SCRIPT_RUNIC */ - "sinh", /* PANGO_SCRIPT_SINHALA */ - "syrc", /* PANGO_SCRIPT_SYRIAC */ - "taml", /* PANGO_SCRIPT_TAMIL */ - "telu", /* PANGO_SCRIPT_TELUGU */ - "thaa", /* PANGO_SCRIPT_THAANA */ - "thai", /* PANGO_SCRIPT_THAI */ - "tibt", /* PANGO_SCRIPT_TIBETAN */ - "cans", /* PANGO_SCRIPT_CANADIAN_ABORIGINAL */ - "yi ", /* PANGO_SCRIPT_YI */ - "tglg", /* PANGO_SCRIPT_TAGALOG */ - "hano", /* PANGO_SCRIPT_HANUNOO */ - "buhd", /* PANGO_SCRIPT_BUHID */ - "tagb", /* PANGO_SCRIPT_TAGBANWA */ - "brai", /* PANGO_SCRIPT_BRAILLE */ - "cprt", /* PANGO_SCRIPT_CYPRIOT */ - "limb", /* PANGO_SCRIPT_LIMBU */ - "osma", /* PANGO_SCRIPT_OSMANYA */ - "shaw", /* PANGO_SCRIPT_SHAVIAN */ - "linb", /* PANGO_SCRIPT_LINEAR_B */ - "tale", /* PANGO_SCRIPT_TAI_LE */ - "ugar", /* PANGO_SCRIPT_UGARITIC */ - "talu", /* PANGO_SCRIPT_NEW_TAI_LUE */ - "bugi", /* PANGO_SCRIPT_BUGINESE */ - "glag", /* PANGO_SCRIPT_GLAGOLITIC */ - "tfng", /* PANGO_SCRIPT_TIFINAGH */ - "sylo", /* PANGO_SCRIPT_SYLOTI_NAGRI */ - "xpeo", /* PANGO_SCRIPT_OLD_PERSIAN */ - "khar", /* PANGO_SCRIPT_KHAROSHTHI */ - "DFLT", /* PANGO_SCRIPT_UNKNOWN */ - "bali", /* PANGO_SCRIPT_BALINESE */ - "xsux", /* PANGO_SCRIPT_CUNEIFORM */ - "phnx", /* PANGO_SCRIPT_PHOENICIAN */ - "phag", /* PANGO_SCRIPT_PHAGS_PA */ - "nko " /* PANGO_SCRIPT_NKO */ +static const Tag ot_scripts[] = { + {"DFLT"}, /* PANGO_SCRIPT_COMMON */ + {"DFLT"}, /* PANGO_SCRIPT_INHERITED */ + {"arab"}, /* PANGO_SCRIPT_ARABIC */ + {"armn"}, /* PANGO_SCRIPT_ARMENIAN */ + {"beng"}, /* PANGO_SCRIPT_BENGALI */ + {"bopo"}, /* PANGO_SCRIPT_BOPOMOFO */ + {"cher"}, /* PANGO_SCRIPT_CHEROKEE */ + {"copt"}, /* PANGO_SCRIPT_COPTIC */ + {"cyrl"}, /* PANGO_SCRIPT_CYRILLIC */ + {"dsrt"}, /* PANGO_SCRIPT_DESERET */ + {"deva"}, /* PANGO_SCRIPT_DEVANAGARI */ + {"ethi"}, /* PANGO_SCRIPT_ETHIOPIC */ + {"geor"}, /* PANGO_SCRIPT_GEORGIAN */ + {"goth"}, /* PANGO_SCRIPT_GOTHIC */ + {"grek"}, /* PANGO_SCRIPT_GREEK */ + {"gujr"}, /* PANGO_SCRIPT_GUJARATI */ + {"guru"}, /* PANGO_SCRIPT_GURMUKHI */ + {"hani"}, /* PANGO_SCRIPT_HAN */ + {"hang"}, /* PANGO_SCRIPT_HANGUL */ + {"hebr"}, /* PANGO_SCRIPT_HEBREW */ + {"kana"}, /* PANGO_SCRIPT_HIRAGANA */ + {"knda"}, /* PANGO_SCRIPT_KANNADA */ + {"kana"}, /* PANGO_SCRIPT_KATAKANA */ + {"khmr"}, /* PANGO_SCRIPT_KHMER */ + {"lao "}, /* PANGO_SCRIPT_LAO */ + {"latn"}, /* PANGO_SCRIPT_LATIN */ + {"mlym"}, /* PANGO_SCRIPT_MALAYALAM */ + {"mong"}, /* PANGO_SCRIPT_MONGOLIAN */ + {"mymr"}, /* PANGO_SCRIPT_MYANMAR */ + {"ogam"}, /* PANGO_SCRIPT_OGHAM */ + {"ital"}, /* PANGO_SCRIPT_OLD_ITALIC */ + {"orya"}, /* PANGO_SCRIPT_ORIYA */ + {"runr"}, /* PANGO_SCRIPT_RUNIC */ + {"sinh"}, /* PANGO_SCRIPT_SINHALA */ + {"syrc"}, /* PANGO_SCRIPT_SYRIAC */ + {"taml"}, /* PANGO_SCRIPT_TAMIL */ + {"telu"}, /* PANGO_SCRIPT_TELUGU */ + {"thaa"}, /* PANGO_SCRIPT_THAANA */ + {"thai"}, /* PANGO_SCRIPT_THAI */ + {"tibt"}, /* PANGO_SCRIPT_TIBETAN */ + {"cans"}, /* PANGO_SCRIPT_CANADIAN_ABORIGINAL */ + {"yi "}, /* PANGO_SCRIPT_YI */ + {"tglg"}, /* PANGO_SCRIPT_TAGALOG */ + {"hano"}, /* PANGO_SCRIPT_HANUNOO */ + {"buhd"}, /* PANGO_SCRIPT_BUHID */ + {"tagb"}, /* PANGO_SCRIPT_TAGBANWA */ + {"brai"}, /* PANGO_SCRIPT_BRAILLE */ + {"cprt"}, /* PANGO_SCRIPT_CYPRIOT */ + {"limb"}, /* PANGO_SCRIPT_LIMBU */ + {"osma"}, /* PANGO_SCRIPT_OSMANYA */ + {"shaw"}, /* PANGO_SCRIPT_SHAVIAN */ + {"linb"}, /* PANGO_SCRIPT_LINEAR_B */ + {"tale"}, /* PANGO_SCRIPT_TAI_LE */ + {"ugar"}, /* PANGO_SCRIPT_UGARITIC */ + {"talu"}, /* PANGO_SCRIPT_NEW_TAI_LUE */ + {"bugi"}, /* PANGO_SCRIPT_BUGINESE */ + {"glag"}, /* PANGO_SCRIPT_GLAGOLITIC */ + {"tfng"}, /* PANGO_SCRIPT_TIFINAGH */ + {"sylo"}, /* PANGO_SCRIPT_SYLOTI_NAGRI */ + {"xpeo"}, /* PANGO_SCRIPT_OLD_PERSIAN */ + {"khar"}, /* PANGO_SCRIPT_KHAROSHTHI */ + {"DFLT"}, /* PANGO_SCRIPT_UNKNOWN */ + {"bali"}, /* PANGO_SCRIPT_BALINESE */ + {"xsux"}, /* PANGO_SCRIPT_CUNEIFORM */ + {"phnx"}, /* PANGO_SCRIPT_PHOENICIAN */ + {"phag"}, /* PANGO_SCRIPT_PHAGS_PA */ + {"nko "} /* PANGO_SCRIPT_NKO */ }; /** @@ -122,7 +127,7 @@ pango_ot_tag_from_script (PangoScript script) { g_return_val_if_fail (script >= 0 && (guint)script < G_N_ELEMENTS (ot_scripts), PANGO_OT_TAG_DEFAULT_SCRIPT); - return GUINT32_FROM_BE (* (PangoOTTag *) ot_scripts[script]); + return GUINT32_FROM_BE (ot_scripts[script].integer); } /** @@ -154,7 +159,7 @@ pango_ot_tag_to_script (PangoOTTag script_tag) for (i = 0; i < (PangoScript) G_N_ELEMENTS (ot_scripts); i++) { - guint32 tag = * (guint32 *) ot_scripts[i]; + guint32 tag = ot_scripts[i].integer; if (tag == be_tag) return i; @@ -166,7 +171,7 @@ pango_ot_tag_to_script (PangoOTTag script_tag) typedef struct { char language[6]; - char tag[4]; + Tag tag; } LangTag; /* @@ -178,203 +183,203 @@ typedef struct { * free to add. Keep sorted for bsearch purpose. */ static const LangTag ot_languages[] = { - {"aa", "AFR "}, - {"ab", "ABK "}, - {"ady", "ADY "}, - {"af", "AFK "}, - {"am", "AMH "}, - {"ar", "ARA "}, - {"as", "ASM "}, - {"awa", "AWA "}, - {"ay", "AYM "}, - {"az", "AZE "}, - {"ba", "BSH "}, - {"bal", "BLI "}, - {"bem", "BEM "}, - {"ber", "BBR "}, - {"bg", "BGR "}, - {"bho", "BHO "}, - {"bik", "BIK "}, - {"bin", "EDO "}, - {"bm", "BMB "}, - {"bn", "BEN "}, - {"bo", "TIB "}, - {"br", "BRE "}, - {"brh", "BRH "}, - {"ca", "CAT "}, - {"ce", "CHE "}, - {"ceb", "CEB "}, - {"chp", "CHP "}, - {"chr", "CHR "}, - {"cop", "COP "}, - {"cr", "CRE "}, - {"crh", "CRT "}, - {"cs", "CSY "}, - {"cu", "CSL "}, - {"cv", "CHU "}, - {"cy", "WEL "}, - {"da", "DAN "}, - {"dar", "DAR "}, - {"de", "DEU "}, - {"din", "DNK "}, - {"doi", "DGR "}, - {"dsb", "LSB "}, - {"dv", "DHV "}, - {"dz", "DZN "}, - {"ee", "EWE "}, - {"efi", "EFI "}, - {"el", "ELL "}, - {"en", "ENG "}, - {"eo", "NTO "}, - {"es", "ESP "}, - {"et", "ETI "}, - {"eu", "EUQ "}, - {"fa", "FAR "}, - {"ff", "FUL "}, - {"fi", "FIN "}, - {"fil", "PIL "}, - {"fj", "FJI "}, - {"fo", "FOS "}, - {"fon", "FON "}, - {"fr", "FRA "}, - {"fur", "FRL "}, - {"fy", "FRI "}, - {"ga", "IRI "}, - {"gaa", "GAD "}, - {"gd", "GAE "}, - {"gl", "GAL "}, - {"gn", "GUA "}, - {"gon", "GON "}, - {"gu", "GUJ "}, - {"ha", "HAU "}, - {"he", "IWR "}, - {"hi", "HIN "}, - {"hil", "HIL "}, - {"hr", "HRV "}, - {"hsb", "USB "}, - {"ht", "HAI "}, - {"hu", "HUN "}, - {"hy", "HYE "}, - {"id", "IND "}, - {"ig", "IBO "}, - {"inc", "SRK "}, - {"ine", "KHW "}, - {"inh", "ING "}, - {"is", "ISL "}, - {"it", "ITA "}, - {"iu", "INU "}, - {"ja", "JAN "}, - {"jv", "JAV "}, - {"ka", "KAT "}, - {"kam", "KMB "}, - {"kbd", "KAB "}, - {"kha", "KSI "}, - {"ki", "KIK "}, - {"kk", "KAZ "}, - {"kl", "GRN "}, - {"km", "KHM "}, - {"kn", "KAN "}, - {"ko", "KOR "}, - {"kok", "KOK "}, - {"kpe", "KPL "}, - {"kr", "KNR "}, - {"krl", "KRL "}, - {"kru", "KUU "}, - {"ks", "KSH "}, - {"ku", "KUR "}, - {"kum", "KUM "}, - {"ky", "KIR "}, - {"la", "LAT "}, - {"lad", "JUD "}, - {"lbj", "LDK "}, - {"ln", "LIN "}, - {"lo", "LAO "}, - {"lt", "LTH "}, - {"lv", "LVI "}, - {"mai", "MTH "}, - {"mdf", "MOK "}, - {"men", "MDE "}, - {"mg", "MLG "}, - {"mi", "MRI "}, - {"mkh", "KUY "}, - {"ml", "MLR "}, - {"mnc", "MCH "}, - {"mni", "MNI "}, - {"mnk", "MND "}, - {"mo", "MOL "}, - {"mr", "MAR "}, - {"ms", "MLY "}, - {"mt", "MTS "}, - {"mwr", "MAW "}, - {"my", "BRM "}, - {"myv", "ERZ "}, - {"ne", "NEP "}, - {"nl", "NLD "}, - {"no", "NOR "}, - {"ny", "CHI "}, - {"oc", "PRO "}, - {"om", "ORO "}, - {"or", "ORI "}, - {"os", "OSS "}, - {"pa", "PAN "}, - {"pi", "PAL "}, - {"pl", "PLK "}, - {"ps", "PAS "}, - {"pt", "PTG "}, - {"ro", "ROM "}, - {"rom", "ROY "}, - {"ru", "RUS "}, - {"sa", "SAN "}, - {"sat", "SAT "}, - {"sd", "SND "}, - {"sel", "SEL "}, - {"sg", "SGO "}, - {"shn", "SHN "}, - {"si", "SNH "}, - {"sid", "SID "}, - {"sk", "SKY "}, - {"sl", "SLV "}, - {"sm", "SMO "}, - {"smj", "LSM "}, - {"smn", "ISM "}, - {"sms", "SKS "}, - {"snk", "SNK "}, - {"so", "SML "}, - {"sq", "SQI "}, - {"sr", "SRB "}, - {"srr", "SRR "}, - {"sv", "SVE "}, - {"sw", "SWK "}, - {"syr", "SYR "}, - {"ta", "TAM "}, - {"te", "TEL "}, - {"tg", "TAJ "}, - {"th", "THA "}, - {"ti", "TGY "}, - {"tig", "TGR "}, - {"tk", "TKM "}, - {"tn", "TNA "}, - {"tr", "TRK "}, - {"ts", "TSG "}, - {"tw", "TWI "}, - {"udm", "UDM "}, - {"ug", "UYG "}, - {"uk", "UKR "}, - {"ur", "URD "}, - {"uz", "UZB "}, - {"ve", "VEN "}, - {"vi", "VIT "}, - {"wo", "WLF "}, - {"xal", "KLM "}, - {"xh", "XHS "}, - {"yi", "JII "}, - {"yo", "YBA "}, - {"zh-cn", "ZHS "}, - {"zh-hk", "ZHH "}, - {"zh-mo", "ZHT "}, - {"zh-sg", "ZHS "}, - {"zh-tw", "ZHT "}, - {"zu", "ZUL "} + {"aa", {"AFR "}}, + {"ab", {"ABK "}}, + {"ady", {"ADY "}}, + {"af", {"AFK "}}, + {"am", {"AMH "}}, + {"ar", {"ARA "}}, + {"as", {"ASM "}}, + {"awa", {"AWA "}}, + {"ay", {"AYM "}}, + {"az", {"AZE "}}, + {"ba", {"BSH "}}, + {"bal", {"BLI "}}, + {"bem", {"BEM "}}, + {"ber", {"BBR "}}, + {"bg", {"BGR "}}, + {"bho", {"BHO "}}, + {"bik", {"BIK "}}, + {"bin", {"EDO "}}, + {"bm", {"BMB "}}, + {"bn", {"BEN "}}, + {"bo", {"TIB "}}, + {"br", {"BRE "}}, + {"brh", {"BRH "}}, + {"ca", {"CAT "}}, + {"ce", {"CHE "}}, + {"ceb", {"CEB "}}, + {"chp", {"CHP "}}, + {"chr", {"CHR "}}, + {"cop", {"COP "}}, + {"cr", {"CRE "}}, + {"crh", {"CRT "}}, + {"cs", {"CSY "}}, + {"cu", {"CSL "}}, + {"cv", {"CHU "}}, + {"cy", {"WEL "}}, + {"da", {"DAN "}}, + {"dar", {"DAR "}}, + {"de", {"DEU "}}, + {"din", {"DNK "}}, + {"doi", {"DGR "}}, + {"dsb", {"LSB "}}, + {"dv", {"DHV "}}, + {"dz", {"DZN "}}, + {"ee", {"EWE "}}, + {"efi", {"EFI "}}, + {"el", {"ELL "}}, + {"en", {"ENG "}}, + {"eo", {"NTO "}}, + {"es", {"ESP "}}, + {"et", {"ETI "}}, + {"eu", {"EUQ "}}, + {"fa", {"FAR "}}, + {"ff", {"FUL "}}, + {"fi", {"FIN "}}, + {"fil", {"PIL "}}, + {"fj", {"FJI "}}, + {"fo", {"FOS "}}, + {"fon", {"FON "}}, + {"fr", {"FRA "}}, + {"fur", {"FRL "}}, + {"fy", {"FRI "}}, + {"ga", {"IRI "}}, + {"gaa", {"GAD "}}, + {"gd", {"GAE "}}, + {"gl", {"GAL "}}, + {"gn", {"GUA "}}, + {"gon", {"GON "}}, + {"gu", {"GUJ "}}, + {"ha", {"HAU "}}, + {"he", {"IWR "}}, + {"hi", {"HIN "}}, + {"hil", {"HIL "}}, + {"hr", {"HRV "}}, + {"hsb", {"USB "}}, + {"ht", {"HAI "}}, + {"hu", {"HUN "}}, + {"hy", {"HYE "}}, + {"id", {"IND "}}, + {"ig", {"IBO "}}, + {"inc", {"SRK "}}, + {"ine", {"KHW "}}, + {"inh", {"ING "}}, + {"is", {"ISL "}}, + {"it", {"ITA "}}, + {"iu", {"INU "}}, + {"ja", {"JAN "}}, + {"jv", {"JAV "}}, + {"ka", {"KAT "}}, + {"kam", {"KMB "}}, + {"kbd", {"KAB "}}, + {"kha", {"KSI "}}, + {"ki", {"KIK "}}, + {"kk", {"KAZ "}}, + {"kl", {"GRN "}}, + {"km", {"KHM "}}, + {"kn", {"KAN "}}, + {"ko", {"KOR "}}, + {"kok", {"KOK "}}, + {"kpe", {"KPL "}}, + {"kr", {"KNR "}}, + {"krl", {"KRL "}}, + {"kru", {"KUU "}}, + {"ks", {"KSH "}}, + {"ku", {"KUR "}}, + {"kum", {"KUM "}}, + {"ky", {"KIR "}}, + {"la", {"LAT "}}, + {"lad", {"JUD "}}, + {"lbj", {"LDK "}}, + {"ln", {"LIN "}}, + {"lo", {"LAO "}}, + {"lt", {"LTH "}}, + {"lv", {"LVI "}}, + {"mai", {"MTH "}}, + {"mdf", {"MOK "}}, + {"men", {"MDE "}}, + {"mg", {"MLG "}}, + {"mi", {"MRI "}}, + {"mkh", {"KUY "}}, + {"ml", {"MLR "}}, + {"mnc", {"MCH "}}, + {"mni", {"MNI "}}, + {"mnk", {"MND "}}, + {"mo", {"MOL "}}, + {"mr", {"MAR "}}, + {"ms", {"MLY "}}, + {"mt", {"MTS "}}, + {"mwr", {"MAW "}}, + {"my", {"BRM "}}, + {"myv", {"ERZ "}}, + {"ne", {"NEP "}}, + {"nl", {"NLD "}}, + {"no", {"NOR "}}, + {"ny", {"CHI "}}, + {"oc", {"PRO "}}, + {"om", {"ORO "}}, + {"or", {"ORI "}}, + {"os", {"OSS "}}, + {"pa", {"PAN "}}, + {"pi", {"PAL "}}, + {"pl", {"PLK "}}, + {"ps", {"PAS "}}, + {"pt", {"PTG "}}, + {"ro", {"ROM "}}, + {"rom", {"ROY "}}, + {"ru", {"RUS "}}, + {"sa", {"SAN "}}, + {"sat", {"SAT "}}, + {"sd", {"SND "}}, + {"sel", {"SEL "}}, + {"sg", {"SGO "}}, + {"shn", {"SHN "}}, + {"si", {"SNH "}}, + {"sid", {"SID "}}, + {"sk", {"SKY "}}, + {"sl", {"SLV "}}, + {"sm", {"SMO "}}, + {"smj", {"LSM "}}, + {"smn", {"ISM "}}, + {"sms", {"SKS "}}, + {"snk", {"SNK "}}, + {"so", {"SML "}}, + {"sq", {"SQI "}}, + {"sr", {"SRB "}}, + {"srr", {"SRR "}}, + {"sv", {"SVE "}}, + {"sw", {"SWK "}}, + {"syr", {"SYR "}}, + {"ta", {"TAM "}}, + {"te", {"TEL "}}, + {"tg", {"TAJ "}}, + {"th", {"THA "}}, + {"ti", {"TGY "}}, + {"tig", {"TGR "}}, + {"tk", {"TKM "}}, + {"tn", {"TNA "}}, + {"tr", {"TRK "}}, + {"ts", {"TSG "}}, + {"tw", {"TWI "}}, + {"udm", {"UDM "}}, + {"ug", {"UYG "}}, + {"uk", {"UKR "}}, + {"ur", {"URD "}}, + {"uz", {"UZB "}}, + {"ve", {"VEN "}}, + {"vi", {"VIT "}}, + {"wo", {"WLF "}}, + {"xal", {"KLM "}}, + {"xh", {"XHS "}}, + {"yi", {"JII "}}, + {"yo", {"YBA "}}, + {"zh-cn", {"ZHS "}}, + {"zh-hk", {"ZHH "}}, + {"zh-mo", {"ZHT "}}, + {"zh-sg", {"ZHS "}}, + {"zh-tw", {"ZHT "}}, + {"zu", {"ZUL "}} }; static int @@ -450,7 +455,7 @@ pango_ot_tag_from_language (PangoLanguage *language) } if (lang_tag) - return GUINT32_FROM_BE (* (PangoOTTag *) lang_tag->tag); + return GUINT32_FROM_BE (lang_tag->tag.integer); return PANGO_OT_TAG_DEFAULT_LANGUAGE; } @@ -474,7 +479,7 @@ pango_ot_tag_to_language (PangoOTTag language_tag) for (i = 0; i < (int) G_N_ELEMENTS (ot_languages); i++) { - guint32 tag = * (guint32 *) ot_languages[i].tag; + guint32 tag = ot_languages[i].tag.integer; if (tag == be_tag) return pango_language_from_string (ot_languages[i].language); diff --git a/pango/pango-ot.h b/pango/pango-ot.h index 60d2a55c..52cc30f0 100644 --- a/pango/pango-ot.h +++ b/pango/pango-ot.h @@ -34,6 +34,12 @@ G_BEGIN_DECLS typedef guint32 PangoOTTag; +#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4) ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4)) +#define PANGO_OT_TAG_MAKE_FROM_STRING(s) (PANGO_OT_TAG_MAKE(((const char *) s)[0], \ + ((const char *) s)[1], \ + ((const char *) s)[2], \ + ((const char *) s)[3])) + typedef struct _PangoOTInfo PangoOTInfo; typedef struct _PangoOTBuffer PangoOTBuffer; typedef struct _PangoOTGlyph PangoOTGlyph; @@ -47,14 +53,13 @@ typedef enum PANGO_OT_TABLE_GPOS } PangoOTTableType; +#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF) +#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF) +#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF) +#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF) -#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF) -#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF) -#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF) -#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF) - -#define PANGO_OT_TAG_DEFAULT_SCRIPT ((PangoOTTag) (FT_MAKE_TAG ('D', 'F', 'L', 'T'))) -#define PANGO_OT_TAG_DEFAULT_LANGUAGE ((PangoOTTag) (FT_MAKE_TAG ('d', 'f', 'l', 't'))) +#define PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T') +#define PANGO_OT_TAG_DEFAULT_LANGUAGE PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't') /* Note that this must match HB_GlyphItem */ struct _PangoOTGlyph diff --git a/pango/pangocairo-fontmap.c b/pango/pangocairo-fontmap.c index ad381160..d0fe716f 100644 --- a/pango/pangocairo-fontmap.c +++ b/pango/pangocairo-fontmap.c @@ -105,6 +105,7 @@ pango_cairo_font_map_new (void) /** * pango_cairo_font_map_new_for_font_type: + * @fonttype: desired #cairo_font_type_t * * Creates a new #PangoCairoFontMap object of the type suitable * to be used with cairo font backend of type @fonttype. |