]> git.wh0rd.org - fontconfig.git/commitdiff
Add FcGetLangs() and FcLangGetCharSet().
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 5 Nov 2007 20:29:44 +0000 (15:29 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 5 Nov 2007 20:29:44 +0000 (15:29 -0500)
doc/fclangset.fncs
fontconfig/fontconfig.h
src/fcint.h
src/fclang.c

index 8ae5f5c1c9cd069ac18b11b3625fecb4b9e19f21..3f69f0d3040f0f01843fab81d88714abe4078d7c 100644 (file)
@@ -122,3 +122,19 @@ a matching language but differs in which territory that language is for, this
 function returns FcLangDiffentTerritory. If <parameter>ls</parameter> 
 has no matching language, this function returns FcLangDifferentLang.
 @@
+
+@RET@          FcStrSet *
+@FUNC@         FcGetLangs
+@TYPE1@                void
+@PURPOSE@      Get list of languages
+@DESC@
+Returns a string set of all known languages.
+@@
+
+@RET@          const FcCharSet *
+@FUNC@         FcLangGetCharSet
+@TYPE1@                const FcChar8 *                 @ARG1@          lang
+@PURPOSE@      Get character map for a language
+@DESC@
+Returns the FcCharMap for a language.
+@@
index 234064082cdb9df3b35632ff65db3c3df74f55a0..77276e64e1ca5ac0f347076d04abf92c1dd6c2db 100644 (file)
@@ -551,6 +551,12 @@ FcPublic FcBool
 FcInitBringUptoDate (void);
 
 /* fclang.c */
+FcStrSet *
+FcGetLangs (void);
+
+FcPublic const FcCharSet *
+FcLangGetCharSet (const FcChar8 *lang);
+
 FcPublic FcLangSet*
 FcLangSetCreate (void);
 
index 329092dff0ca1a3c56b920d6c04a83db5783e718..62a04b8e5266016f7dc2b4c22dc7b29aefde45f0 100644 (file)
@@ -890,9 +890,6 @@ FcFreeTypeLangSet (const FcCharSet  *charset,
 FcPrivate FcLangResult
 FcLangCompare (const FcChar8 *s1, const FcChar8 *s2);
     
-FcPrivate const FcCharSet *
-FcCharSetForLang (const FcChar8 *lang);
-
 FcPrivate FcLangSet *
 FcLangSetPromote (const FcChar8 *lang);
 
index 361803a60e44a295263626dce35d1396f96abebc..7aa5f3cfb067f187a9d10141f94c29d3c9152c2b 100644 (file)
@@ -54,7 +54,7 @@ FcFreeTypeLangSet (const FcCharSet  *charset,
     FcLangSet      *ls;
 
     if (exclusiveLang)
-       exclusiveCharset = FcCharSetForLang (exclusiveLang);
+       exclusiveCharset = FcLangGetCharSet (exclusiveLang);
     ls = FcLangSetCreate ();
     if (!ls)
        return 0;
@@ -196,7 +196,7 @@ FcLangContains (const FcChar8 *super, const FcChar8 *sub)
 }
 
 const FcCharSet *
-FcCharSetForLang (const FcChar8 *lang)
+FcLangGetCharSet (const FcChar8 *lang)
 {
     int                i;
     int                country = -1;
@@ -218,6 +218,22 @@ FcCharSetForLang (const FcChar8 *lang)
     return &fcLangCharSets[country].charset;
 }
 
+FcStrSet *
+FcGetLangs (void)
+{
+    FcStrSet *langs;
+    int        i;
+
+    langs = FcStrSetCreate();
+    if (!langs)
+       return 0;
+
+    for (i = 0; i < NUM_LANG_CHAR_SET; i++)
+       FcStrSetAdd (langs, fcLangCharSets[i].lang);
+
+    return langs;
+}
+
 FcLangSet *
 FcLangSetCreate (void)
 {