141
179
FcMatrixScale -- Scale a matrix
142
180
FcMatrixShear -- Shear a matrix
146
184
FcConfigCreate -- Create a configuration
147
185
FcConfigDestroy -- Destroy a configuration
148
186
FcConfigSetCurrent -- Set configuration as default
149
187
FcConfigGetCurrent -- Return current configuration
150
FcConfigUptoDate -- Check timestamps on config
188
FcConfigUptoDate -- Check timestamps on config files
189
FcConfigHome -- return the current home directory.
190
FcConfigEnableHome -- controls use of the home
153
193
FcConfigBuildFonts -- Build font database
154
194
FcConfigGetConfigDirs -- Get config directories
155
195
FcConfigGetFontDirs -- Get font directories
156
196
FcConfigGetConfigFiles -- Get config files
157
FcConfigGetCache -- Get cache filename
197
FcConfigGetCache -- DEPRECATED used to return
198
per-user cache filename
200
FcConfigGetCacheDirs -- return the list of
201
directories searched for cache files
158
203
FcConfigGetFonts -- Get config font set
159
204
FcConfigGetBlanks -- Get config blanks
160
FcConfigGetRescanInverval -- Get config rescan
205
FcConfigGetRescanInterval -- Get config rescan
163
FcConfigSetRescanInverval -- Set config rescan
208
FcConfigSetRescanInterval -- Set config rescan
166
211
FcConfigAppFontAddFile -- Add font file to font
169
FcConfigAppFontAddDir -- Add fonts from directory
214
FcConfigAppFontAddDir -- Add fonts from directory to
172
217
FcConfigAppFontClear -- Remove all app fonts from
221
266
FcAtomicUnlock -- unlock a file
222
267
FcAtomicDestroy -- destroy an FcAtomic object
224
4.14. File and Directory routines
269
4.15. File and Directory routines
226
271
FcFileScan -- scan a font file
227
FcDirScan -- scan a font directory
228
FcDirSave -- save a directory cache
229
FcDirCacheValid -- check directory cache timestamp
231
4.15. FcStrSet and FcStrList
272
FcFileIsDir -- check whether a file is a directory
273
FcDirScan -- DEPRECATED: formerly used to scan a
276
FcDirSave -- DEPRECATED: formerly used to save a
279
FcDirCacheUnlink -- Remove all caches related to dir
280
FcDirCacheValid -- check directory cache
281
FcDirCacheLoad -- load a directory cache
282
FcDirCacheRead -- read or construct a directory
285
FcDirCacheLoadFile -- load a cache file
286
FcDirCacheUnload -- unload a cache file
288
4.16. FcCache routines
290
FcCacheDir -- Return directory of cache
291
FcCacheCopySet -- Returns a copy of the fontset from
294
FcCacheSubdir -- Return the i'th subdirectory.
295
FcCacheNumSubdir -- Return the number of
296
subdirectories in cache.
298
FcCacheNumFont -- Returns the number of fonts in
301
4.17. FcStrSet and FcStrList
233
303
FcStrSetCreate -- create a string set
234
304
FcStrSetMember -- check set for membership
305
FcStrSetEqual -- check sets for equality
235
306
FcStrSetAdd -- add to a string set
236
307
FcStrSetAddFilename -- add a filename to a string
242
313
FcStrListNext -- get next string in iteration
243
314
FcStrListDone -- destroy a string iterator
245
4.16. String utilities
316
4.18. String utilities
247
318
FcUtf8ToUcs4 -- convert UTF-8 to UCS4
248
319
FcUcs4ToUtf8 -- convert UCS4 to UTF-8
249
320
FcUtf8Len -- count UTF-8 encoded chars
250
321
FcUtf16ToUcs4 -- convert UTF-16 to UCS4
251
322
FcUtf16Len -- count UTF-16 encoded chars
323
FcIsLower -- check for lower case ASCII character
324
FcIsUpper -- check for upper case ASCII character
325
FcToLower -- convert upper case ASCII to lower case
252
326
FcStrCopy -- duplicate a string
253
327
FcStrDowncase -- create a lower case translation of
256
FcStrCopyFilename -- copy a string, expanding '~'
257
FcStrCmpIgnoreCase -- compare UTF-8 strings
330
FcStrCopyFilename -- create a complete path from a
333
FcStrCmp -- compare UTF-8 strings
334
FcStrCmpIgnoreCase -- compare UTF-8 strings ignoring
260
337
FcStrStr -- locate UTF-8 substring
261
338
FcStrStrIgnoreCase -- locate UTF-8 substring
262
339
ignoring ASCII case
264
FcStrDirname -- directory part of filename
341
FcStrPlus -- concatenate two strings
342
FcStrFree -- free a string
265
343
FcStrBasename -- last component of filename
269
347
Fontconfig is a library designed to provide system-wide font
270
348
configuration, customization and application access.
271
_________________________________________________________
349
__________________________________________________________
273
351
2. FUNCTIONAL OVERVIEW
275
353
Fontconfig contains two essential modules, the configuration
276
354
module which builds an internal configuration from XML files
277
and the matching module which accepts font patterns and
278
returns the nearest matching font.
279
_________________________________________________________
355
and the matching module which accepts font patterns and returns
356
the nearest matching font.
357
__________________________________________________________
281
359
2.1. FONT CONFIGURATION
293
371
and shared by as many applications as possible. It is hoped
294
372
that this will lead to more stable font selection when passing
295
373
names from one application to another. XML was chosen as a
296
configuration file format because it provides a format which
297
is easy for external agents to edit while retaining the
298
correct structure and syntax.
374
configuration file format because it provides a format which is
375
easy for external agents to edit while retaining the correct
376
structure and syntax.
300
Font configuration is separate from font matching;
301
applications needing to do their own matching can access the
302
available fonts from the library and perform private matching.
303
The intent is to permit applications to pick and choose
304
appropriate functionality from the library instead of forcing
305
them to choose between this library and a private
306
configuration mechanism. The hope is that this will ensure
307
that configuration of fonts for all applications can be
308
centralized in one place. Centralizing font configuration will
309
simplify and regularize font installation and customization.
310
_________________________________________________________
378
Font configuration is separate from font matching; applications
379
needing to do their own matching can access the available fonts
380
from the library and perform private matching. The intent is to
381
permit applications to pick and choose appropriate
382
functionality from the library instead of forcing them to
383
choose between this library and a private configuration
384
mechanism. The hope is that this will ensure that configuration
385
of fonts for all applications can be centralized in one place.
386
Centralizing font configuration will simplify and regularize
387
font installation and customization.
388
__________________________________________________________
312
390
2.2. FONT PROPERTIES
321
399
Property CPP Symbol Type Description
322
400
----------------------------------------------------
323
401
family FC_FAMILY String Font family names
324
familylang FC_FAMILYLANG String Language cooresponding
402
familylang FC_FAMILYLANG String Language cooresponding t
327
style FC_STYLE String Font style. Overrides w
405
style FC_STYLE String Font style. Overrides we
330
stylelang FC_STYLELANG String Language cooresponding
408
stylelang FC_STYLELANG String Language cooresponding t
333
fullname FC_FULLNAME String Font face full name whe
335
different from family a
411
fullname FC_FULLNAME String Font face full name wher
413
different from family an
338
fullnamelang FC_FULLNAMELANG String Language cooresponding
416
fullnamelang FC_FULLNAMELANG String Language cooresponding t
341
slant FC_SLANT Int Italic, oblique or roma
343
weight FC_WEIGHT Int Light, medium, demibold
419
slant FC_SLANT Int Italic, oblique or roman
420
weight FC_WEIGHT Int Light, medium, demibold,
346
422
size FC_SIZE Double Point size
347
width FC_WIDTH Int Condensed, normal or ex
349
aspect FC_ASPECT Double Stretches glyphs horizo
423
width FC_WIDTH Int Condensed, normal or exp
425
aspect FC_ASPECT Double Stretches glyphs horizon
352
428
pixelsize FC_PIXEL_SIZE Double Pixel size
353
spacing FC_SPACING Int Proportional, dual-widt
429
spacing FC_SPACING Int Proportional, dual-width
355
431
monospace or charcell
356
432
foundry FC_FOUNDRY String Font foundry name
357
433
antialias FC_ANTIALIAS Bool Whether glyphs can be
359
hinting FC_HINTING Bool Whether the rasterizer
435
hinting FC_HINTING Bool Whether the rasterizer s
362
438
hintstyle FC_HINT_STYLE Int Automatic hinting style
363
439
verticallayout FC_VERTICAL_LAYOUT Bool Use vertical layout
364
autohint FC_AUTOHINT Bool Use autohinter instead
440
autohint FC_AUTOHINT Bool Use autohinter instead o
367
443
globaladvance FC_GLOBAL_ADVANCE Bool Use font global advance
369
file FC_FILE String The filename holding th
371
index FC_INDEX Int The index of the font w
445
file FC_FILE String The filename holding the
447
index FC_INDEX Int The index of the font wi
374
ftface FC_FT_FACE FT_Face Use the specified FreeT
450
ftface FC_FT_FACE FT_Face Use the specified FreeTy
377
rasterizer FC_RASTERIZER String Which rasterizer is in
379
outline FC_OUTLINE Bool Whether the glyphs are
381
scalable FC_SCALABLE Bool Whether glyphs can be s
383
scale FC_SCALE Double Scale factor for point-
453
rasterizer FC_RASTERIZER String Which rasterizer is in u
455
outline FC_OUTLINE Bool Whether the glyphs are o
457
scalable FC_SCALABLE Bool Whether glyphs can be sc
459
scale FC_SCALE Double Scale factor for point->
386
462
dpi FC_DPI Double Target dots per inch
387
rgba FC_RGBA Int unknown, rgb, bgr, vrgb
389
vbgr, none - subpixel g
391
minspace FC_MINSPACE Bool Eliminate leading from
463
rgba FC_RGBA Int unknown, rgb, bgr, vrgb,
464
vbgr, none - subpixel ge
466
minspace FC_MINSPACE Bool Eliminate leading from l
394
charset FC_CHARSET CharSet Unicode chars encoded b
469
charset FC_CHARSET CharSet Unicode chars encoded by
397
lang FC_LANG String List of RFC-3066-style
398
languages this font sup
400
fontversion FC_FONTVERSION Int Version number of the f
402
capability FC_CAPABILITY String List of layout capabili
471
lang FC_LANG LangSet Set of RFC-3066-style
472
languages this font supp
474
fontversion FC_FONTVERSION Int Version number of the fo
476
capability FC_CAPABILITY String List of layout capabilit
405
479
embolden FC_EMBOLDEN Bool Rasterizer should
406
synthetically embolden
409
_________________________________________________________
480
synthetically embolden t
482
__________________________________________________________
413
486
Fontconfig uses abstract datatypes to hide internal
414
487
implementation details for most data structures. A few
415
488
structures are exposed where appropriate.
416
_________________________________________________________
489
__________________________________________________________
418
491
3.1. FcChar8, FcChar16, FcChar32, FcBool
420
These are primitive datatypes; the FcChar* types hold
421
precisely the number of bits stated (if supported by the C
493
These are primitive datatypes; the FcChar* types hold precisely
494
the number of bits stated (if supported by the C
422
495
implementation). FcBool holds one of two CPP symbols: FcFalse
424
_________________________________________________________
497
__________________________________________________________
431
504
typedef struct _FcMatrix {
432
505
double xx, xy, yx, yy;
435
_________________________________________________________
507
__________________________________________________________
439
511
An FcCharSet is an abstract type that holds the set of encoded
440
512
unicode chars in a font. Operations to build and compare these
441
513
sets are provided.
442
_________________________________________________________
514
__________________________________________________________
518
An FcLangSet is an abstract type that holds the set of
519
languages supported by a font. Operations to build and compare
520
these sets are provided. These are computed for a font based on
521
orthographic information built into the fontconfig library.
522
Fontconfig has orthographies for all of the ISO 639-1 languages
523
except for MS, NA, PA, PS, QU, RN, RW, SD, SG, SN, SU and ZA.
524
If you have orthographic information for any of these
525
languages, please submit them.
526
__________________________________________________________
530
An FcLangResult is an enumeration used to return the results of
531
comparing two language strings or FcLangSet objects.
532
FcLangEqual means the objects match language and territory.
533
FcLangDifferentTerritory means the objects match in language
534
but differ in territory. FcLangDifferentLang means the objects
536
__________________________________________________________
446
540
Tags the kind of data stored in an FcValue.
447
_________________________________________________________
541
__________________________________________________________
451
545
An FcValue object holds a single value with one of a number of
452
546
different types. The 'type' tag indicates which member is
553
646
Provides for symbolic constants for new pattern elements. When
554
647
'name' is seen in a font name, an 'object' element is created
555
648
with value 'value'.
556
_________________________________________________________
649
__________________________________________________________
560
653
holds a list of Unicode chars which are expected to be blank;
561
654
unexpectedly blank chars are assumed to be invalid and are
562
655
elided from the charset associated with the font.
563
_________________________________________________________
656
__________________________________________________________
567
660
holds the per-user cache information for use while loading the
568
661
font database. This is built automatically for the current
569
662
configuration when that is loaded. Applications must always
570
663
pass '0' when one is requested.
571
_________________________________________________________
664
__________________________________________________________
575
668
holds a complete configuration of the library; there is one
576
669
default configuration, other can be constructed from XML data
577
670
structures. All public entry points that need global data can
578
take an optional FcConfig* argument; passing 0 uses the
579
default configuration. FcConfig objects hold two sets of
580
fonts, the first contains those specified by the
581
configuration, the second set holds those added by the
582
application at run-time. Interfaces that need to reference a
583
particulat set use one of the FcSetName enumerated values.
584
_________________________________________________________
671
take an optional FcConfig* argument; passing 0 uses the default
672
configuration. FcConfig objects hold two sets of fonts, the
673
first contains those specified by the configuration, the second
674
set holds those added by the application at run-time.
675
Interfaces that need to reference a particulat set use one of
676
the FcSetName enumerated values.
677
__________________________________________________________
588
681
Specifies one of the two sets of fonts available in a
589
682
configuration; FcSetSystem for those fonts specified in the
590
683
configuration and FcSetApplication which holds fonts provided
591
684
by the application.
592
_________________________________________________________
685
__________________________________________________________
596
689
Used as a return type for functions manipulating FcPattern
600
693
-----------------------------------------------------------
601
694
FcResultMatch Object exists with the specified ID
602
695
FcResultNoMatch Object doesn't exist at all
603
FcResultTypeMismatch Object exists, but the type doesn't mat
696
FcResultTypeMismatch Object exists, but the type doesn't matc
605
698
FcResultNoId Object exists, but has fewer values
607
700
FcResultOutOfMemory Malloc failed
609
_________________________________________________________
613
Used for locking access to config files. Provides a safe way
614
to update configuration files.
615
_________________________________________________________
701
__________________________________________________________
705
Used for locking access to config files. Provides a safe way to
706
update configuration files.
707
__________________________________________________________
711
Holds information about the fonts contained in a single
712
directory. Normal applications need not worry about this as
713
caches for font access are automatically managed by the
714
library. Applications dealing with cache management may want to
715
use some of these objects in their work, however the included
716
'fc-cache' program generally suffices for all of that.
717
__________________________________________________________
619
721
These are grouped by functionality, often using the main
620
722
datatype being manipulated.
621
_________________________________________________________
723
__________________________________________________________
623
725
4.1. Initialization
1098
1263
FcPattern * FcPatternVaBuild(FcPattern *orig, va_list va);
1265
void FcPatternVapBuild(FcPattern *result, FcPattern *orig,
1102
1270
Builds a pattern using a list of objects, types and values.
1103
Each value to be entered in the pattern is specified with
1271
Each value to be entered in the pattern is specified with three
1106
1274
1. Object name, a string describing the property to be added.
1107
1275
2. Object type, one of the FcType enumerated values
1108
3. Value, not an FcValue, but the raw type as passed to any
1109
of the FcPatternAdd<type> functions. Must match the type
1110
of the second argument.
1276
3. Value, not an FcValue, but the raw type as passed to any of
1277
the FcPatternAdd<type> functions. Must match the type of
1278
the second argument.
1112
1280
The argument list is terminated by a null object name, no
1113
1281
object type nor value need be passed for this. The values are
1114
1282
added to `pattern', if `pattern' is null, a new pattern is
1115
1283
created. In either case, the pattern is returned. Example
1116
1284
pattern = FcPatternBuild (0, FC_FAMILY, FcTypeString, "Times", (char *)
1119
1287
FcPatternVaBuild is used when the arguments are already in the
1120
form of a varargs value.
1288
form of a varargs value. FcPatternVapBuild is a macro version
1289
of FcPatternVaBuild which returns its result directly in the
1124
Fontconfig version 2.4.2
1294
Fontconfig version 2.5.0
1333
1508
Adds a pattern to a font set. Note that the pattern is not
1334
copied before being inserted into the set.
1338
Fontconfig version 2.4.2
1339
_________________________________________________________
1509
copied before being inserted into the set. Returns FcFalse if
1510
the pattern cannot be inserted into the set (due to allocation
1511
failure). Otherwise returns FcTrue.
1515
Fontconfig version 2.5.0
1521
FcFontSetList -- List fonts from a set of font sets
1525
#include <fontconfig.h>
1527
FcFontSet * FcFontSetList(FcConfig *config, FcFontSet **sets,
1528
intnsets, FcPattern *pattern, FcObjectSet *object_set);
1532
Selects fonts matching pattern from sets, creates patterns from
1533
those fonts containing only the objects in object_set and
1534
returns the set of unique such patterns.
1538
Fontconfig version 2.5.0
1544
FcFontSetMatch -- Return the best font from a set of font sets
1548
#include <fontconfig.h>
1550
FcPattern * FcFontSetMatch(FcConfig *config, FcFontSet **sets,
1551
intnsets, FcPattern *pattern, FcResult *result);
1555
Finds the font in sets most closely matching pattern and
1556
returns the result of FcFontRenderPrepare for that font and the
1557
provided pattern. This function should be called only after
1558
FcConfigSubstitute and FcDefaultSubstitute have been called for
1559
pattern; otherwise the results will not be correct. Returns
1560
NULL if an error occurs during this process.
1564
Fontconfig version 2.5.0
1570
FcFontSetPrint -- Print a set of patterns to stdout
1574
#include <fontconfig.h>
1576
void FcFontSetPrint(FcFontSet *set);
1580
This function is useful for diagnosing font related issues,
1581
printing the complete contents of every pattern in set. The
1582
format of the output is designed to be of help to users and
1583
developers, and may change at any time.
1587
Fontconfig version 2.5.0
1593
FcFontSetSort -- Add to a font set
1597
#include <fontconfig.h>
1599
FcFontSetSort(FcConfig *config, FcFontSet **sets, intnsets,
1600
FcPattern *pattern, FcBool trim, FcCharSet **csp, FcResult
1605
Returns the list of fonts from sets sorted by closeness to
1606
pattern. If trim is FcTrue, elements in the list which don't
1607
include Unicode coverage not provided by earlier elements in
1608
the list are elided. The union of Unicode coverage of all of
1609
the fonts is returned in csp, if csp is not NULL. This function
1610
should be called only after FcConfigSubstitute and
1611
FcDefaultSubstitute have been called for p; otherwise the
1612
results will not be correct.
1614
The returned FcFontSet references FcPattern structures which
1615
may be shared by the return value from multiple FcFontSort
1616
calls, applications cannot modify these patterns. Instead, they
1617
should be passed, along with pattern to FcFontRenderPrepare
1618
which combines them into a complete pattern.
1620
The FcFontSet returned by FcFontSetSort is destroyed by caling
1625
Fontconfig version 2.5.0
1627
FcFontSetSortDestroy
1631
FcFontSetSortDestroy -- DEPRECATED destroy a font set
1635
#include <fontconfig.h>
1637
FcFontSetSortDestroy(FcFontSet *set);
1641
This function is DEPRECATED. FcFontSetSortDestroy destroys set
1642
by calling FcFontSetDestroy. Applications should use
1643
FcFontSetDestroy directly instead.
1647
Fontconfig version 2.5.0
1648
__________________________________________________________
1341
1650
4.4. FcObjectSet
1533
1883
#include <fontconfig.h>
1534
1884
#include <fcfreetype.h>
1536
FcPattern * FcFreeTypeQueryFace(const FT_Face face, const char
1537
*file, int id, FcBlanks *blanks);
1886
FcPattern * FcFreeTypeQueryFace(const FT_Face face, const
1887
FcChar8 *file, int id, FcBlanks *blanks);
1541
1891
Constructs a pattern representing 'face'. 'file' and 'id' are
1542
used solely as data for pattern elements (FC_FILE, FC_INDEX
1543
and sometimes FC_FAMILY).
1892
used solely as data for pattern elements (FC_FILE, FC_INDEX and
1893
sometimes FC_FAMILY).
1547
Fontconfig version 2.4.2
1548
_________________________________________________________
1897
Fontconfig version 2.5.0
1898
__________________________________________________________
1552
1902
Table of Contents
1553
1903
FcValueDestroy -- Free a value
1554
1904
FcValueSave -- Copy a value
1905
FcValuePrint -- Print a value to stdout
1906
FcValueEqual -- Test two values for equality
1556
FcValue is a structure containing a type tag and a union of
1557
all possible datatypes. The tag is an enum of type FcType and
1558
is intended to provide a measure of run-time typechecking,
1908
FcValue is a structure containing a type tag and a union of all
1909
possible datatypes. The tag is an enum of type FcType and is
1910
intended to provide a measure of run-time typechecking,
1559
1911
although that depends on careful programming.
1948
Fontconfig version 2.4.2
1949
_________________________________________________________
2347
Fontconfig version 2.5.0
2353
FcCharSetCoverage -- DEPRECATED return coverage for a Unicode
2358
#include <fontconfig.h>
2360
FcChar32 FcCharSetCoverage(const FcCharSet *a, FcChar32page,
2365
DEPRECATED This function returns a bitmask in result which
2366
indicates which code points in page are included in a.
2367
FcCharSetCoverage returns the next page in the charset which
2372
Fontconfig version 2.5.0
2378
FcCharSetNew -- DEPRECATED alias for FcCharSetCreate
2382
#include <fontconfig.h>
2384
FcCharSet * FcCharSetNew(void);
2388
FcCharSetNew is a DEPRECATED alias for FcCharSetCreate.
2392
Fontconfig version 2.5.0
2393
__________________________________________________________
2398
FcLangSetCreate -- create a langset object
2399
FcLangSetDestroy -- destroy a langset object
2400
FcLangSetCopy -- copy a langset object
2401
FcLangSetAdd -- add a language to a langset
2402
FcLangSetCompare -- compare language sets
2403
FcLangSetContains -- check langset subset relation
2404
FcLangSetEqual -- test for matching langsets
2405
FcLangSetHash -- return a hash value for a langset
2406
FcLangSetHasLang -- test langset for language support
2407
FcGetLangs -- Get list of languages
2408
FcLangGetCharSet -- Get character map for a language
2410
An FcLangSet is a set of language names (each of which include
2411
language and an optional territory). They are used when
2412
selecting fonts to indicate which languages the fonts need to
2413
support. Each font is marked, using language orthography
2414
information built into fontconfig, with the set of supported
2421
FcLangSetCreate -- create a langset object
2425
#include <fontconfig.h>
2427
FcLangSet * FcLangSetCreate(void);
2431
FcLangSetCreate creates a new FcLangSet object.
2435
Fontconfig version 2.5.0
2441
FcLangSetDestroy -- destroy a langset object
2445
#include <fontconfig.h>
2447
void FcLangSetDestroy(FcLangSet *ls);
2451
FcLangSetDestroy destroys a FcLangSet object, freeing all
2452
memory associated with it.
2456
Fontconfig version 2.5.0
2462
FcLangSetCopy -- copy a langset object
2466
#include <fontconfig.h>
2468
FcLangSet * FcLangSetCopy(const FcLangSet *ls);
2472
FcLangSetCopy creates a new FcLangSet object and populates it
2473
with the contents of ls.
2477
Fontconfig version 2.5.0
2483
FcLangSetAdd -- add a language to a langset
2487
#include <fontconfig.h>
2489
FcBool FcLangSetAdd(FcLangSet *ls, const FcChar8 *lang);
2493
lang is added to ls. lang should be of the form Ll-Tt where Ll
2494
is a two or three letter language from ISO 639 and Tt is a
2495
territory from ISO 3166.
2499
Fontconfig version 2.5.0
2505
FcLangSetCompare -- compare language sets
2509
#include <fontconfig.h>
2511
FcLangResult FcLangSetCompare(const FcLangSet *ls_a, const
2516
FcLangSetCompare compares language coverage for ls_a and ls_b.
2517
If they share any language and territory pair, this function
2518
returns FcLangEqual. If they share a language but differ in
2519
which territory that language is for, this function returns
2520
FcLangDiffentTerritory. If they share no languages in common,
2521
this function returns FcLangDifferentLang.
2525
Fontconfig version 2.5.0
2531
FcLangSetContains -- check langset subset relation
2535
#include <fontconfig.h>
2537
FcBool FcLangSetContains(const FcLangSet *ls_a, const FcLangSet
2542
FcLangSetContains returns FcTrue if ls_a contains every
2543
language in ls_b. ls_a will 'contain' a language from ls_b if
2544
ls_a has exactly the language, or either the language or ls_a
2549
Fontconfig version 2.5.0
2555
FcLangSetEqual -- test for matching langsets
2559
#include <fontconfig.h>
2561
FcBool FcLangSetEqual(const FcLangSet *ls_a, const FcLangSet
2566
Returns FcTrue if and only if ls_a supports precisely the same
2567
language and territory combinations as ls_b.
2571
Fontconfig version 2.5.0
2577
FcLangSetHash -- return a hash value for a langset
2581
#include <fontconfig.h>
2583
FcChar32 FcLangSetHash(const FcLangSet *ls);
2587
This function returns a value which depends solely on the
2588
languages supported by ls. Any language which equals ls will
2589
have the same result from FcLangSetHash. However, two langsets
2590
with the same hash value may not be equal.
2594
Fontconfig version 2.5.0
2600
FcLangSetHasLang -- test langset for language support
2604
#include <fontconfig.h>
2606
FcLangResult FcLangSetHasLang(const FcLangSet *ls, const
2611
FcLangSetHasLang checks whether ls supports lang. If ls has a
2612
matching language and territory pair, this function returns
2613
FcLangEqual. If ls has a matching language but differs in which
2614
territory that language is for, this function returns
2615
FcLangDiffentTerritory. If ls has no matching language, this
2616
function returns FcLangDifferentLang.
2620
Fontconfig version 2.5.0
2626
FcGetLangs -- Get list of languages
2630
#include <fontconfig.h>
2632
FcStrSet * FcGetLangs(void);
2636
Returns a string set of all known languages.
2640
Fontconfig version 2.5.0
2646
FcLangGetCharSet -- Get character map for a language
2650
#include <fontconfig.h>
2652
const FcCharSet * FcLangGetCharSet(const FcChar8 *lang);
2656
Returns the FcCharMap for a language.
2660
Fontconfig version 2.5.0
2661
__________________________________________________________
1953
2665
Table of Contents
1954
2666
FcMatrixInit -- initialize an FcMatrix structure
2124
2836
FcConfigSetCurrent -- Set configuration as default
2125
2837
FcConfigGetCurrent -- Return current configuration
2126
2838
FcConfigUptoDate -- Check timestamps on config files
2839
FcConfigHome -- return the current home directory.
2840
FcConfigEnableHome -- controls use of the home directory.
2127
2841
FcConfigBuildFonts -- Build font database
2128
2842
FcConfigGetConfigDirs -- Get config directories
2129
2843
FcConfigGetFontDirs -- Get font directories
2130
2844
FcConfigGetConfigFiles -- Get config files
2131
FcConfigGetCache -- Get cache filename
2845
FcConfigGetCache -- DEPRECATED used to return per-user cache
2848
FcConfigGetCacheDirs -- return the list of directories searched
2132
2851
FcConfigGetFonts -- Get config font set
2133
2852
FcConfigGetBlanks -- Get config blanks
2134
FcConfigGetRescanInverval -- Get config rescan interval
2135
FcConfigSetRescanInverval -- Set config rescan interval
2853
FcConfigGetRescanInterval -- Get config rescan interval
2854
FcConfigSetRescanInterval -- Set config rescan interval
2136
2855
FcConfigAppFontAddFile -- Add font file to font database
2137
2856
FcConfigAppFontAddDir -- Add fonts from directory to font
2140
FcConfigAppFontClear -- Remove all app fonts from font
2859
FcConfigAppFontClear -- Remove all app fonts from font database
2143
2860
FcConfigSubstituteWithPat -- Execute substitutions
2144
2861
FcConfigSubstitute -- Execute substitutions
2145
2862
FcFontMatch -- Return best font
3213
4028
#include <fontconfig.h>
3215
4030
FcBool FcFileScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
3216
*cache, FcBlanks *blanks, const char *file, FcBool force);
4031
*cache, FcBlanks *blanks, const FcChar8 *file, FcBool force);
3220
4035
Scans a single file and adds all fonts found to set. If force
3221
4036
is FcTrue, then the file is scanned even if associated
3222
4037
information is found in cache. If file is a directory, it is
3227
Fontconfig version 2.4.2
4038
added to dirs. Whether fonts are found depends on fontconfig
4039
policy as well as the current configuration. Internally,
4040
fontconfig will ignore BDF and PCF fonts which are not in
4041
Unicode (or the effectively equivalent ISO Latin-1) encoding as
4042
those are not usable by Unicode-based applications. The
4043
configuration can ignore fonts based on filename or contents of
4044
the font file itself. Returns FcFalse if any of the fonts
4045
cannot be added (due to allocation failure). Otherwise returns
4050
Fontconfig version 2.5.0
4056
FcFileIsDir -- check whether a file is a directory
4060
#include <fontconfig.h>
4062
FcBool FcFileIsDir(const FcChar8 *file);
4066
Returns FcTrue if file is a directory, otherwise returns
4071
Fontconfig version 2.5.0
3233
FcDirScan -- scan a font directory
4077
FcDirScan -- DEPRECATED: formerly used to scan a font directory
3237
4081
#include <fontconfig.h>
3239
4083
FcBool FcDirScan(FcFontSet *set, FcStrSet *dirs, FcFileCache
3240
*cache, FcBlanks *blanks, const char *dir, FcBool force);
4084
*cache, FcBlanks *blanks, const FcChar8 *dir, FcBool force);
3244
Scans an entire directory and adds all fonts found to set. If
3245
force is FcTrue, then the directory and all files within it
3246
are scanned even if information is present in the
4088
This function does nothing aside from returning FcFalse. It
4089
used to scan an entire directory and add all fonts found to
4090
set. If force was FcTrue, then the directory and all files
4091
within it were scanned even if information was present in the
3247
4092
per-directory cache file or cache. Any subdirectories found
3252
Fontconfig version 2.4.2
4097
Fontconfig version 2.5.0
3258
FcDirSave -- save a directory cache
4103
FcDirSave -- DEPRECATED: formerly used to save a directory
3262
4108
#include <fontconfig.h>
3264
FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const char
4110
FcBool FcDirSave(FcFontSet *set, FcStrSet *dirs, const FcChar8
3269
Creates the per-directory cache file for dir and populates it
3270
with the fonts in set and subdirectories in dirs.
3274
Fontconfig version 2.4.2
4115
This function now does nothing aside from returning FcFalse. It
4116
used to creates the per-directory cache file for dir and
4117
populates it with the fonts in set and subdirectories in dirs.
4118
All of this functionality is now automatically managed by
4119
FcDirCacheLoad and FcDirCacheRead.
4123
Fontconfig version 2.5.0
4129
FcDirCacheUnlink -- Remove all caches related to dir
4133
#include <fontconfig.h>
4135
FcBool FcDirCacheUnlink(const FcChar8 *dir, FcConfig *config);
4139
Scans the cache directories in config, removing any instances
4140
of the cache file for dir. Returns FcFalse when some internal
4141
error occurs (out of memory, etc). Errors actually unlinking
4142
any files are ignored.
4146
Fontconfig version 2.5.0
3276
4148
FcDirCacheValid
3280
FcDirCacheValid -- check directory cache timestamp
3284
#include <fontconfig.h>
3286
FcBool FcDirCacheValid(const FcChar8 *cache_file);
3290
Returns FcTrue if cache_file is no older than the directory
3291
containing it, else FcFalse.
3295
Fontconfig version 2.4.2
3296
_________________________________________________________
3298
4.15. FcStrSet and FcStrList
4152
FcDirCacheValid -- check directory cache
4156
#include <fontconfig.h>
4158
FcBool FcDirCacheValid(const FcChar8 *dir);
4162
Returns FcTrue if dir has an associated valid cache file, else
4167
Fontconfig version 2.5.0
4173
FcDirCacheLoad -- load a directory cache
4177
#include <fontconfig.h>
4179
FcCache * FcDirCacheLoad(const FcChar8 *dir, FcConfig *config,
4180
FcChar8 **cache_file);
4184
Loads the cache related to dir. If no cache file exists,
4185
returns NULL. The name of the cache file is returned in
4186
cache_file, unless that is NULL. See also FcDirCacheRead.
4190
Fontconfig version 2.5.0
4196
FcDirCacheRead -- read or construct a directory cache
4200
#include <fontconfig.h>
4202
FcCache * FcDirCacheRead(const FcChar8 *dir, FcBool force,
4207
This returns a cache for dir. If force is FcFalse, then an
4208
existing, valid cache file will be used. Otherwise, a new cache
4209
will be created by scanning the directory and that returned.
4213
Fontconfig version 2.5.0
4219
FcDirCacheLoadFile -- load a cache file
4223
#include <fontconfig.h>
4225
FcCache * FcDirCacheLoadFile(const FcChar8 *cache_file, struct
4230
This function loads a directory cache from cache_file. If
4231
file_stat is non-NULL, it will be filled with the results of
4232
stat(2) on the cache file.
4236
Fontconfig version 2.5.0
4242
FcDirCacheUnload -- unload a cache file
4246
#include <fontconfig.h>
4248
void FcDirCacheUnload(FcCache *cache);
4252
This function dereferences cache. When no other references to
4253
it remain, all memory associated with the cache will be freed.
4257
Fontconfig version 2.5.0
4258
__________________________________________________________
4260
4.16. FcCache routines
4263
FcCacheDir -- Return directory of cache
4264
FcCacheCopySet -- Returns a copy of the fontset from cache
4265
FcCacheSubdir -- Return the i'th subdirectory.
4266
FcCacheNumSubdir -- Return the number of subdirectories in
4269
FcCacheNumFont -- Returns the number of fonts in cache.
4271
These routines work with font directory caches, accessing their
4272
contents in limited ways. It is not expected that normal
4273
applications will need to use these functions.
4279
FcCacheDir -- Return directory of cache
4283
#include <fontconfig.h>
4285
const FcChar8 * FcCacheDir(const FcCache *cache);
4289
This function returns the directory from which the cache was
4294
Fontconfig version 2.5.0
4300
FcCacheCopySet -- Returns a copy of the fontset from cache
4304
#include <fontconfig.h>
4306
FcFontSet * FcCacheCopySet(const FcCache *cache);
4310
The returned fontset contains each of the font patterns from
4311
cache. This fontset may be modified, but the patterns from the
4312
cache are read-only.
4316
Fontconfig version 2.5.0
4322
FcCacheSubdir -- Return the i'th subdirectory.
4326
#include <fontconfig.h>
4328
const FcChar8 * FcCacheSubdir(const FcCache *cache, inti);
4332
The set of subdirectories stored in a cache file are indexed by
4333
this function, i should range from 0 to n-1, where n is the
4334
return value from FcCacheNumSubdir.
4338
Fontconfig version 2.5.0
4344
FcCacheNumSubdir -- Return the number of subdirectories in
4349
#include <fontconfig.h>
4351
int FcCacheNumSubdir(const FcCache *cache);
4355
This returns the total number of subdirectories in the cache.
4359
Fontconfig version 2.5.0
4365
FcCacheNumFont -- Returns the number of fonts in cache.
4369
#include <fontconfig.h>
4371
int FcCacheNumFont(const FcCache *cache);
4375
This returns the number of fonts which would be included in the
4376
return from FcCacheCopySet.
4380
Fontconfig version 2.5.0
4381
__________________________________________________________
4383
4.17. FcStrSet and FcStrList
3300
4385
Table of Contents
3301
4386
FcStrSetCreate -- create a string set
3302
4387
FcStrSetMember -- check set for membership
4388
FcStrSetEqual -- check sets for equality
3303
4389
FcStrSetAdd -- add to a string set
3304
4390
FcStrSetAddFilename -- add a filename to a string set
3305
4391
FcStrSetDel -- delete from a string set
3763
4957
#include <fontconfig.h>
3765
FcChar8 * FcStrStrIgnoreCase(const char *s1, const char *s2);
3769
Returns the location of s2 in s1, ignoring ASCII case. Returns
3770
NULL if s2 is not present in s1. This test is case-insensitive
3771
in the ASCII range and will operate properly with UTF8 encoded
3772
strings, although it does not check for well formed strings.
3776
Fontconfig version 2.4.2
3782
FcStrDirname -- directory part of filename
3786
#include <fontconfig.h>
3788
FcChar8 * FcStrDirname(const FcChar8 *file);
3792
Returns the directory containing file. This is returned in
3793
newly allocated storage which should be freed when no longer
3798
Fontconfig version 2.4.2
4959
FcChar8 * FcStrStrIgnoreCase(const FcChar8 *s1, const FcChar8
4964
Returns the location of s2 in s1, ignoring case. Returns NULL
4965
if s2 is not present in s1. This test is case-insensitive for
4966
all proper UTF-8 encoded strings.
4970
Fontconfig version 2.5.0
4976
FcStrPlus -- concatenate two strings
4980
#include <fontconfig.h>
4982
FcChar8 * FcStrPlus(const FcChar8 *s1, const FcChar8 *s2);
4986
This function allocates new storage and places the
4987
concatenation of s1 and s2 there, returning the new string.
4991
Fontconfig version 2.5.0
4997
FcStrFree -- free a string
5001
#include <fontconfig.h>
5003
void FcStrFree(FcChar8 *s);
5007
This is just a wrapper around free(3) which helps track memory
5008
usage of strings within the fontconfig library.
5012
Fontconfig version 2.5.0