1 Fontconfig Developers Reference, Version 2.13.0
3 Copyright © 2002 Keith Packard
5 Permission to use, copy, modify, distribute, and sell this
6 software and its documentation for any purpose is hereby
7 granted without fee, provided that the above copyright notice
8 appear in all copies and that both that copyright notice and
9 this permission notice appear in supporting documentation, and
10 that the name of the author(s) not be used in advertising or
11 publicity pertaining to distribution of the software without
12 specific, written prior permission. The authors make no
13 representations about the suitability of this software for any
14 purpose. It is provided "as is" without express or implied
17 THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
18 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19 AND FITNESS, IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY
20 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
22 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
23 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25 _______________________________________________
35 Fontconfig is a library designed to provide system-wide font
36 configuration, customization and application access.
37 __________________________________________________________
41 Fontconfig contains two essential modules, the configuration
42 module which builds an internal configuration from XML files
43 and the matching module which accepts font patterns and returns
44 the nearest matching font.
45 __________________________________________________________
49 The configuration module consists of the FcConfig datatype,
50 libexpat and FcConfigParse which walks over an XML tree and
51 amends a configuration with data found within. From an external
52 perspective, configuration of the library consists of
53 generating a valid XML tree and feeding that to FcConfigParse.
54 The only other mechanism provided to applications for changing
55 the running configuration is to add fonts and directories to
56 the list of application-provided font files.
58 The intent is to make font configurations relatively static,
59 and shared by as many applications as possible. It is hoped
60 that this will lead to more stable font selection when passing
61 names from one application to another. XML was chosen as a
62 configuration file format because it provides a format which is
63 easy for external agents to edit while retaining the correct
66 Font configuration is separate from font matching; applications
67 needing to do their own matching can access the available fonts
68 from the library and perform private matching. The intent is to
69 permit applications to pick and choose appropriate
70 functionality from the library instead of forcing them to
71 choose between this library and a private configuration
72 mechanism. The hope is that this will ensure that configuration
73 of fonts for all applications can be centralized in one place.
74 Centralizing font configuration will simplify and regularize
75 font installation and customization.
76 __________________________________________________________
80 While font patterns may contain essentially any properties,
81 there are some well known properties with associated types.
82 Fontconfig uses some of these properties for font matching and
83 font completion. Others are provided as a convenience for the
84 application's rendering mechanism.
87 Property C Preprocessor Symbol Type Description
88 ----------------------------------------------------
89 family FC_FAMILY String Font family names
90 familylang FC_FAMILYLANG String Language corresponding
93 style FC_STYLE String Font style. Overrides
96 stylelang FC_STYLELANG String Language corresponding
99 fullname FC_FULLNAME String Font face full name wh
101 different from family
104 fullnamelang FC_FULLNAMELANG String Language corresponding
107 slant FC_SLANT Int Italic, oblique or rom
109 weight FC_WEIGHT Int Light, medium, demibol
112 size FC_SIZE Double Point size
113 width FC_WIDTH Int Condensed, normal or e
115 aspect FC_ASPECT Double Stretches glyphs horiz
118 pixelsize FC_PIXEL_SIZE Double Pixel size
119 spacing FC_SPACING Int Proportional, dual-wid
121 monospace or charcell
122 foundry FC_FOUNDRY String Font foundry name
123 antialias FC_ANTIALIAS Bool Whether glyphs can be
125 hinting FC_HINTING Bool Whether the rasterizer
128 hintstyle FC_HINT_STYLE Int Automatic hinting styl
130 verticallayout FC_VERTICAL_LAYOUT Bool Use vertical layout
131 autohint FC_AUTOHINT Bool Use autohinter instead
134 globaladvance FC_GLOBAL_ADVANCE Bool Use font global advanc
136 file FC_FILE String The filename holding t
138 index FC_INDEX Int The index of the font
141 ftface FC_FT_FACE FT_Face Use the specified Free
144 rasterizer FC_RASTERIZER String Which rasterizer is in
146 outline FC_OUTLINE Bool Whether the glyphs are
148 scalable FC_SCALABLE Bool Whether glyphs can be
150 scale FC_SCALE Double Scale factor for point
152 conversions (deprecate
154 symbol FC_SYMBOL Bool Whether font uses MS s
156 color FC_COLOR Bool Whether any glyphs hav
158 dpi FC_DPI Double Target dots per inch
159 rgba FC_RGBA Int unknown, rgb, bgr, vrg
161 vbgr, none - subpixel
163 lcdfilter FC_LCD_FILTER Int Type of LCD filter
164 minspace FC_MINSPACE Bool Eliminate leading from
167 charset FC_CHARSET CharSet Unicode chars encoded
170 lang FC_LANG LangSet Set of RFC-3066-style
171 languages this font su
173 fontversion FC_FONTVERSION Int Version number of the
175 capability FC_CAPABILITY String List of layout capabil
178 fontformat FC_FONTFORMAT String String name of the fon
180 embolden FC_EMBOLDEN Bool Rasterizer should
181 synthetically embolden
183 embeddedbitmap FC_EMBEDDED_BITMAP Bool Use the embedded bitma
186 decorative FC_DECORATIVE Bool Whether the style is a
189 fontfeatures FC_FONT_FEATURES String List of extra feature
191 OpenType to be enabled
192 namelang FC_NAMELANG String Language name to be us
194 default value of famil
196 stylelang and fullname
198 prgname FC_PRGNAME String Name of the running pr
200 hash FC_HASH String SHA256 hash value of t
202 with "sha256:" prefix
204 postscriptname FC_POSTSCRIPT_NAME String Font name in PostScrip
206 __________________________________________________________
210 Fontconfig uses abstract data types to hide internal
211 implementation details for most data structures. A few
212 structures are exposed where appropriate.
213 __________________________________________________________
215 FcChar8, FcChar16, FcChar32, FcBool
217 These are primitive data types; the FcChar* types hold
218 precisely the number of bits stated (if supported by the C
219 implementation). FcBool holds one of two C preprocessor
220 symbols: FcFalse or FcTrue.
221 __________________________________________________________
225 An FcMatrix holds an affine transformation, usually used to
226 reshape glyphs. A small set of matrix operations are provided
228 typedef struct _FcMatrix {
229 double xx, xy, yx, yy;
231 __________________________________________________________
235 An FcCharSet is an abstract type that holds the set of encoded
236 Unicode chars in a font. Operations to build and compare these
238 __________________________________________________________
242 An FcLangSet is an abstract type that holds the set of
243 languages supported by a font. Operations to build and compare
244 these sets are provided. These are computed for a font based on
245 orthographic information built into the fontconfig library.
246 Fontconfig has orthographies for all of the ISO 639-1 languages
247 except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA.
248 If you have orthographic information for any of these
249 languages, please submit them.
250 __________________________________________________________
254 An FcLangResult is an enumeration used to return the results of
255 comparing two language strings or FcLangSet objects.
256 FcLangEqual means the objects match language and territory.
257 FcLangDifferentTerritory means the objects match in language
258 but differ in territory. FcLangDifferentLang means the objects
260 __________________________________________________________
264 Tags the kind of data stored in an FcValue.
265 __________________________________________________________
269 An FcValue object holds a single value with one of a number of
270 different types. The 'type' tag indicates which member is
272 typedef struct _FcValue {
288 Type Union member Datatype
289 --------------------------------
290 FcTypeVoid (none) (none)
292 FcTypeDouble d double
293 FcTypeString s FcChar8 *
295 FcTypeMatrix m FcMatrix *
296 FcTypeCharSet c FcCharSet *
297 FcTypeFTFace f void * (FT_Face)
298 FcTypeLangSet l FcLangSet *
299 __________________________________________________________
303 holds a set of names with associated value lists; each name
304 refers to a property of a font. FcPatterns are used as inputs
305 to the matching code as well as holding information about
306 specific fonts. Each property can hold one or more values;
307 conventionally all of the same type, although the interface
309 __________________________________________________________
313 typedef struct _FcFontSet {
319 An FcFontSet contains a list of FcPatterns. Internally
320 fontconfig uses this data structure to hold sets of fonts.
321 Externally, fontconfig returns the results of listing fonts in
322 this format. 'nfont' holds the number of patterns in the
323 'fonts' array; 'sfont' is used to indicate the size of that
325 __________________________________________________________
329 FcStrSet holds a list of strings that can be appended to and
330 enumerated. Its unique characteristic is that the enumeration
331 works even while strings are appended during enumeration.
332 FcStrList is used during enumeration to safely and correctly
333 walk the list of strings even while that list is edited in the
334 middle of enumeration.
335 __________________________________________________________
339 typedef struct _FcObjectSet {
342 const char **objects;
345 holds a set of names and is used to specify which fields from
346 fonts are placed in the the list of returned patterns when
348 __________________________________________________________
352 typedef struct _FcObjectType {
357 marks the type of a pattern element generated when parsing font
358 names. Applications can add new object types so that font names
359 may contain the new elements.
360 __________________________________________________________
364 typedef struct _FcConstant {
370 Provides for symbolic constants for new pattern elements. When
371 'name' is seen in a font name, an 'object' element is created
373 __________________________________________________________
377 holds a list of Unicode chars which are expected to be blank;
378 unexpectedly blank chars are assumed to be invalid and are
379 elided from the charset associated with the font.
381 FcBlanks is deprecated and should not be used in newly written
382 code. It is still accepted by some functions for compatibility
383 with older code but will be removed in the future.
384 __________________________________________________________
388 holds the per-user cache information for use while loading the
389 font database. This is built automatically for the current
390 configuration when that is loaded. Applications must always
391 pass '0' when one is requested.
392 __________________________________________________________
396 holds a complete configuration of the library; there is one
397 default configuration, other can be constructed from XML data
398 structures. All public entry points that need global data can
399 take an optional FcConfig* argument; passing 0 uses the default
400 configuration. FcConfig objects hold two sets of fonts, the
401 first contains those specified by the configuration, the second
402 set holds those added by the application at run-time.
403 Interfaces that need to reference a particular set use one of
404 the FcSetName enumerated values.
405 __________________________________________________________
409 Specifies one of the two sets of fonts available in a
410 configuration; FcSetSystem for those fonts specified in the
411 configuration and FcSetApplication which holds fonts provided
413 __________________________________________________________
417 Used as a return type for functions manipulating FcPattern
421 -----------------------------------------------------------
422 FcResultMatch Object exists with the specified ID
423 FcResultNoMatch Object doesn't exist at all
424 FcResultTypeMismatch Object exists, but the type doesn't matc
426 FcResultNoId Object exists, but has fewer values
428 FcResultOutOfMemory malloc failed
429 __________________________________________________________
433 Used for locking access to configuration files. Provides a safe
434 way to update configuration files.
435 __________________________________________________________
439 Holds information about the fonts contained in a single
440 directory. Normal applications need not worry about this as
441 caches for font access are automatically managed by the
442 library. Applications dealing with cache management may want to
443 use some of these objects in their work, however the included
444 'fc-cache' program generally suffices for all of that.
445 __________________________________________________________
449 These are grouped by functionality, often using the main data
450 type being manipulated.
451 __________________________________________________________
456 FcInitLoadConfig -- load configuration
457 FcInitLoadConfigAndFonts -- load configuration and font data
458 FcInit -- initialize fontconfig library
459 FcFini -- finalize fontconfig library
460 FcGetVersion -- library version number
461 FcInitReinitialize -- re-initialize library
462 FcInitBringUptoDate -- reload configuration files if needed
464 These functions provide some control over how the library is
471 FcInitLoadConfig -- load configuration
475 #include <fontconfig/fontconfig.h>
477 FcConfig * FcInitLoadConfig(void);
481 Loads the default configuration file and returns the resulting
482 configuration. Does not load any font information.
484 FcInitLoadConfigAndFonts
488 FcInitLoadConfigAndFonts -- load configuration and font data
492 #include <fontconfig/fontconfig.h>
494 FcConfig * FcInitLoadConfigAndFonts(void);
498 Loads the default configuration file and builds information
499 about the available fonts. Returns the resulting configuration.
505 FcInit -- initialize fontconfig library
509 #include <fontconfig/fontconfig.h>
515 Loads the default configuration file and the fonts referenced
516 therein and sets the default configuration to that result.
517 Returns whether this process succeeded or not. If the default
518 configuration has already been loaded, this routine does
519 nothing and returns FcTrue.
525 FcFini -- finalize fontconfig library
529 #include <fontconfig/fontconfig.h>
535 Frees all data structures allocated by previous calls to
536 fontconfig functions. Fontconfig returns to an uninitialized
537 state, requiring a new call to one of the FcInit functions
538 before any other fontconfig function may be called.
544 FcGetVersion -- library version number
548 #include <fontconfig/fontconfig.h>
550 int FcGetVersion(void);
554 Returns the version number of the library.
560 FcInitReinitialize -- re-initialize library
564 #include <fontconfig/fontconfig.h>
566 FcBool FcInitReinitialize(void);
570 Forces the default configuration file to be reloaded and resets
571 the default configuration. Returns FcFalse if the configuration
572 cannot be reloaded (due to configuration file errors,
573 allocation failures or other issues) and leaves the existing
574 configuration unchanged. Otherwise returns FcTrue.
580 FcInitBringUptoDate -- reload configuration files if needed
584 #include <fontconfig/fontconfig.h>
586 FcBool FcInitBringUptoDate(void);
590 Checks the rescan interval in the default configuration,
591 checking the configuration if the interval has passed and
592 reloading the configuration if when any changes are detected.
593 Returns FcFalse if the configuration cannot be reloaded (see
594 FcInitReinitialize). Otherwise returns FcTrue.
595 __________________________________________________________
600 FcPatternCreate -- Create a pattern
601 FcPatternDuplicate -- Copy a pattern
602 FcPatternReference -- Increment pattern reference count
603 FcPatternDestroy -- Destroy a pattern
604 FcPatternEqual -- Compare patterns
605 FcPatternEqualSubset -- Compare portions of patterns
606 FcPatternFilter -- Filter the objects of pattern
607 FcPatternHash -- Compute a pattern hash value
608 FcPatternAdd -- Add a value to a pattern
609 FcPatternAddWeak -- Add a value to a pattern with weak binding
610 FcPatternAdd-Type -- Add a typed value to a pattern
611 FcPatternGetWithBinding -- Return a value with binding from a
614 FcPatternGet -- Return a value from a pattern
615 FcPatternGet-Type -- Return a typed value from a pattern
616 FcPatternBuild -- Create patterns from arguments
617 FcPatternDel -- Delete a property from a pattern
618 FcPatternRemove -- Remove one object of the specified type from
621 FcPatternPrint -- Print a pattern for debugging
622 FcDefaultSubstitute -- Perform default substitutions in a
625 FcNameParse -- Parse a pattern string
626 FcNameUnparse -- Convert a pattern back into a string that can
629 FcPatternFormat -- Format a pattern into a string according to
632 An FcPattern is an opaque type that holds both patterns to
633 match against the available fonts, as well as the information
640 FcPatternCreate -- Create a pattern
644 #include <fontconfig/fontconfig.h>
646 FcPattern * FcPatternCreate(void);
650 Creates a pattern with no properties; used to build patterns
657 FcPatternDuplicate -- Copy a pattern
661 #include <fontconfig/fontconfig.h>
663 FcPattern * FcPatternDuplicate(const FcPattern *p);
667 Copy a pattern, returning a new pattern that matches p. Each
668 pattern may be modified without affecting the other.
674 FcPatternReference -- Increment pattern reference count
678 #include <fontconfig/fontconfig.h>
680 void FcPatternReference(FcPattern *p);
684 Add another reference to p. Patterns are freed only when the
685 reference count reaches zero.
691 FcPatternDestroy -- Destroy a pattern
695 #include <fontconfig/fontconfig.h>
697 void FcPatternDestroy(FcPattern *p);
701 Decrement the pattern reference count. If all references are
702 gone, destroys the pattern, in the process destroying all
709 FcPatternEqual -- Compare patterns
713 #include <fontconfig/fontconfig.h>
715 FcBool FcPatternEqual(const FcPattern *pa, const FcPattern
720 Returns whether pa and pb are exactly alike.
726 FcPatternEqualSubset -- Compare portions of patterns
730 #include <fontconfig/fontconfig.h>
732 FcBool FcPatternEqualSubset(const FcPattern *pa, const
733 FcPattern *pb, const FcObjectSet *os);
737 Returns whether pa and pb have exactly the same values for all
738 of the objects in os.
744 FcPatternFilter -- Filter the objects of pattern
748 #include <fontconfig/fontconfig.h>
750 FcPattern * FcPatternFilter(FcPattern *p, const FcObjectSet *);
754 Returns a new pattern that only has those objects from p that
755 are in os. If os is NULL, a duplicate of p is returned.
761 FcPatternHash -- Compute a pattern hash value
765 #include <fontconfig/fontconfig.h>
767 FcChar32 FcPatternHash(const FcPattern *p);
771 Returns a 32-bit number which is the same for any two patterns
778 FcPatternAdd -- Add a value to a pattern
782 #include <fontconfig/fontconfig.h>
784 FcBool FcPatternAdd(FcPattern *p, const char *object, FcValue
785 value, FcBool append);
789 Adds a single value to the list of values associated with the
790 property named `object. If `append is FcTrue, the value is
791 added at the end of any existing list, otherwise it is inserted
792 at the beginning. `value' is saved (with FcValueSave) when
793 inserted into the pattern so that the library retains no
794 reference to any application-supplied data structure.
800 FcPatternAddWeak -- Add a value to a pattern with weak binding
804 #include <fontconfig/fontconfig.h>
806 FcBool FcPatternAddWeak(FcPattern *p, const char *object,
807 FcValue value, FcBool append);
811 FcPatternAddWeak is essentially the same as FcPatternAdd except
812 that any values added to the list have binding weak instead of
819 FcPatternAddInteger, FcPatternAddDouble, FcPatternAddString,
820 FcPatternAddMatrix, FcPatternAddCharSet, FcPatternAddBool,
821 FcPatternAddFTFace, FcPatternAddLangSet,
822 FcPatternAddRange -- Add a typed value to a pattern
826 #include <fontconfig/fontconfig.h>
828 FcBool FcPatternAddInteger(FcPattern *p, const char *object,
831 FcBool FcPatternAddDouble(FcPattern *p, const char *object,
834 FcBool FcPatternAddString(FcPattern *p, const char *object,
837 FcBool FcPatternAddMatrix(FcPattern *p, const char *object,
840 FcBool FcPatternAddCharSet(FcPattern *p, const char *object,
843 FcBool FcPatternAddBool(FcPattern *p, const char *object,
846 FcBool FcPatternAddFTFace(FcPattern *p, const char *object,
849 FcBool FcPatternAddLangSet(FcPattern *p, const char *object,
852 FcBool FcPatternAddRange(FcPattern *p, const char *object,
857 These are all convenience functions that insert objects of the
858 specified type into the pattern. Use these in preference to
859 FcPatternAdd as they will provide compile-time typechecking.
860 These all append values to any existing list of values.
861 FcPatternAddRange are available since 2.11.91.
863 FcPatternGetWithBinding
867 FcPatternGetWithBinding -- Return a value with binding from a
872 #include <fontconfig/fontconfig.h>
874 FcResult FcPatternGetWithBinding(FcPattern *p, const char
875 *object, int id, FcValue *v, FcValueBinding *b);
879 Returns in v the id'th value and b binding for that associated
880 with the property object. The Value returned is not a copy, but
881 rather refers to the data stored within the pattern directly.
882 Applications must not free this value.
892 FcPatternGet -- Return a value from a pattern
896 #include <fontconfig/fontconfig.h>
898 FcResult FcPatternGet(FcPattern *p, const char *object, int id,
903 Returns in v the id'th value associated with the property
904 object. The value returned is not a copy, but rather refers to
905 the data stored within the pattern directly. Applications must
912 FcPatternGetInteger, FcPatternGetDouble, FcPatternGetString,
913 FcPatternGetMatrix, FcPatternGetCharSet, FcPatternGetBool,
914 FcPatternGetFTFace, FcPatternGetLangSet,
915 FcPatternGetRange -- Return a typed value from a pattern
919 #include <fontconfig/fontconfig.h>
921 FcResult FcPatternGetInteger(FcPattern *p, const char *object,
924 FcResult FcPatternGetDouble(FcPattern *p, const char *object,
927 FcResult FcPatternGetString(FcPattern *p, const char *object,
930 FcResult FcPatternGetMatrix(FcPattern *p, const char *object,
931 int n, FcMatrix **s);
933 FcResult FcPatternGetCharSet(FcPattern *p, const char *object,
934 int n, FcCharSet **c);
936 FcResult FcPatternGetBool(FcPattern *p, const char *object, int
939 FcResult FcPatternGetFTFace(FcPattern *p, const char *object,
942 FcResult FcPatternGetLangSet(FcPattern *p, const char *object,
943 int n, FcLangSet **l);
945 FcResult FcPatternGetRange(FcPattern *p, const char *object,
950 These are convenience functions that call FcPatternGet and
951 verify that the returned data is of the expected type. They
952 return FcResultTypeMismatch if this is not the case. Note that
953 these (like FcPatternGet) do not make a copy of any data
954 structure referenced by the return value. Use these in
955 preference to FcPatternGet to provide compile-time
956 typechecking. FcPatternGetRange are available since 2.11.91.
962 FcPatternBuild, FcPatternVaBuild, FcPatternVapBuild -- Create
963 patterns from arguments
967 #include <fontconfig/fontconfig.h>
969 FcPattern * FcPatternBuild(FcPattern *pattern, ...);
971 FcPattern * FcPatternVaBuild(FcPattern *pattern, va_list va);
973 void FcPatternVapBuild(FcPattern *result, FcPattern *pattern,
978 Builds a pattern using a list of objects, types and values.
979 Each value to be entered in the pattern is specified with three
982 1. Object name, a string describing the property to be added.
983 2. Object type, one of the FcType enumerated values
984 3. Value, not an FcValue, but the raw type as passed to any of
985 the FcPatternAdd<type> functions. Must match the type of
988 The argument list is terminated by a null object name, no
989 object type nor value need be passed for this. The values are
990 added to `pattern', if `pattern' is null, a new pattern is
991 created. In either case, the pattern is returned. Example
992 pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *)
995 FcPatternVaBuild is used when the arguments are already in the
996 form of a varargs value. FcPatternVapBuild is a macro version
997 of FcPatternVaBuild which returns its result directly in the
1004 FcPatternDel -- Delete a property from a pattern
1008 #include <fontconfig/fontconfig.h>
1010 FcBool FcPatternDel(FcPattern *p, const char *object);
1014 Deletes all values associated with the property `object',
1015 returning whether the property existed or not.
1021 FcPatternRemove -- Remove one object of the specified type from
1026 #include <fontconfig/fontconfig.h>
1028 FcBool FcPatternRemove(FcPattern *p, const char *object, int
1033 Removes the value associated with the property `object' at
1034 position `id', returning whether the property existed and had a
1035 value at that position or not.
1041 FcPatternPrint -- Print a pattern for debugging
1045 #include <fontconfig/fontconfig.h>
1047 void FcPatternPrint(const FcPattern *p);
1051 Prints an easily readable version of the pattern to stdout.
1052 There is no provision for reparsing data in this format, it's
1053 just for diagnostics and debugging.
1059 FcDefaultSubstitute -- Perform default substitutions in a
1064 #include <fontconfig/fontconfig.h>
1066 void FcDefaultSubstitute(FcPattern *pattern);
1070 Supplies default values for underspecified font patterns:
1072 * Patterns without a specified style or weight are set to
1074 * Patterns without a specified style or slant are set to
1076 * Patterns without a specified pixel size are given one
1077 computed from any specified point size (default 12), dpi
1078 (default 75) and scale (default 1).
1084 FcNameParse -- Parse a pattern string
1088 #include <fontconfig/fontconfig.h>
1090 FcPattern * FcNameParse(const FcChar8 *name);
1094 Converts name from the standard text format described above
1101 FcNameUnparse -- Convert a pattern back into a string that can
1106 #include <fontconfig/fontconfig.h>
1108 FcChar8 * FcNameUnparse(FcPattern *pat);
1112 Converts the given pattern into the standard text format
1113 described above. The return value is not static, but instead
1114 refers to newly allocated memory which should be freed by the
1115 caller using free().
1121 FcPatternFormat -- Format a pattern into a string according to
1126 #include <fontconfig/fontconfig.h>
1128 FcChar8 * FcPatternFormat(FcPattern *pat, const FcChar8
1133 Converts given pattern pat into text described by the format
1134 specifier format. The return value refers to newly allocated
1135 memory which should be freed by the caller using free(), or
1136 NULL if format is invalid.
1138 The format is loosely modeled after printf-style format string.
1139 The format string is composed of zero or more directives:
1140 ordinary characters (not "%"), which are copied unchanged to
1141 the output stream; and tags which are interpreted to construct
1142 text from the pattern in a variety of ways (explained below).
1143 Special characters can be escaped using backslash. C-string
1144 style special characters like \n and \r are also supported
1145 (this is useful when the format string is not a C string
1146 literal). It is advisable to always escape curly braces that
1147 are meant to be copied to the output as ordinary characters.
1149 Each tag is introduced by the character "%", followed by an
1150 optional minimum field width, followed by tag contents in curly
1151 braces ({}). If the minimum field width value is provided the
1152 tag will be expanded and the result padded to achieve the
1153 minimum width. If the minimum field width is positive, the
1154 padding will right-align the text. Negative field width will
1155 left-align. The rest of this section describes various
1156 supported tag contents and their expansion.
1158 A simple tag is one where the content is an identifier. When
1159 simple tags are expanded, the named identifier will be looked
1160 up in pattern and the resulting list of values returned, joined
1161 together using comma. For example, to print the family name and
1162 style of the pattern, use the format "%{family} %{style}\n". To
1163 extend the family column to forty characters use
1164 "%-40{family}%{style}\n".
1166 Simple tags expand to list of all values for an element. To
1167 only choose one of the values, one can index using the syntax
1168 "%{elt[idx]}". For example, to get the first family name only,
1171 If a simple tag ends with "=" and the element is found in the
1172 pattern, the name of the element followed by "=" will be output
1173 before the list of values. For example, "%{weight=}" may expand
1174 to the string "weight=80". Or to the empty string if pattern
1175 does not have weight set.
1177 If a simple tag starts with ":" and the element is found in the
1178 pattern, ":" will be printed first. For example, combining this
1179 with the =, the format "%{:weight=}" may expand to ":weight=80"
1180 or to the empty string if pattern does not have weight set.
1182 If a simple tag contains the string ":-", the rest of the the
1183 tag contents will be used as a default string. The default
1184 string is output if the element is not found in the pattern.
1185 For example, the format "%{:weight=:-123}" may expand to
1186 ":weight=80" or to the string ":weight=123" if pattern does not
1189 A count tag is one that starts with the character "#" followed
1190 by an element name, and expands to the number of values for the
1191 element in the pattern. For example, "%{#family}" expands to
1192 the number of family names pattern has set, which may be zero.
1194 A sub-expression tag is one that expands a sub-expression. The
1195 tag contents are the sub-expression to expand placed inside
1196 another set of curly braces. Sub-expression tags are useful for
1197 aligning an entire sub-expression, or to apply converters
1198 (explained later) to the entire sub-expression output. For
1199 example, the format "%40{{%{family} %{style}}}" expands the
1200 sub-expression to construct the family name followed by the
1201 style, then takes the entire string and pads it on the left to
1202 be at least forty characters.
1204 A filter-out tag is one starting with the character "-"
1205 followed by a comma-separated list of element names, followed
1206 by a sub-expression enclosed in curly braces. The
1207 sub-expression will be expanded but with a pattern that has the
1208 listed elements removed from it. For example, the format
1209 "%{-size,pixelsize{sub-expr}}" will expand "sub-expr" with
1210 pattern sans the size and pixelsize elements.
1212 A filter-in tag is one starting with the character "+" followed
1213 by a comma-separated list of element names, followed by a
1214 sub-expression enclosed in curly braces. The sub-expression
1215 will be expanded but with a pattern that only has the listed
1216 elements from the surrounding pattern. For example, the format
1217 "%{+family,familylang{sub-expr}}" will expand "sub-expr" with a
1218 sub-pattern consisting only the family and family lang elements
1221 A conditional tag is one starting with the character "?"
1222 followed by a comma-separated list of element conditions,
1223 followed by two sub-expression enclosed in curly braces. An
1224 element condition can be an element name, in which case it
1225 tests whether the element is defined in pattern, or the
1226 character "!" followed by an element name, in which case the
1227 test is negated. The conditional passes if all the element
1228 conditions pass. The tag expands the first sub-expression if
1229 the conditional passes, and expands the second sub-expression
1230 otherwise. For example, the format
1231 "%{?size,dpi,!pixelsize{pass}{fail}}" will expand to "pass" if
1232 pattern has size and dpi elements but no pixelsize element, and
1233 to "fail" otherwise.
1235 An enumerate tag is one starting with the string "[]" followed
1236 by a comma-separated list of element names, followed by a
1237 sub-expression enclosed in curly braces. The list of values for
1238 the named elements are walked in parallel and the
1239 sub-expression expanded each time with a pattern just having a
1240 single value for those elements, starting from the first value
1241 and continuing as long as any of those elements has a value.
1242 For example, the format "%{[]family,familylang{%{family}
1243 (%{familylang})\n}}" will expand the pattern "%{family}
1244 (%{familylang})\n" with a pattern having only the first value
1245 of the family and familylang elements, then expands it with the
1246 second values, then the third, etc.
1248 As a special case, if an enumerate tag has only one element,
1249 and that element has only one value in the pattern, and that
1250 value is of type FcLangSet, the individual languages in the
1251 language set are enumerated.
1253 A builtin tag is one starting with the character "=" followed
1254 by a builtin name. The following builtins are defined:
1257 Expands to the result of calling FcNameUnparse() on the
1261 Expands to the output of the default output format of
1262 the fc-match command on the pattern, without the final
1266 Expands to the output of the default output format of
1267 the fc-list command on the pattern, without the final
1271 Expands to the output of the default output format of
1272 the fc-cat command on the pattern, without the final
1276 Expands to the list of PackageKit font() tags for the
1277 pattern. Currently this includes tags for each family
1278 name, and each language from the pattern, enumerated and
1279 sanitized into a set of tags terminated by newline.
1280 Package management systems can use these tags to tag
1281 their packages accordingly.
1283 For example, the format "%{+family,style{%{=unparse}}}\n" will
1284 expand to an unparsed name containing only the family and style
1285 element values from pattern.
1287 The contents of any tag can be followed by a set of zero or
1288 more converters. A converter is specified by the character "|"
1289 followed by the converter name and arguments. The following
1290 converters are defined:
1293 Replaces text with the results of calling
1294 FcStrBasename() on it.
1297 Replaces text with the results of calling FcStrDirname()
1301 Replaces text with the results of calling
1302 FcStrDowncase() on it.
1305 Escapes text for one level of shell expansion. (Escapes
1306 single-quotes, also encloses text in single-quotes.)
1309 Escapes text such that it can be used as part of a C
1310 string literal. (Escapes backslash and double-quotes.)
1313 Escapes text such that it can be used in XML and HTML.
1314 (Escapes less-than, greater-than, and ampersand.)
1317 Deletes all occurrences of each of the characters in
1318 chars from the text. FIXME: This converter is not UTF-8
1322 Escapes all occurrences of each of the characters in
1323 chars by prepending it by the first character in chars.
1324 FIXME: This converter is not UTF-8 aware yet.
1327 Translates all occurrences of each of the characters in
1328 from by replacing them with their corresponding
1329 character in to. If to has fewer characters than from,
1330 it will be extended by repeating its last character.
1331 FIXME: This converter is not UTF-8 aware yet.
1333 For example, the format "%{family|downcase|delete( )}\n" will
1334 expand to the values of the family element in pattern,
1335 lower-cased and with spaces removed.
1340 __________________________________________________________
1345 FcFontSetCreate -- Create a font set
1346 FcFontSetDestroy -- Destroy a font set
1347 FcFontSetAdd -- Add to a font set
1348 FcFontSetList -- List fonts from a set of font sets
1349 FcFontSetMatch -- Return the best font from a set of font sets
1350 FcFontSetPrint -- Print a set of patterns to stdout
1351 FcFontSetSort -- Add to a font set
1352 FcFontSetSortDestroy -- DEPRECATED destroy a font set
1354 An FcFontSet simply holds a list of patterns; these are used to
1355 return the results of listing available fonts.
1361 FcFontSetCreate -- Create a font set
1365 #include <fontconfig/fontconfig.h>
1367 FcFontSet * FcFontSetCreate(void);
1371 Creates an empty font set.
1377 FcFontSetDestroy -- Destroy a font set
1381 #include <fontconfig/fontconfig.h>
1383 void FcFontSetDestroy(FcFontSet *s);
1387 Destroys a font set. Note that this destroys any referenced
1394 FcFontSetAdd -- Add to a font set
1398 #include <fontconfig/fontconfig.h>
1400 FcBool FcFontSetAdd(FcFontSet *s, FcPattern *font);
1404 Adds a pattern to a font set. Note that the pattern is not
1405 copied before being inserted into the set. Returns FcFalse if
1406 the pattern cannot be inserted into the set (due to allocation
1407 failure). Otherwise returns FcTrue.
1413 FcFontSetList -- List fonts from a set of font sets
1417 #include <fontconfig/fontconfig.h>
1419 FcFontSet * FcFontSetList(FcConfig *config, FcFontSet **sets,
1420 intnsets, FcPattern *pattern, FcObjectSet *object_set);
1424 Selects fonts matching pattern from sets, creates patterns from
1425 those fonts containing only the objects in object_set and
1426 returns the set of unique such patterns. If config is NULL, the
1427 default configuration is checked to be up to date, and used.
1433 FcFontSetMatch -- Return the best font from a set of font sets
1437 #include <fontconfig/fontconfig.h>
1439 FcPattern * FcFontSetMatch(FcConfig *config, FcFontSet **sets,
1440 intnsets, FcPattern *pattern, FcResult *result);
1444 Finds the font in sets most closely matching pattern and
1445 returns the result of FcFontRenderPrepare for that font and the
1446 provided pattern. This function should be called only after
1447 FcConfigSubstitute and FcDefaultSubstitute have been called for
1448 pattern; otherwise the results will not be correct. If config
1449 is NULL, the current configuration is used. Returns NULL if an
1450 error occurs during this process.
1456 FcFontSetPrint -- Print a set of patterns to stdout
1460 #include <fontconfig/fontconfig.h>
1462 void FcFontSetPrint(FcFontSet *set);
1466 This function is useful for diagnosing font related issues,
1467 printing the complete contents of every pattern in set. The
1468 format of the output is designed to be of help to users and
1469 developers, and may change at any time.
1475 FcFontSetSort -- Add to a font set
1479 #include <fontconfig/fontconfig.h>
1481 FcFontSetSort(FcConfig *config, FcFontSet **sets, intnsets,
1482 FcPattern *pattern, FcBool trim, FcCharSet **csp, FcResult
1487 Returns the list of fonts from sets sorted by closeness to
1488 pattern. If trim is FcTrue, elements in the list which don't
1489 include Unicode coverage not provided by earlier elements in
1490 the list are elided. The union of Unicode coverage of all of
1491 the fonts is returned in csp, if csp is not NULL. This function
1492 should be called only after FcConfigSubstitute and
1493 FcDefaultSubstitute have been called for p; otherwise the
1494 results will not be correct.
1496 The returned FcFontSet references FcPattern structures which
1497 may be shared by the return value from multiple FcFontSort
1498 calls, applications cannot modify these patterns. Instead, they
1499 should be passed, along with pattern to FcFontRenderPrepare
1500 which combines them into a complete pattern.
1502 The FcFontSet returned by FcFontSetSort is destroyed by calling
1505 FcFontSetSortDestroy
1509 FcFontSetSortDestroy -- DEPRECATED destroy a font set
1513 #include <fontconfig/fontconfig.h>
1515 FcFontSetSortDestroy(FcFontSet *set);
1519 This function is DEPRECATED. FcFontSetSortDestroy destroys set
1520 by calling FcFontSetDestroy. Applications should use
1521 FcFontSetDestroy directly instead.
1522 __________________________________________________________
1527 FcObjectSetCreate -- Create an object set
1528 FcObjectSetAdd -- Add to an object set
1529 FcObjectSetDestroy -- Destroy an object set
1530 FcObjectSetBuild -- Build object set from args
1532 An FcObjectSet holds a list of pattern property names; it is
1533 used to indicate which properties are to be returned in the
1534 patterns from FcFontList.
1540 FcObjectSetCreate -- Create an object set
1544 #include <fontconfig/fontconfig.h>
1546 FcObjectSet * FcObjectSetCreate(void);
1550 Creates an empty set.
1556 FcObjectSetAdd -- Add to an object set
1560 #include <fontconfig/fontconfig.h>
1562 FcBool FcObjectSetAdd(FcObjectSet *os, const char *object);
1566 Adds a property name to the set. Returns FcFalse if the
1567 property name cannot be inserted into the set (due to
1568 allocation failure). Otherwise returns FcTrue.
1574 FcObjectSetDestroy -- Destroy an object set
1578 #include <fontconfig/fontconfig.h>
1580 void FcObjectSetDestroy(FcObjectSet *os);
1584 Destroys an object set.
1590 FcObjectSetBuild, FcObjectSetVaBuild,
1591 FcObjectSetVapBuild -- Build object set from args
1595 #include <fontconfig/fontconfig.h>
1597 FcObjectSet * FcObjectSetBuild(const char *first, ...);
1599 FcObjectSet * FcObjectSetVaBuild(const char *first, va_list
1602 void FcObjectSetVapBuild(FcObjectSet *result, const char
1603 *first, va_list va);
1607 These build an object set from a null-terminated list of
1608 property names. FcObjectSetVapBuild is a macro version of
1609 FcObjectSetVaBuild which returns the result in the result
1611 __________________________________________________________
1613 FreeType specific functions
1616 FcFreeTypeCharIndex -- map Unicode to glyph id
1617 FcFreeTypeCharSet -- compute Unicode coverage
1618 FcFreeTypeCharSetAndSpacing -- compute Unicode coverage and
1621 FcFreeTypeQuery -- compute pattern from font file (and index)
1622 FcFreeTypeQueryAll -- compute all patterns from font file (and
1625 FcFreeTypeQueryFace -- compute pattern from FT_Face
1627 While the fontconfig library doesn't insist that FreeType be
1628 used as the rasterization mechanism for fonts, it does provide
1629 some convenience functions.
1635 FcFreeTypeCharIndex -- map Unicode to glyph id
1639 #include <fontconfig.h>
1640 #include <fcfreetype.h>
1642 FT_UInt FcFreeTypeCharIndex(FT_Face face, FcChar32 ucs4);
1646 Maps a Unicode char to a glyph index. This function uses
1647 information from several possible underlying encoding tables to
1648 work around broken fonts. As a result, this function isn't
1649 designed to be used in performance sensitive areas; results
1650 from this function are intended to be cached by higher level
1657 FcFreeTypeCharSet -- compute Unicode coverage
1661 #include <fontconfig.h>
1662 #include <fcfreetype.h>
1664 FcCharSet * FcFreeTypeCharSet(FT_Face face, FcBlanks *blanks);
1668 Scans a FreeType face and returns the set of encoded Unicode
1669 chars. FcBlanks is deprecated, blanks is ignored and accepted
1670 only for compatibility with older code.
1672 FcFreeTypeCharSetAndSpacing
1676 FcFreeTypeCharSetAndSpacing -- compute Unicode coverage and
1681 #include <fontconfig.h>
1682 #include <fcfreetype.h>
1684 FcCharSet * FcFreeTypeCharSetAndSpacing(FT_Face face, FcBlanks
1685 *blanks, int *spacing);
1689 Scans a FreeType face and returns the set of encoded Unicode
1690 chars. FcBlanks is deprecated, blanks is ignored and accepted
1691 only for compatibility with older code. spacing receives the
1692 computed spacing type of the font, one of FC_MONO for a font
1693 where all glyphs have the same width, FC_DUAL, where the font
1694 has glyphs in precisely two widths, one twice as wide as the
1695 other, or FC_PROPORTIONAL where the font has glyphs of many
1702 FcFreeTypeQuery -- compute pattern from font file (and index)
1706 #include <fontconfig.h>
1707 #include <fcfreetype.h>
1709 FcPattern * FcFreeTypeQuery(const FcChar8 *file, int id,
1710 FcBlanks *blanks, int *count);
1714 Constructs a pattern representing the 'id'th face in 'file'.
1715 The number of faces in 'file' is returned in 'count'. FcBlanks
1716 is deprecated, blanks is ignored and accepted only for
1717 compatibility with older code.
1723 FcFreeTypeQueryAll -- compute all patterns from font file (and
1728 #include <fontconfig.h>
1729 #include <fcfreetype.h>
1731 unsigned int FcFreeTypeQueryAll(const FcChar8 *file, int id,
1732 FcBlanks *blanks, int *count, FcFontSet *set);
1736 Constructs patterns found in 'file'. If id is -1, then all
1737 patterns found in 'file' are added to 'set'. Otherwise, this
1738 function works exactly like FcFreeTypeQuery(). The number of
1739 faces in 'file' is returned in 'count'. The number of patterns
1740 added to 'set' is returned. FcBlanks is deprecated, blanks is
1741 ignored and accepted only for compatibility with older code.
1751 FcFreeTypeQueryFace -- compute pattern from FT_Face
1755 #include <fontconfig.h>
1756 #include <fcfreetype.h>
1758 FcPattern * FcFreeTypeQueryFace(const FT_Face face, const
1759 FcChar8 *file, int id, FcBlanks *blanks);
1763 Constructs a pattern representing 'face'. 'file' and 'id' are
1764 used solely as data for pattern elements (FC_FILE, FC_INDEX and
1765 sometimes FC_FAMILY). FcBlanks is deprecated, blanks is ignored
1766 and accepted only for compatibility with older code.
1767 __________________________________________________________
1772 FcValueDestroy -- Free a value
1773 FcValueSave -- Copy a value
1774 FcValuePrint -- Print a value to stdout
1775 FcValueEqual -- Test two values for equality
1777 FcValue is a structure containing a type tag and a union of all
1778 possible datatypes. The tag is an enum of type FcType and is
1779 intended to provide a measure of run-time typechecking,
1780 although that depends on careful programming.
1786 FcValueDestroy -- Free a value
1790 #include <fontconfig/fontconfig.h>
1792 void FcValueDestroy(FcValue v);
1796 Frees any memory referenced by v. Values of type FcTypeString,
1797 FcTypeMatrix and FcTypeCharSet reference memory, the other
1804 FcValueSave -- Copy a value
1808 #include <fontconfig/fontconfig.h>
1810 FcValue FcValueSave(FcValue v);
1814 Returns a copy of v duplicating any object referenced by it so
1815 that v may be safely destroyed without harming the new value.
1821 FcValuePrint -- Print a value to stdout
1825 #include <fontconfig/fontconfig.h>
1827 void FcValuePrint(FcValue v);
1831 Prints a human-readable representation of v to stdout. The
1832 format should not be considered part of the library
1833 specification as it may change in the future.
1839 FcValueEqual -- Test two values for equality
1843 #include <fontconfig/fontconfig.h>
1845 FcBool FcValueEqual(FcValue v_a, FcValue v_b);
1849 Compares two values. Integers and Doubles are compared as
1850 numbers; otherwise the two values have to be the same type to
1851 be considered equal. Strings are compared ignoring case.
1852 __________________________________________________________
1857 FcCharSetCreate -- Create an empty character set
1858 FcCharSetDestroy -- Destroy a character set
1859 FcCharSetAddChar -- Add a character to a charset
1860 FcCharSetDelChar -- Add a character to a charset
1861 FcCharSetCopy -- Copy a charset
1862 FcCharSetEqual -- Compare two charsets
1863 FcCharSetIntersect -- Intersect charsets
1864 FcCharSetUnion -- Add charsets
1865 FcCharSetSubtract -- Subtract charsets
1866 FcCharSetMerge -- Merge charsets
1867 FcCharSetHasChar -- Check a charset for a char
1868 FcCharSetCount -- Count entries in a charset
1869 FcCharSetIntersectCount -- Intersect and count charsets
1870 FcCharSetSubtractCount -- Subtract and count charsets
1871 FcCharSetIsSubset -- Test for charset inclusion
1872 FcCharSetFirstPage -- Start enumerating charset contents
1873 FcCharSetNextPage -- Continue enumerating charset contents
1874 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode
1877 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate
1879 An FcCharSet is a boolean array indicating a set of Unicode
1880 chars. Those associated with a font are marked constant and
1881 cannot be edited. FcCharSets may be reference counted
1882 internally to reduce memory consumption; this may be visible to
1883 applications as the result of FcCharSetCopy may return it's
1884 argument, and that CharSet may remain unmodifiable.
1890 FcCharSetCreate -- Create an empty character set
1894 #include <fontconfig/fontconfig.h>
1896 FcCharSet * FcCharSetCreate(void);
1900 FcCharSetCreate allocates and initializes a new empty character
1907 FcCharSetDestroy -- Destroy a character set
1911 #include <fontconfig/fontconfig.h>
1913 void FcCharSetDestroy(FcCharSet *fcs);
1917 FcCharSetDestroy decrements the reference count fcs. If the
1918 reference count becomes zero, all memory referenced is freed.
1924 FcCharSetAddChar -- Add a character to a charset
1928 #include <fontconfig/fontconfig.h>
1930 FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4);
1934 FcCharSetAddChar adds a single Unicode char to the set,
1935 returning FcFalse on failure, either as a result of a constant
1936 set or from running out of memory.
1942 FcCharSetDelChar -- Add a character to a charset
1946 #include <fontconfig/fontconfig.h>
1948 FcBool FcCharSetDelChar(FcCharSet *fcs, FcChar32 ucs4);
1952 FcCharSetDelChar deletes a single Unicode char from the set,
1953 returning FcFalse on failure, either as a result of a constant
1954 set or from running out of memory.
1964 FcCharSetCopy -- Copy a charset
1968 #include <fontconfig/fontconfig.h>
1970 FcCharSet * FcCharSetCopy(FcCharSet *src);
1974 Makes a copy of src; note that this may not actually do
1975 anything more than increment the reference count on src.
1981 FcCharSetEqual -- Compare two charsets
1985 #include <fontconfig/fontconfig.h>
1987 FcBool FcCharSetEqual(const FcCharSet *a, const FcCharSet *b);
1991 Returns whether a and b contain the same set of Unicode chars.
1997 FcCharSetIntersect -- Intersect charsets
2001 #include <fontconfig/fontconfig.h>
2003 FcCharSet * FcCharSetIntersect(const FcCharSet *a, const
2008 Returns a set including only those chars found in both a and b.
2014 FcCharSetUnion -- Add charsets
2018 #include <fontconfig/fontconfig.h>
2020 FcCharSet * FcCharSetUnion(const FcCharSet *a, const FcCharSet
2025 Returns a set including only those chars found in either a or
2032 FcCharSetSubtract -- Subtract charsets
2036 #include <fontconfig/fontconfig.h>
2038 FcCharSet * FcCharSetSubtract(const FcCharSet *a, const
2043 Returns a set including only those chars found in a but not b.
2049 FcCharSetMerge -- Merge charsets
2053 #include <fontconfig/fontconfig.h>
2055 FcBool FcCharSetMerge(FcCharSet *a, const FcCharSet *b, FcBool
2060 Adds all chars in b to a. In other words, this is an in-place
2061 version of FcCharSetUnion. If changed is not NULL, then it
2062 returns whether any new chars from b were added to a. Returns
2063 FcFalse on failure, either when a is a constant set or from
2064 running out of memory.
2070 FcCharSetHasChar -- Check a charset for a char
2074 #include <fontconfig/fontconfig.h>
2076 FcBool FcCharSetHasChar(const FcCharSet *fcs, FcChar32 ucs4);
2080 Returns whether fcs contains the char ucs4.
2086 FcCharSetCount -- Count entries in a charset
2090 #include <fontconfig/fontconfig.h>
2092 FcChar32 FcCharSetCount(const FcCharSet *a);
2096 Returns the total number of Unicode chars in a.
2098 FcCharSetIntersectCount
2102 FcCharSetIntersectCount -- Intersect and count charsets
2106 #include <fontconfig/fontconfig.h>
2108 FcChar32 FcCharSetIntersectCount(const FcCharSet *a, const
2113 Returns the number of chars that are in both a and b.
2115 FcCharSetSubtractCount
2119 FcCharSetSubtractCount -- Subtract and count charsets
2123 #include <fontconfig/fontconfig.h>
2125 FcChar32 FcCharSetSubtractCount(const FcCharSet *a, const
2130 Returns the number of chars that are in a but not in b.
2136 FcCharSetIsSubset -- Test for charset inclusion
2140 #include <fontconfig/fontconfig.h>
2142 FcBool FcCharSetIsSubset(const FcCharSet *a, const FcCharSet
2147 Returns whether a is a subset of b.
2153 FcCharSetFirstPage -- Start enumerating charset contents
2157 #include <fontconfig/fontconfig.h>
2159 FcChar32 FcCharSetFirstPage(const FcCharSet *a,
2160 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next);
2164 Builds an array of bits in map marking the first page of
2165 Unicode coverage of a. *next is set to contains the base code
2166 point for the next page in a. Returns the base code point for
2167 the page, or FC_CHARSET_DONE if a contains no pages. As an
2168 example, if FcCharSetFirstPage returns 0x300 and fills map with
2169 0xffffffff 0xffffffff 0x01000008 0x44300002 0xffffd7f0 0xfffffffb 0xffff
2172 Then the page contains code points 0x300 through 0x33f (the
2173 first 64 code points on the page) because map[0] and map[1]
2174 both have all their bits set. It also contains code points
2175 0x343 (0x300 + 32*2 + (4-1)) and 0x35e (0x300 + 32*2 + (31-1))
2176 because map[2] has the 4th and 31st bits set. The code points
2177 represented by map[3] and later are left as an excercise for
2184 FcCharSetNextPage -- Continue enumerating charset contents
2188 #include <fontconfig/fontconfig.h>
2190 FcChar32 FcCharSetNextPage(const FcCharSet *a,
2191 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next);
2195 Builds an array of bits in map marking the Unicode coverage of
2196 a for page containing *next (see the FcCharSetFirstPage
2197 description for details). *next is set to contains the base
2198 code point for the next page in a. Returns the base of code
2199 point for the page, or FC_CHARSET_DONE if a does not contain
2206 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode
2211 #include <fontconfig/fontconfig.h>
2213 FcChar32 FcCharSetCoverage(const FcCharSet *a, FcChar32page,
2218 DEPRECATED This function returns a bitmask in result which
2219 indicates which code points in page are included in a.
2220 FcCharSetCoverage returns the next page in the charset which
2227 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate
2231 #include <fontconfig/fontconfig.h>
2233 FcCharSet * FcCharSetNew(void);
2237 FcCharSetNew is a DEPRECATED alias for FcCharSetCreate.
2238 __________________________________________________________
2243 FcLangSetCreate -- create a langset object
2244 FcLangSetDestroy -- destroy a langset object
2245 FcLangSetCopy -- copy a langset object
2246 FcLangSetAdd -- add a language to a langset
2247 FcLangSetDel -- delete a language from a langset
2248 FcLangSetUnion -- Add langsets
2249 FcLangSetSubtract -- Subtract langsets
2250 FcLangSetCompare -- compare language sets
2251 FcLangSetContains -- check langset subset relation
2252 FcLangSetEqual -- test for matching langsets
2253 FcLangSetHash -- return a hash value for a langset
2254 FcLangSetHasLang -- test langset for language support
2255 FcGetDefaultLangs -- Get the default languages list
2256 FcLangSetGetLangs -- get the list of languages in the langset
2257 FcGetLangs -- Get list of languages
2258 FcLangNormalize -- Normalize the language string
2259 FcLangGetCharSet -- Get character map for a language
2261 An FcLangSet is a set of language names (each of which include
2262 language and an optional territory). They are used when
2263 selecting fonts to indicate which languages the fonts need to
2264 support. Each font is marked, using language orthography
2265 information built into fontconfig, with the set of supported
2272 FcLangSetCreate -- create a langset object
2276 #include <fontconfig/fontconfig.h>
2278 FcLangSet * FcLangSetCreate(void);
2282 FcLangSetCreate creates a new FcLangSet object.
2288 FcLangSetDestroy -- destroy a langset object
2292 #include <fontconfig/fontconfig.h>
2294 void FcLangSetDestroy(FcLangSet *ls);
2298 FcLangSetDestroy destroys a FcLangSet object, freeing all
2299 memory associated with it.
2305 FcLangSetCopy -- copy a langset object
2309 #include <fontconfig/fontconfig.h>
2311 FcLangSet * FcLangSetCopy(const FcLangSet *ls);
2315 FcLangSetCopy creates a new FcLangSet object and populates it
2316 with the contents of ls.
2322 FcLangSetAdd -- add a language to a langset
2326 #include <fontconfig/fontconfig.h>
2328 FcBool FcLangSetAdd(FcLangSet *ls, const FcChar8 *lang);
2332 lang is added to ls. lang should be of the form Ll-Tt where Ll
2333 is a two or three letter language from ISO 639 and Tt is a
2334 territory from ISO 3166.
2340 FcLangSetDel -- delete a language from a langset
2344 #include <fontconfig/fontconfig.h>
2346 FcBool FcLangSetDel(FcLangSet *ls, const FcChar8 *lang);
2350 lang is removed from ls. lang should be of the form Ll-Tt where
2351 Ll is a two or three letter language from ISO 639 and Tt is a
2352 territory from ISO 3166.
2362 FcLangSetUnion -- Add langsets
2366 #include <fontconfig/fontconfig.h>
2368 FcLangSet * FcLangSetUnion(const FcLangSet *ls_a, const
2373 Returns a set including only those languages found in either
2384 FcLangSetSubtract -- Subtract langsets
2388 #include <fontconfig/fontconfig.h>
2390 FcLangSet * FcLangSetSubtract(const FcLangSet *ls_a, const
2395 Returns a set including only those languages found in ls_a but
2406 FcLangSetCompare -- compare language sets
2410 #include <fontconfig/fontconfig.h>
2412 FcLangResult FcLangSetCompare(const FcLangSet *ls_a, const
2417 FcLangSetCompare compares language coverage for ls_a and ls_b.
2418 If they share any language and territory pair, this function
2419 returns FcLangEqual. If they share a language but differ in
2420 which territory that language is for, this function returns
2421 FcLangDifferentTerritory. If they share no languages in common,
2422 this function returns FcLangDifferentLang.
2428 FcLangSetContains -- check langset subset relation
2432 #include <fontconfig/fontconfig.h>
2434 FcBool FcLangSetContains(const FcLangSet *ls_a, const FcLangSet
2439 FcLangSetContains returns FcTrue if ls_a contains every
2440 language in ls_b. ls_a will 'contain' a language from ls_b if
2441 ls_a has exactly the language, or either the language or ls_a
2448 FcLangSetEqual -- test for matching langsets
2452 #include <fontconfig/fontconfig.h>
2454 FcBool FcLangSetEqual(const FcLangSet *ls_a, const FcLangSet
2459 Returns FcTrue if and only if ls_a supports precisely the same
2460 language and territory combinations as ls_b.
2466 FcLangSetHash -- return a hash value for a langset
2470 #include <fontconfig/fontconfig.h>
2472 FcChar32 FcLangSetHash(const FcLangSet *ls);
2476 This function returns a value which depends solely on the
2477 languages supported by ls. Any language which equals ls will
2478 have the same result from FcLangSetHash. However, two langsets
2479 with the same hash value may not be equal.
2485 FcLangSetHasLang -- test langset for language support
2489 #include <fontconfig/fontconfig.h>
2491 FcLangResult FcLangSetHasLang(const FcLangSet *ls, const
2496 FcLangSetHasLang checks whether ls supports lang. If ls has a
2497 matching language and territory pair, this function returns
2498 FcLangEqual. If ls has a matching language but differs in which
2499 territory that language is for, this function returns
2500 FcLangDifferentTerritory. If ls has no matching language, this
2501 function returns FcLangDifferentLang.
2507 FcGetDefaultLangs -- Get the default languages list
2511 #include <fontconfig/fontconfig.h>
2513 FcStrSet * FcGetDefaultLangs(void);
2517 Returns a string set of the default languages according to the
2518 environment variables on the system. This function looks for
2519 them in order of FC_LANG, LC_ALL, LC_CTYPE and LANG then. If
2520 there are no valid values in those environment variables, "en"
2521 will be set as fallback.
2531 FcLangSetGetLangs -- get the list of languages in the langset
2535 #include <fontconfig/fontconfig.h>
2537 FcStrSet * FcLangSetGetLangs(const FcLangSet *ls);
2541 Returns a string set of all languages in langset.
2547 FcGetLangs -- Get list of languages
2551 #include <fontconfig/fontconfig.h>
2553 FcStrSet * FcGetLangs(void);
2557 Returns a string set of all known languages.
2563 FcLangNormalize -- Normalize the language string
2567 #include <fontconfig/fontconfig.h>
2569 FcChar8 * FcLangNormalize(const FcChar8 *lang);
2573 Returns a string to make lang suitable on fontconfig.
2583 FcLangGetCharSet -- Get character map for a language
2587 #include <fontconfig/fontconfig.h>
2589 const FcCharSet * FcLangGetCharSet(const FcChar8 *lang);
2593 Returns the FcCharMap for a language.
2594 __________________________________________________________
2599 FcMatrixInit -- initialize an FcMatrix structure
2600 FcMatrixCopy -- Copy a matrix
2601 FcMatrixEqual -- Compare two matrices
2602 FcMatrixMultiply -- Multiply matrices
2603 FcMatrixRotate -- Rotate a matrix
2604 FcMatrixScale -- Scale a matrix
2605 FcMatrixShear -- Shear a matrix
2607 FcMatrix structures hold an affine transformation in matrix
2614 FcMatrixInit -- initialize an FcMatrix structure
2618 #include <fontconfig/fontconfig.h>
2620 void FcMatrixInit(FcMatrix *matrix);
2624 FcMatrixInit initializes matrix to the identity matrix.
2630 FcMatrixCopy -- Copy a matrix
2634 #include <fontconfig/fontconfig.h>
2636 void FcMatrixCopy(const FcMatrix *matrix);
2640 FcMatrixCopy allocates a new FcMatrix and copies mat into it.
2646 FcMatrixEqual -- Compare two matrices
2650 #include <fontconfig/fontconfig.h>
2652 void FcMatrixEqual(const FcMatrix *matrix1, const FcMatrix
2657 FcMatrixEqual compares matrix1 and matrix2 returning FcTrue
2658 when they are equal and FcFalse when they are not.
2664 FcMatrixMultiply -- Multiply matrices
2668 #include <fontconfig/fontconfig.h>
2670 void FcMatrixMultiply(FcMatrix *result, const FcMatrix
2671 *matrix1, const FcMatrix *matrix2);
2675 FcMatrixMultiply multiplies matrix1 and matrix2 storing the
2682 FcMatrixRotate -- Rotate a matrix
2686 #include <fontconfig/fontconfig.h>
2688 void FcMatrixRotate(FcMatrix *matrix, double cos, double sin);
2692 FcMatrixRotate rotates matrix by the angle who's sine is sin
2693 and cosine is cos. This is done by multiplying by the matrix:
2701 FcMatrixScale -- Scale a matrix
2705 #include <fontconfig/fontconfig.h>
2707 void FcMatrixScale(FcMatrix *matrix, double sx, double dy);
2711 FcMatrixScale multiplies matrix x values by sx and y values by
2712 dy. This is done by multiplying by the matrix:
2720 FcMatrixShear -- Shear a matrix
2724 #include <fontconfig/fontconfig.h>
2726 void FcMatrixShear(FcMatrix *matrix, double sh, double sv);
2730 FcMatrixShare shears matrix horizontally by sh and vertically
2731 by sv. This is done by multiplying by the matrix:
2734 __________________________________________________________
2739 FcRangeCopy -- Copy a range object
2740 FcRangeCreateDouble -- create a range object for double
2741 FcRangeCreateInteger -- create a range object for integer
2742 FcRangeDestroy -- destroy a range object
2743 FcRangeGetDouble -- Get the range in double
2745 An FcRange holds two variables to indicate a range in between.
2751 FcRangeCopy -- Copy a range object
2755 #include <fontconfig/fontconfig.h>
2757 FcRange * FcRangeCopy(const FcRange *range);
2761 FcRangeCopy creates a new FcRange object and populates it with
2762 the contents of range.
2772 FcRangeCreateDouble -- create a range object for double
2776 #include <fontconfig/fontconfig.h>
2778 FcRange * FcRangeCreateDouble(doublebegin, doubleend);
2782 FcRangeCreateDouble creates a new FcRange object with double
2789 FcRangeCreateInteger
2793 FcRangeCreateInteger -- create a range object for integer
2797 #include <fontconfig/fontconfig.h>
2799 FcRange * FcRangeCreateInteger(intbegin, intend);
2803 FcRangeCreateInteger creates a new FcRange object with integer
2814 FcRangeDestroy -- destroy a range object
2818 #include <fontconfig/fontconfig.h>
2820 void FcRangeDestroy(FcRange *range);
2824 FcRangeDestroy destroys a FcRange object, freeing all memory
2835 FcRangeGetDouble -- Get the range in double
2839 #include <fontconfig/fontconfig.h>
2841 FcBool FcRangeGetDouble(const FcRange *range, double *begin,
2846 Returns in begin and end as the range.
2851 __________________________________________________________
2856 FcConfigCreate -- Create a configuration
2857 FcConfigReference -- Increment config reference count
2858 FcConfigDestroy -- Destroy a configuration
2859 FcConfigSetCurrent -- Set configuration as default
2860 FcConfigGetCurrent -- Return current configuration
2861 FcConfigUptoDate -- Check timestamps on config files
2862 FcConfigHome -- return the current home directory.
2863 FcConfigEnableHome -- controls use of the home directory.
2864 FcConfigBuildFonts -- Build font database
2865 FcConfigGetConfigDirs -- Get config directories
2866 FcConfigGetFontDirs -- Get font directories
2867 FcConfigGetConfigFiles -- Get config files
2868 FcConfigGetCache -- DEPRECATED used to return per-user cache
2871 FcConfigGetCacheDirs -- return the list of directories searched
2874 FcConfigGetFonts -- Get config font set
2875 FcConfigGetBlanks -- Get config blanks
2876 FcConfigGetRescanInterval -- Get config rescan interval
2877 FcConfigSetRescanInterval -- Set config rescan interval
2878 FcConfigAppFontAddFile -- Add font file to font database
2879 FcConfigAppFontAddDir -- Add fonts from directory to font
2882 FcConfigAppFontClear -- Remove all app fonts from font database
2883 FcConfigSubstituteWithPat -- Execute substitutions
2884 FcConfigSubstitute -- Execute substitutions
2885 FcFontMatch -- Return best font
2886 FcFontSort -- Return list of matching fonts
2887 FcFontRenderPrepare -- Prepare pattern for loading font file
2888 FcFontList -- List fonts
2889 FcConfigFilename -- Find a config file
2890 FcConfigParseAndLoad -- load a configuration file
2891 FcConfigParseAndLoadFromMemory -- load a configuration from
2894 FcConfigGetSysRoot -- Obtain the system root directory
2895 FcConfigSetSysRoot -- Set the system root directory
2896 FcConfigFileInfoIterInit -- Initialize the iterator
2897 FcConfigFileInfoIterNext -- Set the iterator to point to the
2900 FcConfigFileInfoIterGet -- Obtain the configuration file
2903 An FcConfig object holds the internal representation of a
2904 configuration. There is a default configuration which
2905 applications may use by passing 0 to any function using the
2906 data within an FcConfig.
2912 FcConfigCreate -- Create a configuration
2916 #include <fontconfig/fontconfig.h>
2918 FcConfig * FcConfigCreate(void);
2922 Creates an empty configuration.
2928 FcConfigReference -- Increment config reference count
2932 #include <fontconfig/fontconfig.h>
2934 FcConfig * FcConfigReference(FcConfig *config);
2938 Add another reference to config. Configs are freed only when
2939 the reference count reaches zero. If config is NULL, the
2940 current configuration is used. In that case this function will
2941 be similar to FcConfigGetCurrent() except that it increments
2942 the reference count before returning and the user is
2943 responsible for destroying the configuration when not needed
2950 FcConfigDestroy -- Destroy a configuration
2954 #include <fontconfig/fontconfig.h>
2956 void FcConfigDestroy(FcConfig *config);
2960 Decrements the config reference count. If all references are
2961 gone, destroys the configuration and any data associated with
2962 it. Note that calling this function with the return from
2963 FcConfigGetCurrent will cause a new configuration to be created
2964 for use as current configuration.
2970 FcConfigSetCurrent -- Set configuration as default
2974 #include <fontconfig/fontconfig.h>
2976 FcBool FcConfigSetCurrent(FcConfig *config);
2980 Sets the current default configuration to config. Implicitly
2981 calls FcConfigBuildFonts if necessary, and FcConfigReference()
2982 to inrease the reference count in config since 2.12.0,
2983 returning FcFalse if that call fails.
2989 FcConfigGetCurrent -- Return current configuration
2993 #include <fontconfig/fontconfig.h>
2995 FcConfig * FcConfigGetCurrent(void);
2999 Returns the current default configuration.
3005 FcConfigUptoDate -- Check timestamps on config files
3009 #include <fontconfig/fontconfig.h>
3011 FcBool FcConfigUptoDate(FcConfig *config);
3015 Checks all of the files related to config and returns whether
3016 any of them has been modified since the configuration was
3017 created. If config is NULL, the current configuration is used.
3023 FcConfigHome -- return the current home directory.
3027 #include <fontconfig/fontconfig.h>
3029 FcChar8 * FcConfigHome(void);
3033 Return the current user's home directory, if it is available,
3034 and if using it is enabled, and NULL otherwise. See also
3035 FcConfigEnableHome).
3041 FcConfigEnableHome -- controls use of the home directory.
3045 #include <fontconfig/fontconfig.h>
3047 FcBool FcConfigEnableHome(FcBool enable);
3051 If enable is FcTrue, then Fontconfig will use various files
3052 which are specified relative to the user's home directory
3053 (using the ~ notation in the configuration). When enable is
3054 FcFalse, then all use of the home directory in these contexts
3055 will be disabled. The previous setting of the value is
3062 FcConfigBuildFonts -- Build font database
3066 #include <fontconfig/fontconfig.h>
3068 FcBool FcConfigBuildFonts(FcConfig *config);
3072 Builds the set of available fonts for the given configuration.
3073 Note that any changes to the configuration after this call have
3074 indeterminate effects. Returns FcFalse if this operation runs
3075 out of memory. If config is NULL, the current configuration is
3078 FcConfigGetConfigDirs
3082 FcConfigGetConfigDirs -- Get config directories
3086 #include <fontconfig/fontconfig.h>
3088 FcStrList * FcConfigGetConfigDirs(FcConfig *config);
3092 Returns the list of font directories specified in the
3093 configuration files for config. Does not include any
3094 subdirectories. If config is NULL, the current configuration is
3101 FcConfigGetFontDirs -- Get font directories
3105 #include <fontconfig/fontconfig.h>
3107 FcStrList * FcConfigGetFontDirs(FcConfig *config);
3111 Returns the list of font directories in config. This includes
3112 the configured font directories along with any directories
3113 below those in the filesystem. If config is NULL, the current
3114 configuration is used.
3116 FcConfigGetConfigFiles
3120 FcConfigGetConfigFiles -- Get config files
3124 #include <fontconfig/fontconfig.h>
3126 FcStrList * FcConfigGetConfigFiles(FcConfig *config);
3130 Returns the list of known configuration files used to generate
3131 config. If config is NULL, the current configuration is used.
3137 FcConfigGetCache -- DEPRECATED used to return per-user cache
3142 #include <fontconfig/fontconfig.h>
3144 FcChar8 * FcConfigGetCache(FcConfig *config);
3148 With fontconfig no longer using per-user cache files, this
3149 function now simply returns NULL to indicate that no per-user
3152 FcConfigGetCacheDirs
3156 FcConfigGetCacheDirs -- return the list of directories searched
3161 #include <fontconfig/fontconfig.h>
3163 FcStrList * FcConfigGetCacheDirs(const FcConfig *config);
3167 FcConfigGetCacheDirs returns a string list containing all of
3168 the directories that fontconfig will search when attempting to
3169 load a cache file for a font directory. If config is NULL, the
3170 current configuration is used.
3176 FcConfigGetFonts -- Get config font set
3180 #include <fontconfig/fontconfig.h>
3182 FcFontSet * FcConfigGetFonts(FcConfig *config, FcSetName set);
3186 Returns one of the two sets of fonts from the configuration as
3187 specified by set. This font set is owned by the library and
3188 must not be modified or freed. If config is NULL, the current
3189 configuration is used.
3195 FcConfigGetBlanks -- Get config blanks
3199 #include <fontconfig/fontconfig.h>
3201 FcBlanks * FcConfigGetBlanks(FcConfig *config);
3205 FcBlanks is deprecated. This function always returns NULL.
3207 FcConfigGetRescanInterval
3211 FcConfigGetRescanInterval -- Get config rescan interval
3215 #include <fontconfig/fontconfig.h>
3217 int FcConfigGetRescanInterval(FcConfig *config);
3221 Returns the interval between automatic checks of the
3222 configuration (in seconds) specified in config. The
3223 configuration is checked during a call to FcFontList when this
3224 interval has passed since the last check. An interval setting
3225 of zero disables automatic checks. If config is NULL, the
3226 current configuration is used.
3228 FcConfigSetRescanInterval
3232 FcConfigSetRescanInterval -- Set config rescan interval
3236 #include <fontconfig/fontconfig.h>
3238 FcBool FcConfigSetRescanInterval(FcConfig *config, int
3243 Sets the rescan interval. Returns FcFalse if the interval
3244 cannot be set (due to allocation failure). Otherwise returns
3245 FcTrue. An interval setting of zero disables automatic checks.
3246 If config is NULL, the current configuration is used.
3248 FcConfigAppFontAddFile
3252 FcConfigAppFontAddFile -- Add font file to font database
3256 #include <fontconfig/fontconfig.h>
3258 FcBool FcConfigAppFontAddFile(FcConfig *config, const FcChar8
3263 Adds an application-specific font to the configuration. Returns
3264 FcFalse if the fonts cannot be added (due to allocation failure
3265 or no fonts found). Otherwise returns FcTrue. If config is
3266 NULL, the current configuration is used.
3268 FcConfigAppFontAddDir
3272 FcConfigAppFontAddDir -- Add fonts from directory to font
3277 #include <fontconfig/fontconfig.h>
3279 FcBool FcConfigAppFontAddDir(FcConfig *config, const FcChar8
3284 Scans the specified directory for fonts, adding each one found
3285 to the application-specific set of fonts. Returns FcFalse if
3286 the fonts cannot be added (due to allocation failure).
3287 Otherwise returns FcTrue. If config is NULL, the current
3288 configuration is used.
3290 FcConfigAppFontClear
3294 FcConfigAppFontClear -- Remove all app fonts from font database
3298 #include <fontconfig/fontconfig.h>
3300 void FcConfigAppFontClear(FcConfig *config);
3304 Clears the set of application-specific fonts. If config is
3305 NULL, the current configuration is used.
3307 FcConfigSubstituteWithPat
3311 FcConfigSubstituteWithPat -- Execute substitutions
3315 #include <fontconfig/fontconfig.h>
3317 FcBool FcConfigSubstituteWithPat(FcConfig *config, FcPattern
3318 *p, FcPattern *p_pat, FcMatchKind kind);
3322 Performs the sequence of pattern modification operations, if
3323 kind is FcMatchPattern, then those tagged as pattern operations
3324 are applied, else if kind is FcMatchFont, those tagged as font
3325 operations are applied and p_pat is used for <test> elements
3326 with target=pattern. Returns FcFalse if the substitution cannot
3327 be performed (due to allocation failure). Otherwise returns
3328 FcTrue. If config is NULL, the current configuration is used.
3334 FcConfigSubstitute -- Execute substitutions
3338 #include <fontconfig/fontconfig.h>
3340 FcBool FcConfigSubstitute(FcConfig *config, FcPattern *p,
3345 Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns
3346 FcFalse if the substitution cannot be performed (due to
3347 allocation failure). Otherwise returns FcTrue. If config is
3348 NULL, the current configuration is used.
3354 FcFontMatch -- Return best font
3358 #include <fontconfig/fontconfig.h>
3360 FcPattern * FcFontMatch(FcConfig *config, FcPattern *p,
3365 Finds the font in sets most closely matching pattern and
3366 returns the result of FcFontRenderPrepare for that font and the
3367 provided pattern. This function should be called only after
3368 FcConfigSubstitute and FcDefaultSubstitute have been called for
3369 p; otherwise the results will not be correct. If config is
3370 NULL, the current configuration is used.
3376 FcFontSort -- Return list of matching fonts
3380 #include <fontconfig/fontconfig.h>
3382 FcFontSet * FcFontSort(FcConfig *config, FcPattern *p, FcBool
3383 trim, FcCharSet **csp, FcResult *result);
3387 Returns the list of fonts sorted by closeness to p. If trim is
3388 FcTrue, elements in the list which don't include Unicode
3389 coverage not provided by earlier elements in the list are
3390 elided. The union of Unicode coverage of all of the fonts is
3391 returned in csp, if csp is not NULL. This function should be
3392 called only after FcConfigSubstitute and FcDefaultSubstitute
3393 have been called for p; otherwise the results will not be
3396 The returned FcFontSet references FcPattern structures which
3397 may be shared by the return value from multiple FcFontSort
3398 calls, applications must not modify these patterns. Instead,
3399 they should be passed, along with p to FcFontRenderPrepare
3400 which combines them into a complete pattern.
3402 The FcFontSet returned by FcFontSort is destroyed by calling
3403 FcFontSetDestroy. If config is NULL, the current configuration
3410 FcFontRenderPrepare -- Prepare pattern for loading font file
3414 #include <fontconfig/fontconfig.h>
3416 FcPattern * FcFontRenderPrepare(FcConfig *config, FcPattern
3417 *pat, FcPattern *font);
3421 Creates a new pattern consisting of elements of font not
3422 appearing in pat, elements of pat not appearing in font and the
3423 best matching value from pat for elements appearing in both.
3424 The result is passed to FcConfigSubstituteWithPat with kind
3425 FcMatchFont and then returned.
3431 FcFontList -- List fonts
3435 #include <fontconfig/fontconfig.h>
3437 FcFontSet * FcFontList(FcConfig *config, FcPattern *p,
3442 Selects fonts matching p, creates patterns from those fonts
3443 containing only the objects in os and returns the set of unique
3444 such patterns. If config is NULL, the default configuration is
3445 checked to be up to date, and used.
3451 FcConfigFilename -- Find a config file
3455 #include <fontconfig/fontconfig.h>
3457 FcChar8 * FcConfigFilename(const FcChar8 *name);
3461 Given the specified external entity name, return the associated
3462 filename. This provides applications a way to convert various
3463 configuration file references into filename form.
3465 A null or empty name indicates that the default configuration
3466 file should be used; which file this references can be
3467 overridden with the FONTCONFIG_FILE environment variable. Next,
3468 if the name starts with ~, it refers to a file in the current
3469 users home directory. Otherwise if the name doesn't start with
3470 '/', it refers to a file in the default configuration
3471 directory; the built-in default directory can be overridden
3472 with the FONTCONFIG_PATH environment variable.
3474 FcConfigParseAndLoad
3478 FcConfigParseAndLoad -- load a configuration file
3482 #include <fontconfig/fontconfig.h>
3484 FcBool FcConfigParseAndLoad(FcConfig *config, const FcChar8
3485 *file, FcBool complain);
3489 Walks the configuration in 'file' and constructs the internal
3490 representation in 'config'. Any include files referenced from
3491 within 'file' will be loaded and parsed. If 'complain' is
3492 FcFalse, no warning will be displayed if 'file' does not exist.
3493 Error and warning messages will be output to stderr. Returns
3494 FcFalse if some error occurred while loading the file, either a
3495 parse error, semantic error or allocation failure. Otherwise
3498 FcConfigParseAndLoadFromMemory
3502 FcConfigParseAndLoadFromMemory -- load a configuration from
3507 #include <fontconfig/fontconfig.h>
3509 FcBool FcConfigParseAndLoadFromMemory(FcConfig *config, const
3510 FcChar8 *buffer, FcBool complain);
3514 Walks the configuration in 'memory' and constructs the internal
3515 representation in 'config'. Any includes files referenced from
3516 within 'memory' will be loaded and dparsed. If 'complain' is
3517 FcFalse, no warning will be displayed if 'file' does not exist.
3518 Error and warning messages will be output to stderr. Returns
3519 FcFalse if fsome error occurred while loading the file, either
3520 a parse error, semantic error or allocation failure. Otherwise
3531 FcConfigGetSysRoot -- Obtain the system root directory
3535 #include <fontconfig/fontconfig.h>
3537 const FcChar8 * FcConfigGetSysRoot(const FcConfig *config);
3541 Obtrains the system root directory in 'config' if available.
3551 FcConfigSetSysRoot -- Set the system root directory
3555 #include <fontconfig/fontconfig.h>
3557 void FcConfigSetSysRoot(FcConfig *config, const FcChar8
3562 Set 'sysroot' as the system root directory. fontconfig prepend
3563 'sysroot' to the cache directories in order to allow people to
3564 generate caches at the build time. Note that this causes
3565 changing current config. i.e. this function calls
3566 FcConfigSetCurrent() internally.
3572 FcConfigFileInfoIterInit
3576 FcConfigFileInfoIterInit -- Initialize the iterator
3580 #include <fontconfig/fontconfig.h>
3582 void FcConfigFileInfoIterInit(FcConfig *config,
3583 FcConfigFileInfoIter *iter);
3587 Initialize 'iter' with the first iterator in the config file
3594 FcConfigFileInfoIterNext
3598 FcConfigFileInfoIterNext -- Set the iterator to point to the
3603 #include <fontconfig/fontconfig.h>
3605 FcBool FcConfigFileInfoIterNext(FcConfig *config,
3606 FcConfigFileInfoIter *iter);
3610 Set 'iter' to point to the next node in the config file
3611 information list. If there is no next node, FcFalse is
3618 FcConfigFileInfoIterGet
3622 FcConfigFileInfoIterGet -- Obtain the configuration file
3627 #include <fontconfig/fontconfig.h>
3629 FcBool FcConfigFileInfoIterGet(FcConfig *config,
3630 FcConfigFileInfoIter *iter, FcChar8 **name, FcChar8
3631 **description, FcBool *enabled);
3635 Obtain the filename, the description and the flag whether it is
3636 enabled or not for 'iter' where points to current configuration
3637 file information. If the iterator is invalid, FcFalse is
3643 __________________________________________________________
3648 FcNameRegisterObjectTypes -- Register object types
3649 FcNameUnregisterObjectTypes -- Unregister object types
3650 FcNameGetObjectType -- Lookup an object type
3652 Provides for application-specified font name object types so
3653 that new pattern elements can be generated from font names.
3655 FcNameRegisterObjectTypes
3659 FcNameRegisterObjectTypes -- Register object types
3663 #include <fontconfig/fontconfig.h>
3665 FcBool FcNameRegisterObjectTypes(const FcObjectType *types, int
3670 Deprecated. Does nothing. Returns FcFalse.
3672 FcNameUnregisterObjectTypes
3676 FcNameUnregisterObjectTypes -- Unregister object types
3680 #include <fontconfig/fontconfig.h>
3682 FcBool FcNameUnregisterObjectTypes(const FcObjectType *types,
3687 Deprecated. Does nothing. Returns FcFalse.
3693 FcNameGetObjectType -- Lookup an object type
3697 #include <fontconfig/fontconfig.h>
3699 const FcObjectType * FcNameGetObjectType(const char *object);
3703 Return the object type for the pattern element named object.
3704 __________________________________________________________
3709 FcNameRegisterConstants -- Register symbolic constants
3710 FcNameUnregisterConstants -- Unregister symbolic constants
3711 FcNameGetConstant -- Lookup symbolic constant
3712 FcNameConstant -- Get the value for a symbolic constant
3714 Provides for application-specified symbolic constants for font
3717 FcNameRegisterConstants
3721 FcNameRegisterConstants -- Register symbolic constants
3725 #include <fontconfig/fontconfig.h>
3727 FcBool FcNameRegisterConstants(const FcConstant *consts, int
3732 Deprecated. Does nothing. Returns FcFalse.
3734 FcNameUnregisterConstants
3738 FcNameUnregisterConstants -- Unregister symbolic constants
3742 #include <fontconfig/fontconfig.h>
3744 FcBool FcNameUnregisterConstants(const FcConstant *consts, int
3749 Deprecated. Does nothing. Returns FcFalse.
3755 FcNameGetConstant -- Lookup symbolic constant
3759 #include <fontconfig/fontconfig.h>
3761 const FcConstant * FcNameGetConstant(FcChar8 *string);
3765 Return the FcConstant structure related to symbolic constant
3772 FcNameConstant -- Get the value for a symbolic constant
3776 #include <fontconfig/fontconfig.h>
3778 FcBool FcNameConstant(FcChar8 *string, int *result);
3782 Returns whether a symbolic constant with name string is
3783 registered, placing the value of the constant in result if
3785 __________________________________________________________
3790 FcWeightFromOpenTypeDouble -- Convert from OpenType weight
3791 values to fontconfig ones
3793 FcWeightToOpenTypeDouble -- Convert from fontconfig weight
3794 values to OpenType ones
3796 FcWeightFromOpenType -- Convert from OpenType weight values to
3799 FcWeightToOpenType -- Convert from fontconfig weight values to
3802 Maps weights to and from OpenType weights.
3804 FcWeightFromOpenTypeDouble
3808 FcWeightFromOpenTypeDouble -- Convert from OpenType weight
3809 values to fontconfig ones
3813 #include <fontconfig/fontconfig.h>
3815 double FcWeightFromOpenTypeDouble(doubleot_weight);
3819 FcWeightFromOpenTypeDouble returns an double value to use with
3820 FC_WEIGHT, from an double in the 1..1000 range, resembling the
3821 numbers from OpenType specification's OS/2 usWeight numbers,
3822 which are also similar to CSS font-weight numbers. If input is
3823 negative, zero, or greater than 1000, returns -1. This function
3824 linearly doubleerpolates between various FC_WEIGHT_* constants.
3825 As such, the returned value does not necessarily match any of
3826 the predefined constants.
3832 FcWeightToOpenTypeDouble
3836 FcWeightToOpenTypeDouble -- Convert from fontconfig weight
3837 values to OpenType ones
3841 #include <fontconfig/fontconfig.h>
3843 double FcWeightToOpenTypeDouble(doubleot_weight);
3847 FcWeightToOpenTypeDouble is the inverse of
3848 FcWeightFromOpenType. If the input is less than FC_WEIGHT_THIN
3849 or greater than FC_WEIGHT_EXTRABLACK, returns -1. Otherwise
3850 returns a number in the range 1 to 1000.
3856 FcWeightFromOpenType
3860 FcWeightFromOpenType -- Convert from OpenType weight values to
3865 #include <fontconfig/fontconfig.h>
3867 int FcWeightFromOpenType(intot_weight);
3871 FcWeightFromOpenType is like FcWeightFromOpenTypeDouble but
3872 with integer arguments. Use the other function instead.
3882 FcWeightToOpenType -- Convert from fontconfig weight values to
3887 #include <fontconfig/fontconfig.h>
3889 int FcWeightToOpenType(intot_weight);
3893 FcWeightToOpenType is like FcWeightToOpenTypeDouble but with
3894 integer arguments. Use the other function instead.
3899 __________________________________________________________
3904 FcBlanksCreate -- Create an FcBlanks
3905 FcBlanksDestroy -- Destroy and FcBlanks
3906 FcBlanksAdd -- Add a character to an FcBlanks
3907 FcBlanksIsMember -- Query membership in an FcBlanks
3909 An FcBlanks object holds a list of Unicode chars which are
3910 expected to be blank when drawn. When scanning new fonts, any
3911 glyphs which are empty and not in this list will be assumed to
3912 be broken and not placed in the FcCharSet associated with the
3913 font. This provides a significantly more accurate CharSet for
3916 FcBlanks is deprecated and should not be used in newly written
3917 code. It is still accepted by some functions for compatibility
3918 with older code but will be removed in the future.
3924 FcBlanksCreate -- Create an FcBlanks
3928 #include <fontconfig/fontconfig.h>
3930 FcBlanks * FcBlanksCreate(void);
3934 FcBlanks is deprecated. This function always returns NULL.
3940 FcBlanksDestroy -- Destroy and FcBlanks
3944 #include <fontconfig/fontconfig.h>
3946 void FcBlanksDestroy(FcBlanks *b);
3950 FcBlanks is deprecated. This function does nothing.
3956 FcBlanksAdd -- Add a character to an FcBlanks
3960 #include <fontconfig/fontconfig.h>
3962 FcBool FcBlanksAdd(FcBlanks *b, FcChar32 ucs4);
3966 FcBlanks is deprecated. This function always returns FALSE.
3972 FcBlanksIsMember -- Query membership in an FcBlanks
3976 #include <fontconfig/fontconfig.h>
3978 FcBool FcBlanksIsMember(FcBlanks *b, FcChar32 ucs4);
3982 FcBlanks is deprecated. This function always returns FALSE.
3983 __________________________________________________________
3988 FcAtomicCreate -- create an FcAtomic object
3989 FcAtomicLock -- lock a file
3990 FcAtomicNewFile -- return new temporary file name
3991 FcAtomicOrigFile -- return original file name
3992 FcAtomicReplaceOrig -- replace original with new
3993 FcAtomicDeleteNew -- delete new file
3994 FcAtomicUnlock -- unlock a file
3995 FcAtomicDestroy -- destroy an FcAtomic object
3997 These functions provide a safe way to update configuration
3998 files, allowing ongoing reading of the old configuration file
3999 while locked for writing and ensuring that a consistent and
4000 complete version of the configuration file is always available.
4006 FcAtomicCreate -- create an FcAtomic object
4010 #include <fontconfig/fontconfig.h>
4012 FcAtomic * FcAtomicCreate(const FcChar8 *file);
4016 Creates a data structure containing data needed to control
4017 access to file. Writing is done to a separate file. Once that
4018 file is complete, the original configuration file is atomically
4019 replaced so that reading process always see a consistent and
4020 complete file without the need to lock for reading.
4026 FcAtomicLock -- lock a file
4030 #include <fontconfig/fontconfig.h>
4032 FcBool FcAtomicLock(FcAtomic *atomic);
4036 Attempts to lock the file referenced by atomic. Returns FcFalse
4037 if the file is already locked, else returns FcTrue and leaves
4044 FcAtomicNewFile -- return new temporary file name
4048 #include <fontconfig/fontconfig.h>
4050 FcChar8 * FcAtomicNewFile(FcAtomic *atomic);
4054 Returns the filename for writing a new version of the file
4055 referenced by atomic.
4061 FcAtomicOrigFile -- return original file name
4065 #include <fontconfig/fontconfig.h>
4067 FcChar8 * FcAtomicOrigFile(FcAtomic *atomic);
4071 Returns the file referenced by atomic.
4077 FcAtomicReplaceOrig -- replace original with new
4081 #include <fontconfig/fontconfig.h>
4083 FcBool FcAtomicReplaceOrig(FcAtomic *atomic);
4087 Replaces the original file referenced by atomic with the new
4088 file. Returns FcFalse if the file cannot be replaced due to
4089 permission issues in the filesystem. Otherwise returns FcTrue.
4095 FcAtomicDeleteNew -- delete new file
4099 #include <fontconfig/fontconfig.h>
4101 void FcAtomicDeleteNew(FcAtomic *atomic);
4105 Deletes the new file. Used in error recovery to back out
4112 FcAtomicUnlock -- unlock a file
4116 #include <fontconfig/fontconfig.h>
4118 void FcAtomicUnlock(FcAtomic *atomic);
4128 FcAtomicDestroy -- destroy an FcAtomic object
4132 #include <fontconfig/fontconfig.h>
4134 void FcAtomicDestroy(FcAtomic *atomic);
4139 __________________________________________________________
4141 File and Directory routines
4144 FcFileScan -- scan a font file
4145 FcFileIsDir -- check whether a file is a directory
4146 FcDirScan -- scan a font directory without caching it
4147 FcDirSave -- DEPRECATED: formerly used to save a directory
4150 FcDirCacheUnlink -- Remove all caches related to dir
4151 FcDirCacheValid -- check directory cache
4152 FcDirCacheLoad -- load a directory cache
4153 FcDirCacheRescan -- Re-scan a directory cache
4154 FcDirCacheRead -- read or construct a directory cache
4155 FcDirCacheLoadFile -- load a cache file
4156 FcDirCacheUnload -- unload a cache file
4158 These routines work with font files and directories, including
4159 font directory cache files.
4165 FcFileScan -- scan a font file
4169 #include <fontconfig/fontconfig.h>
4171 FcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
4172 *cache, FcBlanks *blanks, const FcChar8 *file, FcBool force);
4176 Scans a single file and adds all fonts found to set. If force
4177 is FcTrue, then the file is scanned even if associated
4178 information is found in cache. If file is a directory, it is
4179 added to dirs. Whether fonts are found depends on fontconfig
4180 policy as well as the current configuration. Internally,
4181 fontconfig will ignore BDF and PCF fonts which are not in
4182 Unicode (or the effectively equivalent ISO Latin-1) encoding as
4183 those are not usable by Unicode-based applications. The
4184 configuration can ignore fonts based on filename or contents of
4185 the font file itself. Returns FcFalse if any of the fonts
4186 cannot be added (due to allocation failure). Otherwise returns
4193 FcFileIsDir -- check whether a file is a directory
4197 #include <fontconfig/fontconfig.h>
4199 FcBool FcFileIsDir(const FcChar8 *file);
4203 Returns FcTrue if file is a directory, otherwise returns
4210 FcDirScan -- scan a font directory without caching it
4214 #include <fontconfig/fontconfig.h>
4216 FcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
4217 *cache, FcBlanks *blanks, const FcChar8 *dir, FcBool force);
4221 If cache is not zero or if force is FcFalse, this function
4222 currently returns FcFalse. Otherwise, it scans an entire
4223 directory and adds all fonts found to set. Any subdirectories
4224 found are added to dirs. Calling this function does not create
4225 any cache files. Use FcDirCacheRead() if caching is desired.
4231 FcDirSave -- DEPRECATED: formerly used to save a directory
4236 #include <fontconfig/fontconfig.h>
4238 FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8
4243 This function now does nothing aside from returning FcFalse. It
4244 used to creates the per-directory cache file for dir and
4245 populates it with the fonts in set and subdirectories in dirs.
4246 All of this functionality is now automatically managed by
4247 FcDirCacheLoad and FcDirCacheRead.
4253 FcDirCacheUnlink -- Remove all caches related to dir
4257 #include <fontconfig/fontconfig.h>
4259 FcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config);
4263 Scans the cache directories in config, removing any instances
4264 of the cache file for dir. Returns FcFalse when some internal
4265 error occurs (out of memory, etc). Errors actually unlinking
4266 any files are ignored.
4272 FcDirCacheValid -- check directory cache
4276 #include <fontconfig/fontconfig.h>
4278 FcBool FcDirCacheValid(const FcChar8 *dir);
4282 Returns FcTrue if dir has an associated valid cache file, else
4289 FcDirCacheLoad -- load a directory cache
4293 #include <fontconfig/fontconfig.h>
4295 FcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config,
4296 FcChar8 **cache_file);
4300 Loads the cache related to dir. If no cache file exists,
4301 returns NULL. The name of the cache file is returned in
4302 cache_file, unless that is NULL. See also FcDirCacheRead.
4308 FcDirCacheRescan -- Re-scan a directory cache
4312 #include <fontconfig/fontconfig.h>
4314 FcCache * FcDirCacheRescan(const FcChar8 *dir, FcConfig
4319 Re-scan directories only at dir and update the cache. returns
4330 FcDirCacheRead -- read or construct a directory cache
4334 #include <fontconfig/fontconfig.h>
4336 FcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force,
4341 This returns a cache for dir. If force is FcFalse, then an
4342 existing, valid cache file will be used. Otherwise, a new cache
4343 will be created by scanning the directory and that returned.
4349 FcDirCacheLoadFile -- load a cache file
4353 #include <fontconfig/fontconfig.h>
4355 FcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct
4360 This function loads a directory cache from cache_file. If
4361 file_stat is non-NULL, it will be filled with the results of
4362 stat(2) on the cache file.
4368 FcDirCacheUnload -- unload a cache file
4372 #include <fontconfig/fontconfig.h>
4374 void FcDirCacheUnload(FcCache *cache);
4378 This function dereferences cache. When no other references to
4379 it remain, all memory associated with the cache will be freed.
4380 __________________________________________________________
4385 FcCacheDir -- Return directory of cache
4386 FcCacheCopySet -- Returns a copy of the fontset from cache
4387 FcCacheSubdir -- Return the i'th subdirectory.
4388 FcCacheNumSubdir -- Return the number of subdirectories in
4391 FcCacheNumFont -- Returns the number of fonts in cache.
4392 FcDirCacheClean -- Clean up a cache directory
4393 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory.
4394 FcDirCacheCreateUUID -- Create .uuid file at a directory
4396 These routines work with font directory caches, accessing their
4397 contents in limited ways. It is not expected that normal
4398 applications will need to use these functions.
4404 FcCacheDir -- Return directory of cache
4408 #include <fontconfig/fontconfig.h>
4410 const FcChar8 * FcCacheDir(const FcCache *cache);
4414 This function returns the directory from which the cache was
4421 FcCacheCopySet -- Returns a copy of the fontset from cache
4425 #include <fontconfig/fontconfig.h>
4427 FcFontSet * FcCacheCopySet(const FcCache *cache);
4431 The returned fontset contains each of the font patterns from
4432 cache. This fontset may be modified, but the patterns from the
4433 cache are read-only.
4439 FcCacheSubdir -- Return the i'th subdirectory.
4443 #include <fontconfig/fontconfig.h>
4445 const FcChar8 * FcCacheSubdir(const FcCache *cache, inti);
4449 The set of subdirectories stored in a cache file are indexed by
4450 this function, i should range from 0 to n-1, where n is the
4451 return value from FcCacheNumSubdir.
4457 FcCacheNumSubdir -- Return the number of subdirectories in
4462 #include <fontconfig/fontconfig.h>
4464 int FcCacheNumSubdir(const FcCache *cache);
4468 This returns the total number of subdirectories in the cache.
4474 FcCacheNumFont -- Returns the number of fonts in cache.
4478 #include <fontconfig/fontconfig.h>
4480 int FcCacheNumFont(const FcCache *cache);
4484 This returns the number of fonts which would be included in the
4485 return from FcCacheCopySet.
4491 FcDirCacheClean -- Clean up a cache directory
4495 #include <fontconfig/fontconfig.h>
4497 FcBool FcDirCacheClean(const FcChar8 *cache_dir,
4502 This tries to clean up the cache directory of cache_dir. This
4503 returns FcTrue if the operation is successfully complete.
4510 FcCacheCreateTagFile
4514 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory.
4518 #include <fontconfig/fontconfig.h>
4520 void FcCacheCreateTagFile(const FcConfig *config);
4524 This tries to create CACHEDIR.TAG file at the cache directory
4525 registered to config.
4531 FcDirCacheCreateUUID
4535 FcDirCacheCreateUUID -- Create .uuid file at a directory
4539 #include <fontconfig/fontconfig.h>
4541 FcBool FcDirCacheCreateUUID(FcChar8 *dir, FcBoolforce,
4546 This is to create .uuid file containing an UUID at a font
4547 directory of dir. The UUID will be used to identify the font
4548 directory and is used to determine the cache filename if
4554 __________________________________________________________
4556 FcStrSet and FcStrList
4559 FcStrSetCreate -- create a string set
4560 FcStrSetMember -- check set for membership
4561 FcStrSetEqual -- check sets for equality
4562 FcStrSetAdd -- add to a string set
4563 FcStrSetAddFilename -- add a filename to a string set
4564 FcStrSetDel -- delete from a string set
4565 FcStrSetDestroy -- destroy a string set
4566 FcStrListCreate -- create a string iterator
4567 FcStrListFirst -- get first string in iteration
4568 FcStrListNext -- get next string in iteration
4569 FcStrListDone -- destroy a string iterator
4571 A data structure for enumerating strings, used to list
4572 directories while scanning the configuration as directories are
4573 added while scanning.
4579 FcStrSetCreate -- create a string set
4583 #include <fontconfig/fontconfig.h>
4585 FcStrSet * FcStrSetCreate(void);
4589 Create an empty set.
4595 FcStrSetMember -- check set for membership
4599 #include <fontconfig/fontconfig.h>
4601 FcBool FcStrSetMember(FcStrSet *set, const FcChar8 *s);
4605 Returns whether s is a member of set.
4611 FcStrSetEqual -- check sets for equality
4615 #include <fontconfig/fontconfig.h>
4617 FcBool FcStrSetEqual(FcStrSet *set_a, FcStrSet *set_b);
4621 Returns whether set_a contains precisely the same strings as
4622 set_b. Ordering of strings within the two sets is not
4629 FcStrSetAdd -- add to a string set
4633 #include <fontconfig/fontconfig.h>
4635 FcBool FcStrSetAdd(FcStrSet *set, const FcChar8 *s);
4639 Adds a copy of s to set.
4645 FcStrSetAddFilename -- add a filename to a string set
4649 #include <fontconfig/fontconfig.h>
4651 FcBool FcStrSetAddFilename(FcStrSet *set, const FcChar8 *s);
4655 Adds a copy s to set, The copy is created with
4656 FcStrCopyFilename so that leading '~' values are replaced with
4657 the value of the HOME environment variable.
4663 FcStrSetDel -- delete from a string set
4667 #include <fontconfig/fontconfig.h>
4669 FcBool FcStrSetDel(FcStrSet *set, const FcChar8 *s);
4673 Removes s from set, returning FcTrue if s was a member else
4680 FcStrSetDestroy -- destroy a string set
4684 #include <fontconfig/fontconfig.h>
4686 void FcStrSetDestroy(FcStrSet *set);
4696 FcStrListCreate -- create a string iterator
4700 #include <fontconfig/fontconfig.h>
4702 FcStrList * FcStrListCreate(FcStrSet *set);
4706 Creates an iterator to list the strings in set.
4712 FcStrListFirst -- get first string in iteration
4716 #include <fontconfig/fontconfig.h>
4718 void FcStrListFirst(FcStrList *list);
4722 Returns the first string in list.
4732 FcStrListNext -- get next string in iteration
4736 #include <fontconfig/fontconfig.h>
4738 FcChar8 * FcStrListNext(FcStrList *list);
4742 Returns the next string in list.
4748 FcStrListDone -- destroy a string iterator
4752 #include <fontconfig/fontconfig.h>
4754 void FcStrListDone(FcStrList *list);
4758 Destroys the enumerator list.
4759 __________________________________________________________
4764 FcUtf8ToUcs4 -- convert UTF-8 to UCS4
4765 FcUcs4ToUtf8 -- convert UCS4 to UTF-8
4766 FcUtf8Len -- count UTF-8 encoded chars
4767 FcUtf16ToUcs4 -- convert UTF-16 to UCS4
4768 FcUtf16Len -- count UTF-16 encoded chars
4769 FcIsLower -- check for lower case ASCII character
4770 FcIsUpper -- check for upper case ASCII character
4771 FcToLower -- convert upper case ASCII to lower case
4772 FcStrCopy -- duplicate a string
4773 FcStrDowncase -- create a lower case translation of a string
4774 FcStrCopyFilename -- create a complete path from a filename
4775 FcStrCmp -- compare UTF-8 strings
4776 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case
4777 FcStrStr -- locate UTF-8 substring
4778 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII
4781 FcStrPlus -- concatenate two strings
4782 FcStrFree -- free a string
4783 FcStrDirname -- directory part of filename
4784 FcStrBasename -- last component of filename
4786 Fontconfig manipulates many UTF-8 strings represented with the
4787 FcChar8 type. These functions are exposed to help applications
4788 deal with these UTF-8 strings in a locale-insensitive manner.
4794 FcUtf8ToUcs4 -- convert UTF-8 to UCS4
4798 #include <fontconfig/fontconfig.h>
4800 int FcUtf8ToUcs4(FcChar8 *src, FcChar32 *dst, int len);
4804 Converts the next Unicode char from src into dst and returns
4805 the number of bytes containing the char. src must be at least
4812 FcUcs4ToUtf8 -- convert UCS4 to UTF-8
4816 #include <fontconfig/fontconfig.h>
4818 int FcUcs4ToUtf8(FcChar32 src, FcChar8 dst[FC_UTF8_MAX_LEN]);
4822 Converts the Unicode char from src into dst and returns the
4823 number of bytes needed to encode the char.
4829 FcUtf8Len -- count UTF-8 encoded chars
4833 #include <fontconfig/fontconfig.h>
4835 FcBool FcUtf8Len(FcChar8 *src, int len, int *nchar, int
4840 Counts the number of Unicode chars in len bytes of src. Places
4841 that count in nchar. wchar contains 1, 2 or 4 depending on the
4842 number of bytes needed to hold the largest Unicode char
4843 counted. The return value indicates whether src is a
4844 well-formed UTF8 string.
4850 FcUtf16ToUcs4 -- convert UTF-16 to UCS4
4854 #include <fontconfig/fontconfig.h>
4856 int FcUtf16ToUcs4(FcChar8 *src, FcEndian endian, FcChar32 *dst,
4861 Converts the next Unicode char from src into dst and returns
4862 the number of bytes containing the char. src must be at least
4863 len bytes long. Bytes of src are combined into 16-bit units
4864 according to endian.
4870 FcUtf16Len -- count UTF-16 encoded chars
4874 #include <fontconfig/fontconfig.h>
4876 FcBool FcUtf16Len(FcChar8 *src, FcEndian endian, int len, int
4877 *nchar, int *wchar);
4881 Counts the number of Unicode chars in len bytes of src. Bytes
4882 of src are combined into 16-bit units according to endian.
4883 Places that count in nchar. wchar contains 1, 2 or 4 depending
4884 on the number of bytes needed to hold the largest Unicode char
4885 counted. The return value indicates whether string is a
4886 well-formed UTF16 string.
4892 FcIsLower -- check for lower case ASCII character
4896 #include <fontconfig/fontconfig.h>
4898 FcBool FcIsLower(FcChar8c);
4902 This macro checks whether c is an lower case ASCII letter.
4908 FcIsUpper -- check for upper case ASCII character
4912 #include <fontconfig/fontconfig.h>
4914 FcBool FcIsUpper(FcChar8c);
4918 This macro checks whether c is a upper case ASCII letter.
4924 FcToLower -- convert upper case ASCII to lower case
4928 #include <fontconfig/fontconfig.h>
4930 FcChar8 FcToLower(FcChar8c);
4934 This macro converts upper case ASCII c to the equivalent lower
4941 FcStrCopy -- duplicate a string
4945 #include <fontconfig/fontconfig.h>
4947 FcChar8 * FcStrCopy(const FcChar8 *s);
4951 Allocates memory, copies s and returns the resulting buffer.
4952 Yes, this is strdup, but that function isn't available on every
4959 FcStrDowncase -- create a lower case translation of a string
4963 #include <fontconfig/fontconfig.h>
4965 FcChar8 * FcStrDowncase(const FcChar8 *s);
4969 Allocates memory, copies s, converting upper case letters to
4970 lower case and returns the allocated buffer.
4976 FcStrCopyFilename -- create a complete path from a filename
4980 #include <fontconfig/fontconfig.h>
4982 FcChar8 * FcStrCopyFilename(const FcChar8 *s);
4986 FcStrCopyFilename constructs an absolute pathname from s. It
4987 converts any leading '~' characters in to the value of the HOME
4988 environment variable, and any relative paths are converted to
4989 absolute paths using the current working directory. Sequences
4990 of '/' characters are converted to a single '/', and names
4991 containing the current directory '.' or parent directory '..'
4992 are correctly reconstructed. Returns NULL if '~' is the leading
4993 character and HOME is unset or disabled (see
4994 FcConfigEnableHome).
5000 FcStrCmp -- compare UTF-8 strings
5004 #include <fontconfig/fontconfig.h>
5006 int FcStrCmp(const FcChar8 *s1, const FcChar8 *s2);
5010 Returns the usual <0, 0, >0 result of comparing s1 and s2.
5016 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case
5020 #include <fontconfig/fontconfig.h>
5022 int FcStrCmpIgnoreCase(const FcChar8 *s1, const FcChar8 *s2);
5026 Returns the usual <0, 0, >0 result of comparing s1 and s2. This
5027 test is case-insensitive for all proper UTF-8 encoded strings.
5033 FcStrStr -- locate UTF-8 substring
5037 #include <fontconfig/fontconfig.h>
5039 FcChar8 * FcStrStr(const FcChar8 *s1, const FcChar8 *s2);
5043 Returns the location of s2 in s1. Returns NULL if s2 is not
5044 present in s1. This test will operate properly with UTF8
5051 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII
5056 #include <fontconfig/fontconfig.h>
5058 FcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8
5063 Returns the location of s2 in s1, ignoring case. Returns NULL
5064 if s2 is not present in s1. This test is case-insensitive for
5065 all proper UTF-8 encoded strings.
5071 FcStrPlus -- concatenate two strings
5075 #include <fontconfig/fontconfig.h>
5077 FcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2);
5081 This function allocates new storage and places the
5082 concatenation of s1 and s2 there, returning the new string.
5088 FcStrFree -- free a string
5092 #include <fontconfig/fontconfig.h>
5094 void FcStrFree(FcChar8 *s);
5098 This is just a wrapper around free(3) which helps track memory
5099 usage of strings within the fontconfig library.
5105 FcStrDirname -- directory part of filename
5109 #include <fontconfig/fontconfig.h>
5111 FcChar8 * FcStrDirname(const FcChar8 *file);
5115 Returns the directory containing file. This is returned in
5116 newly allocated storage which should be freed when no longer
5123 FcStrBasename -- last component of filename
5127 #include <fontconfig/fontconfig.h>
5129 FcChar8 * FcStrBasename(const FcChar8 *file);
5133 Returns the filename of file stripped of any leading directory
5134 names. This is returned in newly allocated storage which should
5135 be freed when no longer needed.