1 Fontconfig Developers Reference, Version 2.12.1
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.
380 __________________________________________________________
384 holds the per-user cache information for use while loading the
385 font database. This is built automatically for the current
386 configuration when that is loaded. Applications must always
387 pass '0' when one is requested.
388 __________________________________________________________
392 holds a complete configuration of the library; there is one
393 default configuration, other can be constructed from XML data
394 structures. All public entry points that need global data can
395 take an optional FcConfig* argument; passing 0 uses the default
396 configuration. FcConfig objects hold two sets of fonts, the
397 first contains those specified by the configuration, the second
398 set holds those added by the application at run-time.
399 Interfaces that need to reference a particular set use one of
400 the FcSetName enumerated values.
401 __________________________________________________________
405 Specifies one of the two sets of fonts available in a
406 configuration; FcSetSystem for those fonts specified in the
407 configuration and FcSetApplication which holds fonts provided
409 __________________________________________________________
413 Used as a return type for functions manipulating FcPattern
417 -----------------------------------------------------------
418 FcResultMatch Object exists with the specified ID
419 FcResultNoMatch Object doesn't exist at all
420 FcResultTypeMismatch Object exists, but the type doesn't matc
422 FcResultNoId Object exists, but has fewer values
424 FcResultOutOfMemory malloc failed
425 __________________________________________________________
429 Used for locking access to configuration files. Provides a safe
430 way to update configuration files.
431 __________________________________________________________
435 Holds information about the fonts contained in a single
436 directory. Normal applications need not worry about this as
437 caches for font access are automatically managed by the
438 library. Applications dealing with cache management may want to
439 use some of these objects in their work, however the included
440 'fc-cache' program generally suffices for all of that.
441 __________________________________________________________
445 These are grouped by functionality, often using the main data
446 type being manipulated.
447 __________________________________________________________
452 FcInitLoadConfig -- load configuration
453 FcInitLoadConfigAndFonts -- load configuration and font data
454 FcInit -- initialize fontconfig library
455 FcFini -- finalize fontconfig library
456 FcGetVersion -- library version number
457 FcInitReinitialize -- re-initialize library
458 FcInitBringUptoDate -- reload configuration files if needed
460 These functions provide some control over how the library is
467 FcInitLoadConfig -- load configuration
471 #include <fontconfig/fontconfig.h>
473 FcConfig * FcInitLoadConfig(void);
477 Loads the default configuration file and returns the resulting
478 configuration. Does not load any font information.
480 FcInitLoadConfigAndFonts
484 FcInitLoadConfigAndFonts -- load configuration and font data
488 #include <fontconfig/fontconfig.h>
490 FcConfig * FcInitLoadConfigAndFonts(void);
494 Loads the default configuration file and builds information
495 about the available fonts. Returns the resulting configuration.
501 FcInit -- initialize fontconfig library
505 #include <fontconfig/fontconfig.h>
511 Loads the default configuration file and the fonts referenced
512 therein and sets the default configuration to that result.
513 Returns whether this process succeeded or not. If the default
514 configuration has already been loaded, this routine does
515 nothing and returns FcTrue.
521 FcFini -- finalize fontconfig library
525 #include <fontconfig/fontconfig.h>
531 Frees all data structures allocated by previous calls to
532 fontconfig functions. Fontconfig returns to an uninitialized
533 state, requiring a new call to one of the FcInit functions
534 before any other fontconfig function may be called.
540 FcGetVersion -- library version number
544 #include <fontconfig/fontconfig.h>
546 int FcGetVersion(void);
550 Returns the version number of the library.
556 FcInitReinitialize -- re-initialize library
560 #include <fontconfig/fontconfig.h>
562 FcBool FcInitReinitialize(void);
566 Forces the default configuration file to be reloaded and resets
567 the default configuration. Returns FcFalse if the configuration
568 cannot be reloaded (due to configuration file errors,
569 allocation failures or other issues) and leaves the existing
570 configuration unchanged. Otherwise returns FcTrue.
576 FcInitBringUptoDate -- reload configuration files if needed
580 #include <fontconfig/fontconfig.h>
582 FcBool FcInitBringUptoDate(void);
586 Checks the rescan interval in the default configuration,
587 checking the configuration if the interval has passed and
588 reloading the configuration if when any changes are detected.
589 Returns FcFalse if the configuration cannot be reloaded (see
590 FcInitReinitialize). Otherwise returns FcTrue.
591 __________________________________________________________
596 FcPatternCreate -- Create a pattern
597 FcPatternDuplicate -- Copy a pattern
598 FcPatternReference -- Increment pattern reference count
599 FcPatternDestroy -- Destroy a pattern
600 FcPatternEqual -- Compare patterns
601 FcPatternEqualSubset -- Compare portions of patterns
602 FcPatternFilter -- Filter the objects of pattern
603 FcPatternHash -- Compute a pattern hash value
604 FcPatternAdd -- Add a value to a pattern
605 FcPatternAddWeak -- Add a value to a pattern with weak binding
606 FcPatternAdd-Type -- Add a typed value to a pattern
607 FcPatternGet -- Return a value from a pattern
608 FcPatternGet-Type -- Return a typed value from a pattern
609 FcPatternBuild -- Create patterns from arguments
610 FcPatternDel -- Delete a property from a pattern
611 FcPatternRemove -- Remove one object of the specified type from
614 FcPatternPrint -- Print a pattern for debugging
615 FcDefaultSubstitute -- Perform default substitutions in a
618 FcNameParse -- Parse a pattern string
619 FcNameUnparse -- Convert a pattern back into a string that can
622 FcPatternFormat -- Format a pattern into a string according to
625 An FcPattern is an opaque type that holds both patterns to
626 match against the available fonts, as well as the information
633 FcPatternCreate -- Create a pattern
637 #include <fontconfig/fontconfig.h>
639 FcPattern * FcPatternCreate(void);
643 Creates a pattern with no properties; used to build patterns
650 FcPatternDuplicate -- Copy a pattern
654 #include <fontconfig/fontconfig.h>
656 FcPattern * FcPatternDuplicate(const FcPattern *p);
660 Copy a pattern, returning a new pattern that matches p. Each
661 pattern may be modified without affecting the other.
667 FcPatternReference -- Increment pattern reference count
671 #include <fontconfig/fontconfig.h>
673 void FcPatternReference(FcPattern *p);
677 Add another reference to p. Patterns are freed only when the
678 reference count reaches zero.
684 FcPatternDestroy -- Destroy a pattern
688 #include <fontconfig/fontconfig.h>
690 void FcPatternDestroy(FcPattern *p);
694 Decrement the pattern reference count. If all references are
695 gone, destroys the pattern, in the process destroying all
702 FcPatternEqual -- Compare patterns
706 #include <fontconfig/fontconfig.h>
708 FcBool FcPatternEqual(const FcPattern *pa, const FcPattern
713 Returns whether pa and pb are exactly alike.
719 FcPatternEqualSubset -- Compare portions of patterns
723 #include <fontconfig/fontconfig.h>
725 FcBool FcPatternEqualSubset(const FcPattern *pa, const
726 FcPattern *pb, const FcObjectSet *os);
730 Returns whether pa and pb have exactly the same values for all
731 of the objects in os.
737 FcPatternFilter -- Filter the objects of pattern
741 #include <fontconfig/fontconfig.h>
743 FcPattern * FcPatternFilter(FcPattern *p, const FcObjectSet *);
747 Returns a new pattern that only has those objects from p that
748 are in os. If os is NULL, a duplicate of p is returned.
754 FcPatternHash -- Compute a pattern hash value
758 #include <fontconfig/fontconfig.h>
760 FcChar32 FcPatternHash(const FcPattern *p);
764 Returns a 32-bit number which is the same for any two patterns
771 FcPatternAdd -- Add a value to a pattern
775 #include <fontconfig/fontconfig.h>
777 FcBool FcPatternAdd(FcPattern *p, const char *object, FcValue
778 value, FcBool append);
782 Adds a single value to the list of values associated with the
783 property named `object. If `append is FcTrue, the value is
784 added at the end of any existing list, otherwise it is inserted
785 at the beginning. `value' is saved (with FcValueSave) when
786 inserted into the pattern so that the library retains no
787 reference to any application-supplied data structure.
793 FcPatternAddWeak -- Add a value to a pattern with weak binding
797 #include <fontconfig/fontconfig.h>
799 FcBool FcPatternAddWeak(FcPattern *p, const char *object,
800 FcValue value, FcBool append);
804 FcPatternAddWeak is essentially the same as FcPatternAdd except
805 that any values added to the list have binding weak instead of
812 FcPatternAddInteger, FcPatternAddDouble, FcPatternAddString,
813 FcPatternAddMatrix, FcPatternAddCharSet, FcPatternAddBool,
814 FcPatternAddFTFace, FcPatternAddLangSet,
815 FcPatternAddRange -- Add a typed value to a pattern
819 #include <fontconfig/fontconfig.h>
821 FcBool FcPatternAddInteger(FcPattern *p, const char *object,
824 FcBool FcPatternAddDouble(FcPattern *p, const char *object,
827 FcBool FcPatternAddString(FcPattern *p, const char *object,
830 FcBool FcPatternAddMatrix(FcPattern *p, const char *object,
833 FcBool FcPatternAddCharSet(FcPattern *p, const char *object,
836 FcBool FcPatternAddBool(FcPattern *p, const char *object,
839 FcBool FcPatternAddFTFace(FcPattern *p, const char *object,
842 FcBool FcPatternAddLangSet(FcPattern *p, const char *object,
845 FcBool FcPatternAddRange(FcPattern *p, const char *object,
850 These are all convenience functions that insert objects of the
851 specified type into the pattern. Use these in preference to
852 FcPatternAdd as they will provide compile-time typechecking.
853 These all append values to any existing list of values.
854 FcPatternAddRange are available since 2.11.91.
860 FcPatternGet -- Return a value from a pattern
864 #include <fontconfig/fontconfig.h>
866 FcResult FcPatternGet(FcPattern *p, const char *object, int id,
871 Returns in v the id'th value associated with the property
872 object. The value returned is not a copy, but rather refers to
873 the data stored within the pattern directly. Applications must
880 FcPatternGetInteger, FcPatternGetDouble, FcPatternGetString,
881 FcPatternGetMatrix, FcPatternGetCharSet, FcPatternGetBool,
882 FcPatternGetFTFace, FcPatternGetLangSet,
883 FcPatternGetRange -- Return a typed value from a pattern
887 #include <fontconfig/fontconfig.h>
889 FcResult FcPatternGetInteger(FcPattern *p, const char *object,
892 FcResult FcPatternGetDouble(FcPattern *p, const char *object,
895 FcResult FcPatternGetString(FcPattern *p, const char *object,
898 FcResult FcPatternGetMatrix(FcPattern *p, const char *object,
899 int n, FcMatrix **s);
901 FcResult FcPatternGetCharSet(FcPattern *p, const char *object,
902 int n, FcCharSet **c);
904 FcResult FcPatternGetBool(FcPattern *p, const char *object, int
907 FcResult FcPatternGetFTFace(FcPattern *p, const char *object,
910 FcResult FcPatternGetLangSet(FcPattern *p, const char *object,
911 int n, FcLangSet **l);
913 FcResult FcPatternGetRange(FcPattern *p, const char *object,
918 These are convenience functions that call FcPatternGet and
919 verify that the returned data is of the expected type. They
920 return FcResultTypeMismatch if this is not the case. Note that
921 these (like FcPatternGet) do not make a copy of any data
922 structure referenced by the return value. Use these in
923 preference to FcPatternGet to provide compile-time
924 typechecking. FcPatternGetRange are available since 2.11.91.
930 FcPatternBuild, FcPatternVaBuild, FcPatternVapBuild -- Create
931 patterns from arguments
935 #include <fontconfig/fontconfig.h>
937 FcPattern * FcPatternBuild(FcPattern *pattern, ...);
939 FcPattern * FcPatternVaBuild(FcPattern *pattern, va_list va);
941 void FcPatternVapBuild(FcPattern *result, FcPattern *pattern,
946 Builds a pattern using a list of objects, types and values.
947 Each value to be entered in the pattern is specified with three
950 1. Object name, a string describing the property to be added.
951 2. Object type, one of the FcType enumerated values
952 3. Value, not an FcValue, but the raw type as passed to any of
953 the FcPatternAdd<type> functions. Must match the type of
956 The argument list is terminated by a null object name, no
957 object type nor value need be passed for this. The values are
958 added to `pattern', if `pattern' is null, a new pattern is
959 created. In either case, the pattern is returned. Example
960 pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *)
963 FcPatternVaBuild is used when the arguments are already in the
964 form of a varargs value. FcPatternVapBuild is a macro version
965 of FcPatternVaBuild which returns its result directly in the
972 FcPatternDel -- Delete a property from a pattern
976 #include <fontconfig/fontconfig.h>
978 FcBool FcPatternDel(FcPattern *p, const char *object);
982 Deletes all values associated with the property `object',
983 returning whether the property existed or not.
989 FcPatternRemove -- Remove one object of the specified type from
994 #include <fontconfig/fontconfig.h>
996 FcBool FcPatternRemove(FcPattern *p, const char *object, int
1001 Removes the value associated with the property `object' at
1002 position `id', returning whether the property existed and had a
1003 value at that position or not.
1009 FcPatternPrint -- Print a pattern for debugging
1013 #include <fontconfig/fontconfig.h>
1015 void FcPatternPrint(const FcPattern *p);
1019 Prints an easily readable version of the pattern to stdout.
1020 There is no provision for reparsing data in this format, it's
1021 just for diagnostics and debugging.
1027 FcDefaultSubstitute -- Perform default substitutions in a
1032 #include <fontconfig/fontconfig.h>
1034 void FcDefaultSubstitute(FcPattern *pattern);
1038 Supplies default values for underspecified font patterns:
1040 * Patterns without a specified style or weight are set to
1042 * Patterns without a specified style or slant are set to
1044 * Patterns without a specified pixel size are given one
1045 computed from any specified point size (default 12), dpi
1046 (default 75) and scale (default 1).
1052 FcNameParse -- Parse a pattern string
1056 #include <fontconfig/fontconfig.h>
1058 FcPattern * FcNameParse(const FcChar8 *name);
1062 Converts name from the standard text format described above
1069 FcNameUnparse -- Convert a pattern back into a string that can
1074 #include <fontconfig/fontconfig.h>
1076 FcChar8 * FcNameUnparse(FcPattern *pat);
1080 Converts the given pattern into the standard text format
1081 described above. The return value is not static, but instead
1082 refers to newly allocated memory which should be freed by the
1083 caller using free().
1089 FcPatternFormat -- Format a pattern into a string according to
1094 #include <fontconfig/fontconfig.h>
1096 FcChar8 * FcPatternFormat(FcPattern *pat, const FcChar8
1101 Converts given pattern pat into text described by the format
1102 specifier format. The return value refers to newly allocated
1103 memory which should be freed by the caller using free(), or
1104 NULL if format is invalid.
1106 The format is loosely modeled after printf-style format string.
1107 The format string is composed of zero or more directives:
1108 ordinary characters (not "%"), which are copied unchanged to
1109 the output stream; and tags which are interpreted to construct
1110 text from the pattern in a variety of ways (explained below).
1111 Special characters can be escaped using backslash. C-string
1112 style special characters like \n and \r are also supported
1113 (this is useful when the format string is not a C string
1114 literal). It is advisable to always escape curly braces that
1115 are meant to be copied to the output as ordinary characters.
1117 Each tag is introduced by the character "%", followed by an
1118 optional minimum field width, followed by tag contents in curly
1119 braces ({}). If the minimum field width value is provided the
1120 tag will be expanded and the result padded to achieve the
1121 minimum width. If the minimum field width is positive, the
1122 padding will right-align the text. Negative field width will
1123 left-align. The rest of this section describes various
1124 supported tag contents and their expansion.
1126 A simple tag is one where the content is an identifier. When
1127 simple tags are expanded, the named identifier will be looked
1128 up in pattern and the resulting list of values returned, joined
1129 together using comma. For example, to print the family name and
1130 style of the pattern, use the format "%{family} %{style}\n". To
1131 extend the family column to forty characters use
1132 "%-40{family}%{style}\n".
1134 Simple tags expand to list of all values for an element. To
1135 only choose one of the values, one can index using the syntax
1136 "%{elt[idx]}". For example, to get the first family name only,
1139 If a simple tag ends with "=" and the element is found in the
1140 pattern, the name of the element followed by "=" will be output
1141 before the list of values. For example, "%{weight=}" may expand
1142 to the string "weight=80". Or to the empty string if pattern
1143 does not have weight set.
1145 If a simple tag starts with ":" and the element is found in the
1146 pattern, ":" will be printed first. For example, combining this
1147 with the =, the format "%{:weight=}" may expand to ":weight=80"
1148 or to the empty string if pattern does not have weight set.
1150 If a simple tag contains the string ":-", the rest of the the
1151 tag contents will be used as a default string. The default
1152 string is output if the element is not found in the pattern.
1153 For example, the format "%{:weight=:-123}" may expand to
1154 ":weight=80" or to the string ":weight=123" if pattern does not
1157 A count tag is one that starts with the character "#" followed
1158 by an element name, and expands to the number of values for the
1159 element in the pattern. For example, "%{#family}" expands to
1160 the number of family names pattern has set, which may be zero.
1162 A sub-expression tag is one that expands a sub-expression. The
1163 tag contents are the sub-expression to expand placed inside
1164 another set of curly braces. Sub-expression tags are useful for
1165 aligning an entire sub-expression, or to apply converters
1166 (explained later) to the entire sub-expression output. For
1167 example, the format "%40{{%{family} %{style}}}" expands the
1168 sub-expression to construct the family name followed by the
1169 style, then takes the entire string and pads it on the left to
1170 be at least forty characters.
1172 A filter-out tag is one starting with the character "-"
1173 followed by a comma-separated list of element names, followed
1174 by a sub-expression enclosed in curly braces. The
1175 sub-expression will be expanded but with a pattern that has the
1176 listed elements removed from it. For example, the format
1177 "%{-size,pixelsize{sub-expr}}" will expand "sub-expr" with
1178 pattern sans the size and pixelsize elements.
1180 A filter-in tag is one starting with the character "+" followed
1181 by a comma-separated list of element names, followed by a
1182 sub-expression enclosed in curly braces. The sub-expression
1183 will be expanded but with a pattern that only has the listed
1184 elements from the surrounding pattern. For example, the format
1185 "%{+family,familylang{sub-expr}}" will expand "sub-expr" with a
1186 sub-pattern consisting only the family and family lang elements
1189 A conditional tag is one starting with the character "?"
1190 followed by a comma-separated list of element conditions,
1191 followed by two sub-expression enclosed in curly braces. An
1192 element condition can be an element name, in which case it
1193 tests whether the element is defined in pattern, or the
1194 character "!" followed by an element name, in which case the
1195 test is negated. The conditional passes if all the element
1196 conditions pass. The tag expands the first sub-expression if
1197 the conditional passes, and expands the second sub-expression
1198 otherwise. For example, the format
1199 "%{?size,dpi,!pixelsize{pass}{fail}}" will expand to "pass" if
1200 pattern has size and dpi elements but no pixelsize element, and
1201 to "fail" otherwise.
1203 An enumerate tag is one starting with the string "[]" followed
1204 by a comma-separated list of element names, followed by a
1205 sub-expression enclosed in curly braces. The list of values for
1206 the named elements are walked in parallel and the
1207 sub-expression expanded each time with a pattern just having a
1208 single value for those elements, starting from the first value
1209 and continuing as long as any of those elements has a value.
1210 For example, the format "%{[]family,familylang{%{family}
1211 (%{familylang})\n}}" will expand the pattern "%{family}
1212 (%{familylang})\n" with a pattern having only the first value
1213 of the family and familylang elements, then expands it with the
1214 second values, then the third, etc.
1216 As a special case, if an enumerate tag has only one element,
1217 and that element has only one value in the pattern, and that
1218 value is of type FcLangSet, the individual languages in the
1219 language set are enumerated.
1221 A builtin tag is one starting with the character "=" followed
1222 by a builtin name. The following builtins are defined:
1225 Expands to the result of calling FcNameUnparse() on the
1229 Expands to the output of the default output format of
1230 the fc-match command on the pattern, without the final
1234 Expands to the output of the default output format of
1235 the fc-list command on the pattern, without the final
1239 Expands to the output of the default output format of
1240 the fc-cat command on the pattern, without the final
1244 Expands to the list of PackageKit font() tags for the
1245 pattern. Currently this includes tags for each family
1246 name, and each language from the pattern, enumerated and
1247 sanitized into a set of tags terminated by newline.
1248 Package management systems can use these tags to tag
1249 their packages accordingly.
1251 For example, the format "%{+family,style{%{=unparse}}}\n" will
1252 expand to an unparsed name containing only the family and style
1253 element values from pattern.
1255 The contents of any tag can be followed by a set of zero or
1256 more converters. A converter is specified by the character "|"
1257 followed by the converter name and arguments. The following
1258 converters are defined:
1261 Replaces text with the results of calling
1262 FcStrBasename() on it.
1265 Replaces text with the results of calling FcStrDirname()
1269 Replaces text with the results of calling
1270 FcStrDowncase() on it.
1273 Escapes text for one level of shell expansion. (Escapes
1274 single-quotes, also encloses text in single-quotes.)
1277 Escapes text such that it can be used as part of a C
1278 string literal. (Escapes backslash and double-quotes.)
1281 Escapes text such that it can be used in XML and HTML.
1282 (Escapes less-than, greater-than, and ampersand.)
1285 Deletes all occurrences of each of the characters in
1286 chars from the text. FIXME: This converter is not UTF-8
1290 Escapes all occurrences of each of the characters in
1291 chars by prepending it by the first character in chars.
1292 FIXME: This converter is not UTF-8 aware yet.
1295 Translates all occurrences of each of the characters in
1296 from by replacing them with their corresponding
1297 character in to. If to has fewer characters than from,
1298 it will be extended by repeating its last character.
1299 FIXME: This converter is not UTF-8 aware yet.
1301 For example, the format "%{family|downcase|delete( )}\n" will
1302 expand to the values of the family element in pattern,
1303 lower-cased and with spaces removed.
1308 __________________________________________________________
1313 FcFontSetCreate -- Create a font set
1314 FcFontSetDestroy -- Destroy a font set
1315 FcFontSetAdd -- Add to a font set
1316 FcFontSetList -- List fonts from a set of font sets
1317 FcFontSetMatch -- Return the best font from a set of font sets
1318 FcFontSetPrint -- Print a set of patterns to stdout
1319 FcFontSetSort -- Add to a font set
1320 FcFontSetSortDestroy -- DEPRECATED destroy a font set
1322 An FcFontSet simply holds a list of patterns; these are used to
1323 return the results of listing available fonts.
1329 FcFontSetCreate -- Create a font set
1333 #include <fontconfig/fontconfig.h>
1335 FcFontSet * FcFontSetCreate(void);
1339 Creates an empty font set.
1345 FcFontSetDestroy -- Destroy a font set
1349 #include <fontconfig/fontconfig.h>
1351 void FcFontSetDestroy(FcFontSet *s);
1355 Destroys a font set. Note that this destroys any referenced
1362 FcFontSetAdd -- Add to a font set
1366 #include <fontconfig/fontconfig.h>
1368 FcBool FcFontSetAdd(FcFontSet *s, FcPattern *font);
1372 Adds a pattern to a font set. Note that the pattern is not
1373 copied before being inserted into the set. Returns FcFalse if
1374 the pattern cannot be inserted into the set (due to allocation
1375 failure). Otherwise returns FcTrue.
1381 FcFontSetList -- List fonts from a set of font sets
1385 #include <fontconfig/fontconfig.h>
1387 FcFontSet * FcFontSetList(FcConfig *config, FcFontSet **sets,
1388 intnsets, FcPattern *pattern, FcObjectSet *object_set);
1392 Selects fonts matching pattern from sets, creates patterns from
1393 those fonts containing only the objects in object_set and
1394 returns the set of unique such patterns. If config is NULL, the
1395 default configuration is checked to be up to date, and used.
1401 FcFontSetMatch -- Return the best font from a set of font sets
1405 #include <fontconfig/fontconfig.h>
1407 FcPattern * FcFontSetMatch(FcConfig *config, FcFontSet **sets,
1408 intnsets, FcPattern *pattern, FcResult *result);
1412 Finds the font in sets most closely matching pattern and
1413 returns the result of FcFontRenderPrepare for that font and the
1414 provided pattern. This function should be called only after
1415 FcConfigSubstitute and FcDefaultSubstitute have been called for
1416 pattern; otherwise the results will not be correct. If config
1417 is NULL, the current configuration is used. Returns NULL if an
1418 error occurs during this process.
1424 FcFontSetPrint -- Print a set of patterns to stdout
1428 #include <fontconfig/fontconfig.h>
1430 void FcFontSetPrint(FcFontSet *set);
1434 This function is useful for diagnosing font related issues,
1435 printing the complete contents of every pattern in set. The
1436 format of the output is designed to be of help to users and
1437 developers, and may change at any time.
1443 FcFontSetSort -- Add to a font set
1447 #include <fontconfig/fontconfig.h>
1449 FcFontSetSort(FcConfig *config, FcFontSet **sets, intnsets,
1450 FcPattern *pattern, FcBool trim, FcCharSet **csp, FcResult
1455 Returns the list of fonts from sets sorted by closeness to
1456 pattern. If trim is FcTrue, elements in the list which don't
1457 include Unicode coverage not provided by earlier elements in
1458 the list are elided. The union of Unicode coverage of all of
1459 the fonts is returned in csp, if csp is not NULL. This function
1460 should be called only after FcConfigSubstitute and
1461 FcDefaultSubstitute have been called for p; otherwise the
1462 results will not be correct.
1464 The returned FcFontSet references FcPattern structures which
1465 may be shared by the return value from multiple FcFontSort
1466 calls, applications cannot modify these patterns. Instead, they
1467 should be passed, along with pattern to FcFontRenderPrepare
1468 which combines them into a complete pattern.
1470 The FcFontSet returned by FcFontSetSort is destroyed by calling
1473 FcFontSetSortDestroy
1477 FcFontSetSortDestroy -- DEPRECATED destroy a font set
1481 #include <fontconfig/fontconfig.h>
1483 FcFontSetSortDestroy(FcFontSet *set);
1487 This function is DEPRECATED. FcFontSetSortDestroy destroys set
1488 by calling FcFontSetDestroy. Applications should use
1489 FcFontSetDestroy directly instead.
1490 __________________________________________________________
1495 FcObjectSetCreate -- Create an object set
1496 FcObjectSetAdd -- Add to an object set
1497 FcObjectSetDestroy -- Destroy an object set
1498 FcObjectSetBuild -- Build object set from args
1500 An FcObjectSet holds a list of pattern property names; it is
1501 used to indicate which properties are to be returned in the
1502 patterns from FcFontList.
1508 FcObjectSetCreate -- Create an object set
1512 #include <fontconfig/fontconfig.h>
1514 FcObjectSet * FcObjectSetCreate(void);
1518 Creates an empty set.
1524 FcObjectSetAdd -- Add to an object set
1528 #include <fontconfig/fontconfig.h>
1530 FcBool FcObjectSetAdd(FcObjectSet *os, const char *object);
1534 Adds a property name to the set. Returns FcFalse if the
1535 property name cannot be inserted into the set (due to
1536 allocation failure). Otherwise returns FcTrue.
1542 FcObjectSetDestroy -- Destroy an object set
1546 #include <fontconfig/fontconfig.h>
1548 void FcObjectSetDestroy(FcObjectSet *os);
1552 Destroys an object set.
1558 FcObjectSetBuild, FcObjectSetVaBuild,
1559 FcObjectSetVapBuild -- Build object set from args
1563 #include <fontconfig/fontconfig.h>
1565 FcObjectSet * FcObjectSetBuild(const char *first, ...);
1567 FcObjectSet * FcObjectSetVaBuild(const char *first, va_list
1570 void FcObjectSetVapBuild(FcObjectSet *result, const char
1571 *first, va_list va);
1575 These build an object set from a null-terminated list of
1576 property names. FcObjectSetVapBuild is a macro version of
1577 FcObjectSetVaBuild which returns the result in the result
1579 __________________________________________________________
1581 FreeType specific functions
1584 FcFreeTypeCharIndex -- map Unicode to glyph id
1585 FcFreeTypeCharSet -- compute Unicode coverage
1586 FcFreeTypeCharSetAndSpacing -- compute Unicode coverage and
1589 FcFreeTypeQuery -- compute pattern from font file (and index)
1590 FcFreeTypeQueryFace -- compute pattern from FT_Face
1592 While the fontconfig library doesn't insist that FreeType be
1593 used as the rasterization mechanism for fonts, it does provide
1594 some convenience functions.
1600 FcFreeTypeCharIndex -- map Unicode to glyph id
1604 #include <fontconfig.h>
1605 #include <fcfreetype.h>
1607 FT_UInt FcFreeTypeCharIndex(FT_Face face, FcChar32 ucs4);
1611 Maps a Unicode char to a glyph index. This function uses
1612 information from several possible underlying encoding tables to
1613 work around broken fonts. As a result, this function isn't
1614 designed to be used in performance sensitive areas; results
1615 from this function are intended to be cached by higher level
1622 FcFreeTypeCharSet -- compute Unicode coverage
1626 #include <fontconfig.h>
1627 #include <fcfreetype.h>
1629 FcCharSet * FcFreeTypeCharSet(FT_Face face, FcBlanks *blanks);
1633 Scans a FreeType face and returns the set of encoded Unicode
1634 chars. This scans several encoding tables to build as complete
1635 a list as possible. If 'blanks' is not 0, the glyphs in the
1636 font are examined and any blank glyphs not in 'blanks' are not
1637 placed in the returned FcCharSet.
1639 FcFreeTypeCharSetAndSpacing
1643 FcFreeTypeCharSetAndSpacing -- compute Unicode coverage and
1648 #include <fontconfig.h>
1649 #include <fcfreetype.h>
1651 FcCharSet * FcFreeTypeCharSetAndSpacing(FT_Face face, FcBlanks
1652 *blanks, int *spacing);
1656 Scans a FreeType face and returns the set of encoded Unicode
1657 chars. This scans several encoding tables to build as complete
1658 a list as possible. If 'blanks' is not 0, the glyphs in the
1659 font are examined and any blank glyphs not in 'blanks' are not
1660 placed in the returned FcCharSet. spacing receives the computed
1661 spacing type of the font, one of FC_MONO for a font where all
1662 glyphs have the same width, FC_DUAL, where the font has glyphs
1663 in precisely two widths, one twice as wide as the other, or
1664 FC_PROPORTIONAL where the font has glyphs of many widths.
1670 FcFreeTypeQuery -- compute pattern from font file (and index)
1674 #include <fontconfig.h>
1675 #include <fcfreetype.h>
1677 FcPattern * FcFreeTypeQuery(const FcChar8 *file, int id,
1678 FcBlanks *blanks, int *count);
1682 Constructs a pattern representing the 'id'th font in 'file'.
1683 The number of fonts in 'file' is returned in 'count'.
1689 FcFreeTypeQueryFace -- compute pattern from FT_Face
1693 #include <fontconfig.h>
1694 #include <fcfreetype.h>
1696 FcPattern * FcFreeTypeQueryFace(const FT_Face face, const
1697 FcChar8 *file, int id, FcBlanks *blanks);
1701 Constructs a pattern representing 'face'. 'file' and 'id' are
1702 used solely as data for pattern elements (FC_FILE, FC_INDEX and
1703 sometimes FC_FAMILY).
1704 __________________________________________________________
1709 FcValueDestroy -- Free a value
1710 FcValueSave -- Copy a value
1711 FcValuePrint -- Print a value to stdout
1712 FcValueEqual -- Test two values for equality
1714 FcValue is a structure containing a type tag and a union of all
1715 possible datatypes. The tag is an enum of type FcType and is
1716 intended to provide a measure of run-time typechecking,
1717 although that depends on careful programming.
1723 FcValueDestroy -- Free a value
1727 #include <fontconfig/fontconfig.h>
1729 void FcValueDestroy(FcValue v);
1733 Frees any memory referenced by v. Values of type FcTypeString,
1734 FcTypeMatrix and FcTypeCharSet reference memory, the other
1741 FcValueSave -- Copy a value
1745 #include <fontconfig/fontconfig.h>
1747 FcValue FcValueSave(FcValue v);
1751 Returns a copy of v duplicating any object referenced by it so
1752 that v may be safely destroyed without harming the new value.
1758 FcValuePrint -- Print a value to stdout
1762 #include <fontconfig/fontconfig.h>
1764 void FcValuePrint(FcValue v);
1768 Prints a human-readable representation of v to stdout. The
1769 format should not be considered part of the library
1770 specification as it may change in the future.
1776 FcValueEqual -- Test two values for equality
1780 #include <fontconfig/fontconfig.h>
1782 FcBool FcValueEqual(FcValue v_a, FcValue v_b);
1786 Compares two values. Integers and Doubles are compared as
1787 numbers; otherwise the two values have to be the same type to
1788 be considered equal. Strings are compared ignoring case.
1789 __________________________________________________________
1794 FcCharSetCreate -- Create an empty character set
1795 FcCharSetDestroy -- Destroy a character set
1796 FcCharSetAddChar -- Add a character to a charset
1797 FcCharSetDelChar -- Add a character to a charset
1798 FcCharSetCopy -- Copy a charset
1799 FcCharSetEqual -- Compare two charsets
1800 FcCharSetIntersect -- Intersect charsets
1801 FcCharSetUnion -- Add charsets
1802 FcCharSetSubtract -- Subtract charsets
1803 FcCharSetMerge -- Merge charsets
1804 FcCharSetHasChar -- Check a charset for a char
1805 FcCharSetCount -- Count entries in a charset
1806 FcCharSetIntersectCount -- Intersect and count charsets
1807 FcCharSetSubtractCount -- Subtract and count charsets
1808 FcCharSetIsSubset -- Test for charset inclusion
1809 FcCharSetFirstPage -- Start enumerating charset contents
1810 FcCharSetNextPage -- Continue enumerating charset contents
1811 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode
1814 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate
1816 An FcCharSet is a boolean array indicating a set of Unicode
1817 chars. Those associated with a font are marked constant and
1818 cannot be edited. FcCharSets may be reference counted
1819 internally to reduce memory consumption; this may be visible to
1820 applications as the result of FcCharSetCopy may return it's
1821 argument, and that CharSet may remain unmodifiable.
1827 FcCharSetCreate -- Create an empty character set
1831 #include <fontconfig/fontconfig.h>
1833 FcCharSet * FcCharSetCreate(void);
1837 FcCharSetCreate allocates and initializes a new empty character
1844 FcCharSetDestroy -- Destroy a character set
1848 #include <fontconfig/fontconfig.h>
1850 void FcCharSetDestroy(FcCharSet *fcs);
1854 FcCharSetDestroy decrements the reference count fcs. If the
1855 reference count becomes zero, all memory referenced is freed.
1861 FcCharSetAddChar -- Add a character to a charset
1865 #include <fontconfig/fontconfig.h>
1867 FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4);
1871 FcCharSetAddChar adds a single Unicode char to the set,
1872 returning FcFalse on failure, either as a result of a constant
1873 set or from running out of memory.
1879 FcCharSetDelChar -- Add a character to a charset
1883 #include <fontconfig/fontconfig.h>
1885 FcBool FcCharSetDelChar(FcCharSet *fcs, FcChar32 ucs4);
1889 FcCharSetDelChar deletes a single Unicode char from the set,
1890 returning FcFalse on failure, either as a result of a constant
1891 set or from running out of memory.
1901 FcCharSetCopy -- Copy a charset
1905 #include <fontconfig/fontconfig.h>
1907 FcCharSet * FcCharSetCopy(FcCharSet *src);
1911 Makes a copy of src; note that this may not actually do
1912 anything more than increment the reference count on src.
1918 FcCharSetEqual -- Compare two charsets
1922 #include <fontconfig/fontconfig.h>
1924 FcBool FcCharSetEqual(const FcCharSet *a, const FcCharSet *b);
1928 Returns whether a and b contain the same set of Unicode chars.
1934 FcCharSetIntersect -- Intersect charsets
1938 #include <fontconfig/fontconfig.h>
1940 FcCharSet * FcCharSetIntersect(const FcCharSet *a, const
1945 Returns a set including only those chars found in both a and b.
1951 FcCharSetUnion -- Add charsets
1955 #include <fontconfig/fontconfig.h>
1957 FcCharSet * FcCharSetUnion(const FcCharSet *a, const FcCharSet
1962 Returns a set including only those chars found in either a or
1969 FcCharSetSubtract -- Subtract charsets
1973 #include <fontconfig/fontconfig.h>
1975 FcCharSet * FcCharSetSubtract(const FcCharSet *a, const
1980 Returns a set including only those chars found in a but not b.
1986 FcCharSetMerge -- Merge charsets
1990 #include <fontconfig/fontconfig.h>
1992 FcBool FcCharSetMerge(FcCharSet *a, const FcCharSet *b, FcBool
1997 Adds all chars in b to a. In other words, this is an in-place
1998 version of FcCharSetUnion. If changed is not NULL, then it
1999 returns whether any new chars from b were added to a. Returns
2000 FcFalse on failure, either when a is a constant set or from
2001 running out of memory.
2007 FcCharSetHasChar -- Check a charset for a char
2011 #include <fontconfig/fontconfig.h>
2013 FcBool FcCharSetHasChar(const FcCharSet *fcs, FcChar32 ucs4);
2017 Returns whether fcs contains the char ucs4.
2023 FcCharSetCount -- Count entries in a charset
2027 #include <fontconfig/fontconfig.h>
2029 FcChar32 FcCharSetCount(const FcCharSet *a);
2033 Returns the total number of Unicode chars in a.
2035 FcCharSetIntersectCount
2039 FcCharSetIntersectCount -- Intersect and count charsets
2043 #include <fontconfig/fontconfig.h>
2045 FcChar32 FcCharSetIntersectCount(const FcCharSet *a, const
2050 Returns the number of chars that are in both a and b.
2052 FcCharSetSubtractCount
2056 FcCharSetSubtractCount -- Subtract and count charsets
2060 #include <fontconfig/fontconfig.h>
2062 FcChar32 FcCharSetSubtractCount(const FcCharSet *a, const
2067 Returns the number of chars that are in a but not in b.
2073 FcCharSetIsSubset -- Test for charset inclusion
2077 #include <fontconfig/fontconfig.h>
2079 FcBool FcCharSetIsSubset(const FcCharSet *a, const FcCharSet
2084 Returns whether a is a subset of b.
2090 FcCharSetFirstPage -- Start enumerating charset contents
2094 #include <fontconfig/fontconfig.h>
2096 FcChar32 FcCharSetFirstPage(const FcCharSet *a,
2097 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next);
2101 Builds an array of bits in map marking the first page of
2102 Unicode coverage of a. *next is set to contains the base code
2103 point for the next page in a. Returns the base code point for
2104 the page, or FC_CHARSET_DONE if a contains no pages. As an
2105 example, if FcCharSetFirstPage returns 0x300 and fills map with
2106 0xffffffff 0xffffffff 0x01000008 0x44300002 0xffffd7f0 0xfffffffb 0xffff
2109 Then the page contains code points 0x300 through 0x33f (the
2110 first 64 code points on the page) because map[0] and map[1]
2111 both have all their bits set. It also contains code points
2112 0x343 (0x300 + 32*2 + (4-1)) and 0x35e (0x300 + 32*2 + (31-1))
2113 because map[2] has the 4th and 31st bits set. The code points
2114 represented by map[3] and later are left as an excercise for
2121 FcCharSetNextPage -- Continue enumerating charset contents
2125 #include <fontconfig/fontconfig.h>
2127 FcChar32 FcCharSetNextPage(const FcCharSet *a,
2128 FcChar32[FC_CHARSET_MAP_SIZE] map, FcChar32 *next);
2132 Builds an array of bits in map marking the Unicode coverage of
2133 a for page containing *next (see the FcCharSetFirstPage
2134 description for details). *next is set to contains the base
2135 code point for the next page in a. Returns the base of code
2136 point for the page, or FC_CHARSET_DONE if a does not contain
2143 FcCharSetCoverage -- DEPRECATED return coverage for a Unicode
2148 #include <fontconfig/fontconfig.h>
2150 FcChar32 FcCharSetCoverage(const FcCharSet *a, FcChar32page,
2155 DEPRECATED This function returns a bitmask in result which
2156 indicates which code points in page are included in a.
2157 FcCharSetCoverage returns the next page in the charset which
2164 FcCharSetNew -- DEPRECATED alias for FcCharSetCreate
2168 #include <fontconfig/fontconfig.h>
2170 FcCharSet * FcCharSetNew(void);
2174 FcCharSetNew is a DEPRECATED alias for FcCharSetCreate.
2175 __________________________________________________________
2180 FcLangSetCreate -- create a langset object
2181 FcLangSetDestroy -- destroy a langset object
2182 FcLangSetCopy -- copy a langset object
2183 FcLangSetAdd -- add a language to a langset
2184 FcLangSetDel -- delete a language from a langset
2185 FcLangSetUnion -- Add langsets
2186 FcLangSetSubtract -- Subtract langsets
2187 FcLangSetCompare -- compare language sets
2188 FcLangSetContains -- check langset subset relation
2189 FcLangSetEqual -- test for matching langsets
2190 FcLangSetHash -- return a hash value for a langset
2191 FcLangSetHasLang -- test langset for language support
2192 FcGetDefaultLangs -- Get the default languages list
2193 FcLangSetGetLangs -- get the list of languages in the langset
2194 FcGetLangs -- Get list of languages
2195 FcLangNormalize -- Normalize the language string
2196 FcLangGetCharSet -- Get character map for a language
2198 An FcLangSet is a set of language names (each of which include
2199 language and an optional territory). They are used when
2200 selecting fonts to indicate which languages the fonts need to
2201 support. Each font is marked, using language orthography
2202 information built into fontconfig, with the set of supported
2209 FcLangSetCreate -- create a langset object
2213 #include <fontconfig/fontconfig.h>
2215 FcLangSet * FcLangSetCreate(void);
2219 FcLangSetCreate creates a new FcLangSet object.
2225 FcLangSetDestroy -- destroy a langset object
2229 #include <fontconfig/fontconfig.h>
2231 void FcLangSetDestroy(FcLangSet *ls);
2235 FcLangSetDestroy destroys a FcLangSet object, freeing all
2236 memory associated with it.
2242 FcLangSetCopy -- copy a langset object
2246 #include <fontconfig/fontconfig.h>
2248 FcLangSet * FcLangSetCopy(const FcLangSet *ls);
2252 FcLangSetCopy creates a new FcLangSet object and populates it
2253 with the contents of ls.
2259 FcLangSetAdd -- add a language to a langset
2263 #include <fontconfig/fontconfig.h>
2265 FcBool FcLangSetAdd(FcLangSet *ls, const FcChar8 *lang);
2269 lang is added to ls. lang should be of the form Ll-Tt where Ll
2270 is a two or three letter language from ISO 639 and Tt is a
2271 territory from ISO 3166.
2277 FcLangSetDel -- delete a language from a langset
2281 #include <fontconfig/fontconfig.h>
2283 FcBool FcLangSetDel(FcLangSet *ls, const FcChar8 *lang);
2287 lang is removed from ls. lang should be of the form Ll-Tt where
2288 Ll is a two or three letter language from ISO 639 and Tt is a
2289 territory from ISO 3166.
2299 FcLangSetUnion -- Add langsets
2303 #include <fontconfig/fontconfig.h>
2305 FcLangSet * FcLangSetUnion(const FcLangSet *ls_a, const
2310 Returns a set including only those languages found in either
2321 FcLangSetSubtract -- Subtract langsets
2325 #include <fontconfig/fontconfig.h>
2327 FcLangSet * FcLangSetSubtract(const FcLangSet *ls_a, const
2332 Returns a set including only those languages found in ls_a but
2343 FcLangSetCompare -- compare language sets
2347 #include <fontconfig/fontconfig.h>
2349 FcLangResult FcLangSetCompare(const FcLangSet *ls_a, const
2354 FcLangSetCompare compares language coverage for ls_a and ls_b.
2355 If they share any language and territory pair, this function
2356 returns FcLangEqual. If they share a language but differ in
2357 which territory that language is for, this function returns
2358 FcLangDifferentTerritory. If they share no languages in common,
2359 this function returns FcLangDifferentLang.
2365 FcLangSetContains -- check langset subset relation
2369 #include <fontconfig/fontconfig.h>
2371 FcBool FcLangSetContains(const FcLangSet *ls_a, const FcLangSet
2376 FcLangSetContains returns FcTrue if ls_a contains every
2377 language in ls_b. ls_a will 'contain' a language from ls_b if
2378 ls_a has exactly the language, or either the language or ls_a
2385 FcLangSetEqual -- test for matching langsets
2389 #include <fontconfig/fontconfig.h>
2391 FcBool FcLangSetEqual(const FcLangSet *ls_a, const FcLangSet
2396 Returns FcTrue if and only if ls_a supports precisely the same
2397 language and territory combinations as ls_b.
2403 FcLangSetHash -- return a hash value for a langset
2407 #include <fontconfig/fontconfig.h>
2409 FcChar32 FcLangSetHash(const FcLangSet *ls);
2413 This function returns a value which depends solely on the
2414 languages supported by ls. Any language which equals ls will
2415 have the same result from FcLangSetHash. However, two langsets
2416 with the same hash value may not be equal.
2422 FcLangSetHasLang -- test langset for language support
2426 #include <fontconfig/fontconfig.h>
2428 FcLangResult FcLangSetHasLang(const FcLangSet *ls, const
2433 FcLangSetHasLang checks whether ls supports lang. If ls has a
2434 matching language and territory pair, this function returns
2435 FcLangEqual. If ls has a matching language but differs in which
2436 territory that language is for, this function returns
2437 FcLangDifferentTerritory. If ls has no matching language, this
2438 function returns FcLangDifferentLang.
2444 FcGetDefaultLangs -- Get the default languages list
2448 #include <fontconfig/fontconfig.h>
2450 FcStrSet * FcGetDefaultLangs(void);
2454 Returns a string set of the default languages according to the
2455 environment variables on the system. This function looks for
2456 them in order of FC_LANG, LC_ALL, LC_CTYPE and LANG then. If
2457 there are no valid values in those environment variables, "en"
2458 will be set as fallback.
2468 FcLangSetGetLangs -- get the list of languages in the langset
2472 #include <fontconfig/fontconfig.h>
2474 FcStrSet * FcLangSetGetLangs(const FcLangSet *ls);
2478 Returns a string set of all languages in langset.
2484 FcGetLangs -- Get list of languages
2488 #include <fontconfig/fontconfig.h>
2490 FcStrSet * FcGetLangs(void);
2494 Returns a string set of all known languages.
2500 FcLangNormalize -- Normalize the language string
2504 #include <fontconfig/fontconfig.h>
2506 FcChar8 * FcLangNormalize(const FcChar8 *lang);
2510 Returns a string to make lang suitable on fontconfig.
2520 FcLangGetCharSet -- Get character map for a language
2524 #include <fontconfig/fontconfig.h>
2526 const FcCharSet * FcLangGetCharSet(const FcChar8 *lang);
2530 Returns the FcCharMap for a language.
2531 __________________________________________________________
2536 FcMatrixInit -- initialize an FcMatrix structure
2537 FcMatrixCopy -- Copy a matrix
2538 FcMatrixEqual -- Compare two matrices
2539 FcMatrixMultiply -- Multiply matrices
2540 FcMatrixRotate -- Rotate a matrix
2541 FcMatrixScale -- Scale a matrix
2542 FcMatrixShear -- Shear a matrix
2544 FcMatrix structures hold an affine transformation in matrix
2551 FcMatrixInit -- initialize an FcMatrix structure
2555 #include <fontconfig/fontconfig.h>
2557 void FcMatrixInit(FcMatrix *matrix);
2561 FcMatrixInit initializes matrix to the identity matrix.
2567 FcMatrixCopy -- Copy a matrix
2571 #include <fontconfig/fontconfig.h>
2573 void FcMatrixCopy(const FcMatrix *matrix);
2577 FcMatrixCopy allocates a new FcMatrix and copies mat into it.
2583 FcMatrixEqual -- Compare two matrices
2587 #include <fontconfig/fontconfig.h>
2589 void FcMatrixEqual(const FcMatrix *matrix1, const FcMatrix
2594 FcMatrixEqual compares matrix1 and matrix2 returning FcTrue
2595 when they are equal and FcFalse when they are not.
2601 FcMatrixMultiply -- Multiply matrices
2605 #include <fontconfig/fontconfig.h>
2607 void FcMatrixMultiply(FcMatrix *result, const FcMatrix
2608 *matrix1, const FcMatrix *matrix2);
2612 FcMatrixMultiply multiplies matrix1 and matrix2 storing the
2619 FcMatrixRotate -- Rotate a matrix
2623 #include <fontconfig/fontconfig.h>
2625 void FcMatrixRotate(FcMatrix *matrix, double cos, double sin);
2629 FcMatrixRotate rotates matrix by the angle who's sine is sin
2630 and cosine is cos. This is done by multiplying by the matrix:
2638 FcMatrixScale -- Scale a matrix
2642 #include <fontconfig/fontconfig.h>
2644 void FcMatrixScale(FcMatrix *matrix, double sx, double dy);
2648 FcMatrixScale multiplies matrix x values by sx and y values by
2649 dy. This is done by multiplying by the matrix:
2657 FcMatrixShear -- Shear a matrix
2661 #include <fontconfig/fontconfig.h>
2663 void FcMatrixShear(FcMatrix *matrix, double sh, double sv);
2667 FcMatrixShare shears matrix horizontally by sh and vertically
2668 by sv. This is done by multiplying by the matrix:
2671 __________________________________________________________
2676 FcRangeCopy -- Copy a range object
2677 FcRangeCreateDouble -- create a range object for double
2678 FcRangeCreateInteger -- create a range object for integer
2679 FcRangeDestroy -- destroy a range object
2680 FcRangeGetDouble -- Get the range in double
2682 An FcRange holds two variables to indicate a range in between.
2688 FcRangeCopy -- Copy a range object
2692 #include <fontconfig/fontconfig.h>
2694 FcRange * FcRangeCopy(const FcRange *range);
2698 FcRangeCopy creates a new FcRange object and populates it with
2699 the contents of range.
2709 FcRangeCreateDouble -- create a range object for double
2713 #include <fontconfig/fontconfig.h>
2715 FcRange * FcRangeCreateDouble(doublebegin, doubleend);
2719 FcRangeCreateDouble creates a new FcRange object with double
2726 FcRangeCreateInteger
2730 FcRangeCreateInteger -- create a range object for integer
2734 #include <fontconfig/fontconfig.h>
2736 FcRange * FcRangeCreateInteger(intbegin, intend);
2740 FcRangeCreateInteger creates a new FcRange object with integer
2751 FcRangeDestroy -- destroy a range object
2755 #include <fontconfig/fontconfig.h>
2757 void FcRangeDestroy(FcRange *range);
2761 FcRangeDestroy destroys a FcRange object, freeing all memory
2772 FcRangeGetDouble -- Get the range in double
2776 #include <fontconfig/fontconfig.h>
2778 FcBool FcRangeGetDouble(const FcRange *range, double *begin,
2783 Returns in begin and end as the range.
2788 __________________________________________________________
2793 FcConfigCreate -- Create a configuration
2794 FcConfigReference -- Increment config reference count
2795 FcConfigDestroy -- Destroy a configuration
2796 FcConfigSetCurrent -- Set configuration as default
2797 FcConfigGetCurrent -- Return current configuration
2798 FcConfigUptoDate -- Check timestamps on config files
2799 FcConfigHome -- return the current home directory.
2800 FcConfigEnableHome -- controls use of the home directory.
2801 FcConfigBuildFonts -- Build font database
2802 FcConfigGetConfigDirs -- Get config directories
2803 FcConfigGetFontDirs -- Get font directories
2804 FcConfigGetConfigFiles -- Get config files
2805 FcConfigGetCache -- DEPRECATED used to return per-user cache
2808 FcConfigGetCacheDirs -- return the list of directories searched
2811 FcConfigGetFonts -- Get config font set
2812 FcConfigGetBlanks -- Get config blanks
2813 FcConfigGetRescanInterval -- Get config rescan interval
2814 FcConfigSetRescanInterval -- Set config rescan interval
2815 FcConfigAppFontAddFile -- Add font file to font database
2816 FcConfigAppFontAddDir -- Add fonts from directory to font
2819 FcConfigAppFontClear -- Remove all app fonts from font database
2820 FcConfigSubstituteWithPat -- Execute substitutions
2821 FcConfigSubstitute -- Execute substitutions
2822 FcFontMatch -- Return best font
2823 FcFontSort -- Return list of matching fonts
2824 FcFontRenderPrepare -- Prepare pattern for loading font file
2825 FcFontList -- List fonts
2826 FcConfigFilename -- Find a config file
2827 FcConfigParseAndLoad -- load a configuration file
2828 FcConfigGetSysRoot -- Obtain the system root directory
2829 FcConfigSetSysRoot -- Set the system root directory
2831 An FcConfig object holds the internal representation of a
2832 configuration. There is a default configuration which
2833 applications may use by passing 0 to any function using the
2834 data within an FcConfig.
2840 FcConfigCreate -- Create a configuration
2844 #include <fontconfig/fontconfig.h>
2846 FcConfig * FcConfigCreate(void);
2850 Creates an empty configuration.
2856 FcConfigReference -- Increment config reference count
2860 #include <fontconfig/fontconfig.h>
2862 FcConfig * FcConfigReference(FcConfig *config);
2866 Add another reference to config. Configs are freed only when
2867 the reference count reaches zero. If config is NULL, the
2868 current configuration is used. In that case this function will
2869 be similar to FcConfigGetCurrent() except that it increments
2870 the reference count before returning and the user is
2871 responsible for destroying the configuration when not needed
2878 FcConfigDestroy -- Destroy a configuration
2882 #include <fontconfig/fontconfig.h>
2884 void FcConfigDestroy(FcConfig *config);
2888 Decrements the config reference count. If all references are
2889 gone, destroys the configuration and any data associated with
2890 it. Note that calling this function with the return from
2891 FcConfigGetCurrent will cause a new configuration to be created
2892 for use as current configuration.
2898 FcConfigSetCurrent -- Set configuration as default
2902 #include <fontconfig/fontconfig.h>
2904 FcBool FcConfigSetCurrent(FcConfig *config);
2908 Sets the current default configuration to config. Implicitly
2909 calls FcConfigBuildFonts if necessary, and FcConfigReference()
2910 to inrease the reference count in config since 2.12.0,
2911 returning FcFalse if that call fails.
2917 FcConfigGetCurrent -- Return current configuration
2921 #include <fontconfig/fontconfig.h>
2923 FcConfig * FcConfigGetCurrent(void);
2927 Returns the current default configuration.
2933 FcConfigUptoDate -- Check timestamps on config files
2937 #include <fontconfig/fontconfig.h>
2939 FcBool FcConfigUptoDate(FcConfig *config);
2943 Checks all of the files related to config and returns whether
2944 any of them has been modified since the configuration was
2945 created. If config is NULL, the current configuration is used.
2951 FcConfigHome -- return the current home directory.
2955 #include <fontconfig/fontconfig.h>
2957 FcChar8 * FcConfigHome(void);
2961 Return the current user's home directory, if it is available,
2962 and if using it is enabled, and NULL otherwise. See also
2963 FcConfigEnableHome).
2969 FcConfigEnableHome -- controls use of the home directory.
2973 #include <fontconfig/fontconfig.h>
2975 FcBool FcConfigEnableHome(FcBool enable);
2979 If enable is FcTrue, then Fontconfig will use various files
2980 which are specified relative to the user's home directory
2981 (using the ~ notation in the configuration). When enable is
2982 FcFalse, then all use of the home directory in these contexts
2983 will be disabled. The previous setting of the value is
2990 FcConfigBuildFonts -- Build font database
2994 #include <fontconfig/fontconfig.h>
2996 FcBool FcConfigBuildFonts(FcConfig *config);
3000 Builds the set of available fonts for the given configuration.
3001 Note that any changes to the configuration after this call have
3002 indeterminate effects. Returns FcFalse if this operation runs
3003 out of memory. If config is NULL, the current configuration is
3006 FcConfigGetConfigDirs
3010 FcConfigGetConfigDirs -- Get config directories
3014 #include <fontconfig/fontconfig.h>
3016 FcStrList * FcConfigGetConfigDirs(FcConfig *config);
3020 Returns the list of font directories specified in the
3021 configuration files for config. Does not include any
3022 subdirectories. If config is NULL, the current configuration is
3029 FcConfigGetFontDirs -- Get font directories
3033 #include <fontconfig/fontconfig.h>
3035 FcStrList * FcConfigGetFontDirs(FcConfig *config);
3039 Returns the list of font directories in config. This includes
3040 the configured font directories along with any directories
3041 below those in the filesystem. If config is NULL, the current
3042 configuration is used.
3044 FcConfigGetConfigFiles
3048 FcConfigGetConfigFiles -- Get config files
3052 #include <fontconfig/fontconfig.h>
3054 FcStrList * FcConfigGetConfigFiles(FcConfig *config);
3058 Returns the list of known configuration files used to generate
3059 config. If config is NULL, the current configuration is used.
3065 FcConfigGetCache -- DEPRECATED used to return per-user cache
3070 #include <fontconfig/fontconfig.h>
3072 FcChar8 * FcConfigGetCache(FcConfig *config);
3076 With fontconfig no longer using per-user cache files, this
3077 function now simply returns NULL to indicate that no per-user
3080 FcConfigGetCacheDirs
3084 FcConfigGetCacheDirs -- return the list of directories searched
3089 #include <fontconfig/fontconfig.h>
3091 FcStrList * FcConfigGetCacheDirs(const FcConfig *config);
3095 FcConfigGetCacheDirs returns a string list containing all of
3096 the directories that fontconfig will search when attempting to
3097 load a cache file for a font directory. If config is NULL, the
3098 current configuration is used.
3104 FcConfigGetFonts -- Get config font set
3108 #include <fontconfig/fontconfig.h>
3110 FcFontSet * FcConfigGetFonts(FcConfig *config, FcSetName set);
3114 Returns one of the two sets of fonts from the configuration as
3115 specified by set. This font set is owned by the library and
3116 must not be modified or freed. If config is NULL, the current
3117 configuration is used.
3123 FcConfigGetBlanks -- Get config blanks
3127 #include <fontconfig/fontconfig.h>
3129 FcBlanks * FcConfigGetBlanks(FcConfig *config);
3133 Returns the FcBlanks object associated with the given
3134 configuration, if no blanks were present in the configuration,
3135 this function will return 0. The returned FcBlanks object if
3136 not NULL, is valid as long as the owning FcConfig is alive. If
3137 config is NULL, the current configuration is used.
3139 FcConfigGetRescanInterval
3143 FcConfigGetRescanInterval -- Get config rescan interval
3147 #include <fontconfig/fontconfig.h>
3149 int FcConfigGetRescanInterval(FcConfig *config);
3153 Returns the interval between automatic checks of the
3154 configuration (in seconds) specified in config. The
3155 configuration is checked during a call to FcFontList when this
3156 interval has passed since the last check. An interval setting
3157 of zero disables automatic checks. If config is NULL, the
3158 current configuration is used.
3160 FcConfigSetRescanInterval
3164 FcConfigSetRescanInterval -- Set config rescan interval
3168 #include <fontconfig/fontconfig.h>
3170 FcBool FcConfigSetRescanInterval(FcConfig *config, int
3175 Sets the rescan interval. Returns FcFalse if the interval
3176 cannot be set (due to allocation failure). Otherwise returns
3177 FcTrue. An interval setting of zero disables automatic checks.
3178 If config is NULL, the current configuration is used.
3180 FcConfigAppFontAddFile
3184 FcConfigAppFontAddFile -- Add font file to font database
3188 #include <fontconfig/fontconfig.h>
3190 FcBool FcConfigAppFontAddFile(FcConfig *config, const FcChar8
3195 Adds an application-specific font to the configuration. Returns
3196 FcFalse if the fonts cannot be added (due to allocation failure
3197 or no fonts found). Otherwise returns FcTrue. If config is
3198 NULL, the current configuration is used.
3200 FcConfigAppFontAddDir
3204 FcConfigAppFontAddDir -- Add fonts from directory to font
3209 #include <fontconfig/fontconfig.h>
3211 FcBool FcConfigAppFontAddDir(FcConfig *config, const FcChar8
3216 Scans the specified directory for fonts, adding each one found
3217 to the application-specific set of fonts. Returns FcFalse if
3218 the fonts cannot be added (due to allocation failure).
3219 Otherwise returns FcTrue. If config is NULL, the current
3220 configuration is used.
3222 FcConfigAppFontClear
3226 FcConfigAppFontClear -- Remove all app fonts from font database
3230 #include <fontconfig/fontconfig.h>
3232 void FcConfigAppFontClear(FcConfig *config);
3236 Clears the set of application-specific fonts. If config is
3237 NULL, the current configuration is used.
3239 FcConfigSubstituteWithPat
3243 FcConfigSubstituteWithPat -- Execute substitutions
3247 #include <fontconfig/fontconfig.h>
3249 FcBool FcConfigSubstituteWithPat(FcConfig *config, FcPattern
3250 *p, FcPattern *p_pat, FcMatchKind kind);
3254 Performs the sequence of pattern modification operations, if
3255 kind is FcMatchPattern, then those tagged as pattern operations
3256 are applied, else if kind is FcMatchFont, those tagged as font
3257 operations are applied and p_pat is used for <test> elements
3258 with target=pattern. Returns FcFalse if the substitution cannot
3259 be performed (due to allocation failure). Otherwise returns
3260 FcTrue. If config is NULL, the current configuration is used.
3266 FcConfigSubstitute -- Execute substitutions
3270 #include <fontconfig/fontconfig.h>
3272 FcBool FcConfigSubstitute(FcConfig *config, FcPattern *p,
3277 Calls FcConfigSubstituteWithPat setting p_pat to NULL. Returns
3278 FcFalse if the substitution cannot be performed (due to
3279 allocation failure). Otherwise returns FcTrue. If config is
3280 NULL, the current configuration is used.
3286 FcFontMatch -- Return best font
3290 #include <fontconfig/fontconfig.h>
3292 FcPattern * FcFontMatch(FcConfig *config, FcPattern *p,
3297 Finds the font in sets most closely matching pattern and
3298 returns the result of FcFontRenderPrepare for that font and the
3299 provided pattern. This function should be called only after
3300 FcConfigSubstitute and FcDefaultSubstitute have been called for
3301 p; otherwise the results will not be correct. If config is
3302 NULL, the current configuration is used.
3308 FcFontSort -- Return list of matching fonts
3312 #include <fontconfig/fontconfig.h>
3314 FcFontSet * FcFontSort(FcConfig *config, FcPattern *p, FcBool
3315 trim, FcCharSet **csp, FcResult *result);
3319 Returns the list of fonts sorted by closeness to p. If trim is
3320 FcTrue, elements in the list which don't include Unicode
3321 coverage not provided by earlier elements in the list are
3322 elided. The union of Unicode coverage of all of the fonts is
3323 returned in csp, if csp is not NULL. This function should be
3324 called only after FcConfigSubstitute and FcDefaultSubstitute
3325 have been called for p; otherwise the results will not be
3328 The returned FcFontSet references FcPattern structures which
3329 may be shared by the return value from multiple FcFontSort
3330 calls, applications must not modify these patterns. Instead,
3331 they should be passed, along with p to FcFontRenderPrepare
3332 which combines them into a complete pattern.
3334 The FcFontSet returned by FcFontSort is destroyed by calling
3335 FcFontSetDestroy. If config is NULL, the current configuration
3342 FcFontRenderPrepare -- Prepare pattern for loading font file
3346 #include <fontconfig/fontconfig.h>
3348 FcPattern * FcFontRenderPrepare(FcConfig *config, FcPattern
3349 *pat, FcPattern *font);
3353 Creates a new pattern consisting of elements of font not
3354 appearing in pat, elements of pat not appearing in font and the
3355 best matching value from pat for elements appearing in both.
3356 The result is passed to FcConfigSubstituteWithPat with kind
3357 FcMatchFont and then returned.
3363 FcFontList -- List fonts
3367 #include <fontconfig/fontconfig.h>
3369 FcFontSet * FcFontList(FcConfig *config, FcPattern *p,
3374 Selects fonts matching p, creates patterns from those fonts
3375 containing only the objects in os and returns the set of unique
3376 such patterns. If config is NULL, the default configuration is
3377 checked to be up to date, and used.
3383 FcConfigFilename -- Find a config file
3387 #include <fontconfig/fontconfig.h>
3389 FcChar8 * FcConfigFilename(const FcChar8 *name);
3393 Given the specified external entity name, return the associated
3394 filename. This provides applications a way to convert various
3395 configuration file references into filename form.
3397 A null or empty name indicates that the default configuration
3398 file should be used; which file this references can be
3399 overridden with the FONTCONFIG_FILE environment variable. Next,
3400 if the name starts with ~, it refers to a file in the current
3401 users home directory. Otherwise if the name doesn't start with
3402 '/', it refers to a file in the default configuration
3403 directory; the built-in default directory can be overridden
3404 with the FONTCONFIG_PATH environment variable.
3406 FcConfigParseAndLoad
3410 FcConfigParseAndLoad -- load a configuration file
3414 #include <fontconfig/fontconfig.h>
3416 FcBool FcConfigParseAndLoad(FcConfig *config, const FcChar8
3417 *file, FcBool complain);
3421 Walks the configuration in 'file' and constructs the internal
3422 representation in 'config'. Any include files referenced from
3423 within 'file' will be loaded and parsed. If 'complain' is
3424 FcFalse, no warning will be displayed if 'file' does not exist.
3425 Error and warning messages will be output to stderr. Returns
3426 FcFalse if some error occurred while loading the file, either a
3427 parse error, semantic error or allocation failure. Otherwise
3434 FcConfigGetSysRoot -- Obtain the system root directory
3438 #include <fontconfig/fontconfig.h>
3440 const FcChar8 * FcConfigGetSysRoot(const FcConfig *config);
3444 Obtrains the system root directory in 'config' if available.
3454 FcConfigSetSysRoot -- Set the system root directory
3458 #include <fontconfig/fontconfig.h>
3460 void FcConfigSetSysRoot(FcConfig *config, const FcChar8
3465 Set 'sysroot' as the system root directory. fontconfig prepend
3466 'sysroot' to the cache directories in order to allow people to
3467 generate caches at the build time. Note that this causes
3468 changing current config. i.e. this function calls
3469 FcConfigSetCurrent() internally.
3474 __________________________________________________________
3479 FcNameRegisterObjectTypes -- Register object types
3480 FcNameUnregisterObjectTypes -- Unregister object types
3481 FcNameGetObjectType -- Lookup an object type
3483 Provides for application-specified font name object types so
3484 that new pattern elements can be generated from font names.
3486 FcNameRegisterObjectTypes
3490 FcNameRegisterObjectTypes -- Register object types
3494 #include <fontconfig/fontconfig.h>
3496 FcBool FcNameRegisterObjectTypes(const FcObjectType *types, int
3501 Deprecated. Does nothing. Returns FcFalse.
3503 FcNameUnregisterObjectTypes
3507 FcNameUnregisterObjectTypes -- Unregister object types
3511 #include <fontconfig/fontconfig.h>
3513 FcBool FcNameUnregisterObjectTypes(const FcObjectType *types,
3518 Deprecated. Does nothing. Returns FcFalse.
3524 FcNameGetObjectType -- Lookup an object type
3528 #include <fontconfig/fontconfig.h>
3530 const FcObjectType * FcNameGetObjectType(const char *object);
3534 Return the object type for the pattern element named object.
3535 __________________________________________________________
3540 FcNameRegisterConstants -- Register symbolic constants
3541 FcNameUnregisterConstants -- Unregister symbolic constants
3542 FcNameGetConstant -- Lookup symbolic constant
3543 FcNameConstant -- Get the value for a symbolic constant
3545 Provides for application-specified symbolic constants for font
3548 FcNameRegisterConstants
3552 FcNameRegisterConstants -- Register symbolic constants
3556 #include <fontconfig/fontconfig.h>
3558 FcBool FcNameRegisterConstants(const FcConstant *consts, int
3563 Deprecated. Does nothing. Returns FcFalse.
3565 FcNameUnregisterConstants
3569 FcNameUnregisterConstants -- Unregister symbolic constants
3573 #include <fontconfig/fontconfig.h>
3575 FcBool FcNameUnregisterConstants(const FcConstant *consts, int
3580 Deprecated. Does nothing. Returns FcFalse.
3586 FcNameGetConstant -- Lookup symbolic constant
3590 #include <fontconfig/fontconfig.h>
3592 const FcConstant * FcNameGetConstant(FcChar8 *string);
3596 Return the FcConstant structure related to symbolic constant
3603 FcNameConstant -- Get the value for a symbolic constant
3607 #include <fontconfig/fontconfig.h>
3609 FcBool FcNameConstant(FcChar8 *string, int *result);
3613 Returns whether a symbolic constant with name string is
3614 registered, placing the value of the constant in result if
3616 __________________________________________________________
3621 FcWeightFromOpenType -- Convert from OpenType weight values to
3624 FcWeightToOpenType -- Convert from fontconfig weight values to
3627 Maps weights to and from OpenType weights.
3629 FcWeightFromOpenType
3633 FcWeightFromOpenType -- Convert from OpenType weight values to
3638 #include <fontconfig/fontconfig.h>
3640 int FcWeightFromOpenType(intot_weight);
3644 FcWeightFromOpenType returns an integer value to use with
3645 FC_WEIGHT, from an integer in the 1..1000 range, resembling the
3646 numbers from OpenType specification's OS/2 usWeight numbers,
3647 which are also similar to CSS font-weight numbers. If input is
3648 negative, zero, or greater than 1000, returns -1. This function
3649 linearly interpolates between various FC_WEIGHT_* constants. As
3650 such, the returned value does not necessarily match any of the
3651 predefined constants.
3661 FcWeightToOpenType -- Convert from fontconfig weight values to
3666 #include <fontconfig/fontconfig.h>
3668 int FcWeightToOpenType(intot_weight);
3672 FcWeightToOpenType is the inverse of FcWeightFromOpenType. If
3673 the input is less than FC_WEIGHT_THIN or greater than
3674 FC_WEIGHT_EXTRABLACK, returns -1. Otherwise returns a number in
3675 the range 1 to 1000.
3680 __________________________________________________________
3685 FcBlanksCreate -- Create an FcBlanks
3686 FcBlanksDestroy -- Destroy and FcBlanks
3687 FcBlanksAdd -- Add a character to an FcBlanks
3688 FcBlanksIsMember -- Query membership in an FcBlanks
3690 An FcBlanks object holds a list of Unicode chars which are
3691 expected to be blank when drawn. When scanning new fonts, any
3692 glyphs which are empty and not in this list will be assumed to
3693 be broken and not placed in the FcCharSet associated with the
3694 font. This provides a significantly more accurate CharSet for
3701 FcBlanksCreate -- Create an FcBlanks
3705 #include <fontconfig/fontconfig.h>
3707 FcBlanks * FcBlanksCreate(void);
3711 Creates an empty FcBlanks object.
3717 FcBlanksDestroy -- Destroy and FcBlanks
3721 #include <fontconfig/fontconfig.h>
3723 void FcBlanksDestroy(FcBlanks *b);
3727 Destroys an FcBlanks object, freeing any associated memory.
3733 FcBlanksAdd -- Add a character to an FcBlanks
3737 #include <fontconfig/fontconfig.h>
3739 FcBool FcBlanksAdd(FcBlanks *b, FcChar32 ucs4);
3743 Adds a single character to an FcBlanks object, returning
3744 FcFalse if this process ran out of memory.
3750 FcBlanksIsMember -- Query membership in an FcBlanks
3754 #include <fontconfig/fontconfig.h>
3756 FcBool FcBlanksIsMember(FcBlanks *b, FcChar32 ucs4);
3760 Returns whether the specified FcBlanks object contains the
3761 indicated Unicode value.
3762 __________________________________________________________
3767 FcAtomicCreate -- create an FcAtomic object
3768 FcAtomicLock -- lock a file
3769 FcAtomicNewFile -- return new temporary file name
3770 FcAtomicOrigFile -- return original file name
3771 FcAtomicReplaceOrig -- replace original with new
3772 FcAtomicDeleteNew -- delete new file
3773 FcAtomicUnlock -- unlock a file
3774 FcAtomicDestroy -- destroy an FcAtomic object
3776 These functions provide a safe way to update configuration
3777 files, allowing ongoing reading of the old configuration file
3778 while locked for writing and ensuring that a consistent and
3779 complete version of the configuration file is always available.
3785 FcAtomicCreate -- create an FcAtomic object
3789 #include <fontconfig/fontconfig.h>
3791 FcAtomic * FcAtomicCreate(const FcChar8 *file);
3795 Creates a data structure containing data needed to control
3796 access to file. Writing is done to a separate file. Once that
3797 file is complete, the original configuration file is atomically
3798 replaced so that reading process always see a consistent and
3799 complete file without the need to lock for reading.
3805 FcAtomicLock -- lock a file
3809 #include <fontconfig/fontconfig.h>
3811 FcBool FcAtomicLock(FcAtomic *atomic);
3815 Attempts to lock the file referenced by atomic. Returns FcFalse
3816 if the file is already locked, else returns FcTrue and leaves
3823 FcAtomicNewFile -- return new temporary file name
3827 #include <fontconfig/fontconfig.h>
3829 FcChar8 * FcAtomicNewFile(FcAtomic *atomic);
3833 Returns the filename for writing a new version of the file
3834 referenced by atomic.
3840 FcAtomicOrigFile -- return original file name
3844 #include <fontconfig/fontconfig.h>
3846 FcChar8 * FcAtomicOrigFile(FcAtomic *atomic);
3850 Returns the file referenced by atomic.
3856 FcAtomicReplaceOrig -- replace original with new
3860 #include <fontconfig/fontconfig.h>
3862 FcBool FcAtomicReplaceOrig(FcAtomic *atomic);
3866 Replaces the original file referenced by atomic with the new
3867 file. Returns FcFalse if the file cannot be replaced due to
3868 permission issues in the filesystem. Otherwise returns FcTrue.
3874 FcAtomicDeleteNew -- delete new file
3878 #include <fontconfig/fontconfig.h>
3880 void FcAtomicDeleteNew(FcAtomic *atomic);
3884 Deletes the new file. Used in error recovery to back out
3891 FcAtomicUnlock -- unlock a file
3895 #include <fontconfig/fontconfig.h>
3897 void FcAtomicUnlock(FcAtomic *atomic);
3907 FcAtomicDestroy -- destroy an FcAtomic object
3911 #include <fontconfig/fontconfig.h>
3913 void FcAtomicDestroy(FcAtomic *atomic);
3918 __________________________________________________________
3920 File and Directory routines
3923 FcFileScan -- scan a font file
3924 FcFileIsDir -- check whether a file is a directory
3925 FcDirScan -- scan a font directory without caching it
3926 FcDirSave -- DEPRECATED: formerly used to save a directory
3929 FcDirCacheUnlink -- Remove all caches related to dir
3930 FcDirCacheValid -- check directory cache
3931 FcDirCacheLoad -- load a directory cache
3932 FcDirCacheRescan -- Re-scan a directory cache
3933 FcDirCacheRead -- read or construct a directory cache
3934 FcDirCacheLoadFile -- load a cache file
3935 FcDirCacheUnload -- unload a cache file
3937 These routines work with font files and directories, including
3938 font directory cache files.
3944 FcFileScan -- scan a font file
3948 #include <fontconfig/fontconfig.h>
3950 FcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
3951 *cache, FcBlanks *blanks, const FcChar8 *file, FcBool force);
3955 Scans a single file and adds all fonts found to set. If force
3956 is FcTrue, then the file is scanned even if associated
3957 information is found in cache. If file is a directory, it is
3958 added to dirs. Whether fonts are found depends on fontconfig
3959 policy as well as the current configuration. Internally,
3960 fontconfig will ignore BDF and PCF fonts which are not in
3961 Unicode (or the effectively equivalent ISO Latin-1) encoding as
3962 those are not usable by Unicode-based applications. The
3963 configuration can ignore fonts based on filename or contents of
3964 the font file itself. Returns FcFalse if any of the fonts
3965 cannot be added (due to allocation failure). Otherwise returns
3972 FcFileIsDir -- check whether a file is a directory
3976 #include <fontconfig/fontconfig.h>
3978 FcBool FcFileIsDir(const FcChar8 *file);
3982 Returns FcTrue if file is a directory, otherwise returns
3989 FcDirScan -- scan a font directory without caching it
3993 #include <fontconfig/fontconfig.h>
3995 FcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
3996 *cache, FcBlanks *blanks, const FcChar8 *dir, FcBool force);
4000 If cache is not zero or if force is FcFalse, this function
4001 currently returns FcFalse. Otherwise, it scans an entire
4002 directory and adds all fonts found to set. Any subdirectories
4003 found are added to dirs. Calling this function does not create
4004 any cache files. Use FcDirCacheRead() if caching is desired.
4010 FcDirSave -- DEPRECATED: formerly used to save a directory
4015 #include <fontconfig/fontconfig.h>
4017 FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8
4022 This function now does nothing aside from returning FcFalse. It
4023 used to creates the per-directory cache file for dir and
4024 populates it with the fonts in set and subdirectories in dirs.
4025 All of this functionality is now automatically managed by
4026 FcDirCacheLoad and FcDirCacheRead.
4032 FcDirCacheUnlink -- Remove all caches related to dir
4036 #include <fontconfig/fontconfig.h>
4038 FcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config);
4042 Scans the cache directories in config, removing any instances
4043 of the cache file for dir. Returns FcFalse when some internal
4044 error occurs (out of memory, etc). Errors actually unlinking
4045 any files are ignored.
4051 FcDirCacheValid -- check directory cache
4055 #include <fontconfig/fontconfig.h>
4057 FcBool FcDirCacheValid(const FcChar8 *dir);
4061 Returns FcTrue if dir has an associated valid cache file, else
4068 FcDirCacheLoad -- load a directory cache
4072 #include <fontconfig/fontconfig.h>
4074 FcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config,
4075 FcChar8 **cache_file);
4079 Loads the cache related to dir. If no cache file exists,
4080 returns NULL. The name of the cache file is returned in
4081 cache_file, unless that is NULL. See also FcDirCacheRead.
4087 FcDirCacheRescan -- Re-scan a directory cache
4091 #include <fontconfig/fontconfig.h>
4093 FcCache * FcDirCacheRescan(const FcChar8 *dir, FcConfig
4098 Re-scan directories only at dir and update the cache. returns
4109 FcDirCacheRead -- read or construct a directory cache
4113 #include <fontconfig/fontconfig.h>
4115 FcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force,
4120 This returns a cache for dir. If force is FcFalse, then an
4121 existing, valid cache file will be used. Otherwise, a new cache
4122 will be created by scanning the directory and that returned.
4128 FcDirCacheLoadFile -- load a cache file
4132 #include <fontconfig/fontconfig.h>
4134 FcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct
4139 This function loads a directory cache from cache_file. If
4140 file_stat is non-NULL, it will be filled with the results of
4141 stat(2) on the cache file.
4147 FcDirCacheUnload -- unload a cache file
4151 #include <fontconfig/fontconfig.h>
4153 void FcDirCacheUnload(FcCache *cache);
4157 This function dereferences cache. When no other references to
4158 it remain, all memory associated with the cache will be freed.
4159 __________________________________________________________
4164 FcCacheDir -- Return directory of cache
4165 FcCacheCopySet -- Returns a copy of the fontset from cache
4166 FcCacheSubdir -- Return the i'th subdirectory.
4167 FcCacheNumSubdir -- Return the number of subdirectories in
4170 FcCacheNumFont -- Returns the number of fonts in cache.
4171 FcDirCacheClean -- This tries to clean up the cache directory
4172 of cache_dir. This returns FcTrue if the operation is
4173 successfully complete. otherwise FcFalse.
4175 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory.
4177 These routines work with font directory caches, accessing their
4178 contents in limited ways. It is not expected that normal
4179 applications will need to use these functions.
4185 FcCacheDir -- Return directory of cache
4189 #include <fontconfig/fontconfig.h>
4191 const FcChar8 * FcCacheDir(const FcCache *cache);
4195 This function returns the directory from which the cache was
4202 FcCacheCopySet -- Returns a copy of the fontset from cache
4206 #include <fontconfig/fontconfig.h>
4208 FcFontSet * FcCacheCopySet(const FcCache *cache);
4212 The returned fontset contains each of the font patterns from
4213 cache. This fontset may be modified, but the patterns from the
4214 cache are read-only.
4220 FcCacheSubdir -- Return the i'th subdirectory.
4224 #include <fontconfig/fontconfig.h>
4226 const FcChar8 * FcCacheSubdir(const FcCache *cache, inti);
4230 The set of subdirectories stored in a cache file are indexed by
4231 this function, i should range from 0 to n-1, where n is the
4232 return value from FcCacheNumSubdir.
4238 FcCacheNumSubdir -- Return the number of subdirectories in
4243 #include <fontconfig/fontconfig.h>
4245 int FcCacheNumSubdir(const FcCache *cache);
4249 This returns the total number of subdirectories in the cache.
4255 FcCacheNumFont -- Returns the number of fonts in cache.
4259 #include <fontconfig/fontconfig.h>
4261 int FcCacheNumFont(const FcCache *cache);
4265 This returns the number of fonts which would be included in the
4266 return from FcCacheCopySet.
4272 FcDirCacheClean -- This tries to clean up the cache directory
4273 of cache_dir. This returns FcTrue if the operation is
4274 successfully complete. otherwise FcFalse.
4278 #include <fontconfig/fontconfig.h>
4280 FcBool FcDirCacheClean(const FcChar8 *cache_dir,
4289 FcCacheCreateTagFile
4293 FcCacheCreateTagFile -- Create CACHEDIR.TAG at cache directory.
4297 #include <fontconfig/fontconfig.h>
4299 void FcCacheCreateTagFile(const FcConfig *config);
4303 This tries to create CACHEDIR.TAG file at the cache directory
4304 registered to config.
4309 __________________________________________________________
4311 FcStrSet and FcStrList
4314 FcStrSetCreate -- create a string set
4315 FcStrSetMember -- check set for membership
4316 FcStrSetEqual -- check sets for equality
4317 FcStrSetAdd -- add to a string set
4318 FcStrSetAddFilename -- add a filename to a string set
4319 FcStrSetDel -- delete from a string set
4320 FcStrSetDestroy -- destroy a string set
4321 FcStrListCreate -- create a string iterator
4322 FcStrListFirst -- get first string in iteration
4323 FcStrListNext -- get next string in iteration
4324 FcStrListDone -- destroy a string iterator
4326 A data structure for enumerating strings, used to list
4327 directories while scanning the configuration as directories are
4328 added while scanning.
4334 FcStrSetCreate -- create a string set
4338 #include <fontconfig/fontconfig.h>
4340 FcStrSet * FcStrSetCreate(void);
4344 Create an empty set.
4350 FcStrSetMember -- check set for membership
4354 #include <fontconfig/fontconfig.h>
4356 FcBool FcStrSetMember(FcStrSet *set, const FcChar8 *s);
4360 Returns whether s is a member of set.
4366 FcStrSetEqual -- check sets for equality
4370 #include <fontconfig/fontconfig.h>
4372 FcBool FcStrSetEqual(FcStrSet *set_a, FcStrSet *set_b);
4376 Returns whether set_a contains precisely the same strings as
4377 set_b. Ordering of strings within the two sets is not
4384 FcStrSetAdd -- add to a string set
4388 #include <fontconfig/fontconfig.h>
4390 FcBool FcStrSetAdd(FcStrSet *set, const FcChar8 *s);
4394 Adds a copy of s to set.
4400 FcStrSetAddFilename -- add a filename to a string set
4404 #include <fontconfig/fontconfig.h>
4406 FcBool FcStrSetAddFilename(FcStrSet *set, const FcChar8 *s);
4410 Adds a copy s to set, The copy is created with
4411 FcStrCopyFilename so that leading '~' values are replaced with
4412 the value of the HOME environment variable.
4418 FcStrSetDel -- delete from a string set
4422 #include <fontconfig/fontconfig.h>
4424 FcBool FcStrSetDel(FcStrSet *set, const FcChar8 *s);
4428 Removes s from set, returning FcTrue if s was a member else
4435 FcStrSetDestroy -- destroy a string set
4439 #include <fontconfig/fontconfig.h>
4441 void FcStrSetDestroy(FcStrSet *set);
4451 FcStrListCreate -- create a string iterator
4455 #include <fontconfig/fontconfig.h>
4457 FcStrList * FcStrListCreate(FcStrSet *set);
4461 Creates an iterator to list the strings in set.
4467 FcStrListFirst -- get first string in iteration
4471 #include <fontconfig/fontconfig.h>
4473 void FcStrListFirst(FcStrList *list);
4477 Returns the first string in list.
4487 FcStrListNext -- get next string in iteration
4491 #include <fontconfig/fontconfig.h>
4493 FcChar8 * FcStrListNext(FcStrList *list);
4497 Returns the next string in list.
4503 FcStrListDone -- destroy a string iterator
4507 #include <fontconfig/fontconfig.h>
4509 void FcStrListDone(FcStrList *list);
4513 Destroys the enumerator list.
4514 __________________________________________________________
4519 FcUtf8ToUcs4 -- convert UTF-8 to UCS4
4520 FcUcs4ToUtf8 -- convert UCS4 to UTF-8
4521 FcUtf8Len -- count UTF-8 encoded chars
4522 FcUtf16ToUcs4 -- convert UTF-16 to UCS4
4523 FcUtf16Len -- count UTF-16 encoded chars
4524 FcIsLower -- check for lower case ASCII character
4525 FcIsUpper -- check for upper case ASCII character
4526 FcToLower -- convert upper case ASCII to lower case
4527 FcStrCopy -- duplicate a string
4528 FcStrDowncase -- create a lower case translation of a string
4529 FcStrCopyFilename -- create a complete path from a filename
4530 FcStrCmp -- compare UTF-8 strings
4531 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case
4532 FcStrStr -- locate UTF-8 substring
4533 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII
4536 FcStrPlus -- concatenate two strings
4537 FcStrFree -- free a string
4538 FcStrDirname -- directory part of filename
4539 FcStrBasename -- last component of filename
4541 Fontconfig manipulates many UTF-8 strings represented with the
4542 FcChar8 type. These functions are exposed to help applications
4543 deal with these UTF-8 strings in a locale-insensitive manner.
4549 FcUtf8ToUcs4 -- convert UTF-8 to UCS4
4553 #include <fontconfig/fontconfig.h>
4555 int FcUtf8ToUcs4(FcChar8 *src, FcChar32 *dst, int len);
4559 Converts the next Unicode char from src into dst and returns
4560 the number of bytes containing the char. src must be at least
4567 FcUcs4ToUtf8 -- convert UCS4 to UTF-8
4571 #include <fontconfig/fontconfig.h>
4573 int FcUcs4ToUtf8(FcChar32 src, FcChar8 dst[FC_UTF8_MAX_LEN]);
4577 Converts the Unicode char from src into dst and returns the
4578 number of bytes needed to encode the char.
4584 FcUtf8Len -- count UTF-8 encoded chars
4588 #include <fontconfig/fontconfig.h>
4590 FcBool FcUtf8Len(FcChar8 *src, int len, int *nchar, int
4595 Counts the number of Unicode chars in len bytes of src. Places
4596 that count in nchar. wchar contains 1, 2 or 4 depending on the
4597 number of bytes needed to hold the largest Unicode char
4598 counted. The return value indicates whether src is a
4599 well-formed UTF8 string.
4605 FcUtf16ToUcs4 -- convert UTF-16 to UCS4
4609 #include <fontconfig/fontconfig.h>
4611 int FcUtf16ToUcs4(FcChar8 *src, FcEndian endian, FcChar32 *dst,
4616 Converts the next Unicode char from src into dst and returns
4617 the number of bytes containing the char. src must be at least
4618 len bytes long. Bytes of src are combined into 16-bit units
4619 according to endian.
4625 FcUtf16Len -- count UTF-16 encoded chars
4629 #include <fontconfig/fontconfig.h>
4631 FcBool FcUtf16Len(FcChar8 *src, FcEndian endian, int len, int
4632 *nchar, int *wchar);
4636 Counts the number of Unicode chars in len bytes of src. Bytes
4637 of src are combined into 16-bit units according to endian.
4638 Places that count in nchar. wchar contains 1, 2 or 4 depending
4639 on the number of bytes needed to hold the largest Unicode char
4640 counted. The return value indicates whether string is a
4641 well-formed UTF16 string.
4647 FcIsLower -- check for lower case ASCII character
4651 #include <fontconfig/fontconfig.h>
4653 FcBool FcIsLower(FcChar8c);
4657 This macro checks whether c is an lower case ASCII letter.
4663 FcIsUpper -- check for upper case ASCII character
4667 #include <fontconfig/fontconfig.h>
4669 FcBool FcIsUpper(FcChar8c);
4673 This macro checks whether c is a upper case ASCII letter.
4679 FcToLower -- convert upper case ASCII to lower case
4683 #include <fontconfig/fontconfig.h>
4685 FcChar8 FcToLower(FcChar8c);
4689 This macro converts upper case ASCII c to the equivalent lower
4696 FcStrCopy -- duplicate a string
4700 #include <fontconfig/fontconfig.h>
4702 FcChar8 * FcStrCopy(const FcChar8 *s);
4706 Allocates memory, copies s and returns the resulting buffer.
4707 Yes, this is strdup, but that function isn't available on every
4714 FcStrDowncase -- create a lower case translation of a string
4718 #include <fontconfig/fontconfig.h>
4720 FcChar8 * FcStrDowncase(const FcChar8 *s);
4724 Allocates memory, copies s, converting upper case letters to
4725 lower case and returns the allocated buffer.
4731 FcStrCopyFilename -- create a complete path from a filename
4735 #include <fontconfig/fontconfig.h>
4737 FcChar8 * FcStrCopyFilename(const FcChar8 *s);
4741 FcStrCopyFilename constructs an absolute pathname from s. It
4742 converts any leading '~' characters in to the value of the HOME
4743 environment variable, and any relative paths are converted to
4744 absolute paths using the current working directory. Sequences
4745 of '/' characters are converted to a single '/', and names
4746 containing the current directory '.' or parent directory '..'
4747 are correctly reconstructed. Returns NULL if '~' is the leading
4748 character and HOME is unset or disabled (see
4749 FcConfigEnableHome).
4755 FcStrCmp -- compare UTF-8 strings
4759 #include <fontconfig/fontconfig.h>
4761 int FcStrCmp(const FcChar8 *s1, const FcChar8 *s2);
4765 Returns the usual <0, 0, >0 result of comparing s1 and s2.
4771 FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring case
4775 #include <fontconfig/fontconfig.h>
4777 int FcStrCmpIgnoreCase(const FcChar8 *s1, const FcChar8 *s2);
4781 Returns the usual <0, 0, >0 result of comparing s1 and s2. This
4782 test is case-insensitive for all proper UTF-8 encoded strings.
4788 FcStrStr -- locate UTF-8 substring
4792 #include <fontconfig/fontconfig.h>
4794 FcChar8 * FcStrStr(const FcChar8 *s1, const FcChar8 *s2);
4798 Returns the location of s2 in s1. Returns NULL if s2 is not
4799 present in s1. This test will operate properly with UTF8
4806 FcStrStrIgnoreCase -- locate UTF-8 substring ignoring ASCII
4811 #include <fontconfig/fontconfig.h>
4813 FcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8
4818 Returns the location of s2 in s1, ignoring case. Returns NULL
4819 if s2 is not present in s1. This test is case-insensitive for
4820 all proper UTF-8 encoded strings.
4826 FcStrPlus -- concatenate two strings
4830 #include <fontconfig/fontconfig.h>
4832 FcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2);
4836 This function allocates new storage and places the
4837 concatenation of s1 and s2 there, returning the new string.
4843 FcStrFree -- free a string
4847 #include <fontconfig/fontconfig.h>
4849 void FcStrFree(FcChar8 *s);
4853 This is just a wrapper around free(3) which helps track memory
4854 usage of strings within the fontconfig library.
4860 FcStrDirname -- directory part of filename
4864 #include <fontconfig/fontconfig.h>
4866 FcChar8 * FcStrDirname(const FcChar8 *file);
4870 Returns the directory containing file. This is returned in
4871 newly allocated storage which should be freed when no longer
4878 FcStrBasename -- last component of filename
4882 #include <fontconfig/fontconfig.h>
4884 FcChar8 * FcStrBasename(const FcChar8 *file);
4888 Returns the filename of file stripped of any leading directory
4889 names. This is returned in newly allocated storage which should
4890 be freed when no longer needed.