fontconfig.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149
  1. /*
  2. * fontconfig/fontconfig/fontconfig.h
  3. *
  4. * Copyright © 2001 Keith Packard
  5. *
  6. * Permission to use, copy, modify, distribute, and sell this software and its
  7. * documentation for any purpose is hereby granted without fee, provided that
  8. * the above copyright notice appear in all copies and that both that
  9. * copyright notice and this permission notice appear in supporting
  10. * documentation, and that the name of the author(s) not be used in
  11. * advertising or 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 purpose. It
  14. * is provided "as is" without express or implied warranty.
  15. *
  16. * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  17. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  18. * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  19. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  20. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  21. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  22. * PERFORMANCE OF THIS SOFTWARE.
  23. */
  24. #ifndef _FONTCONFIG_H_
  25. #define _FONTCONFIG_H_
  26. #include <sys/types.h>
  27. #include <sys/stat.h>
  28. #include <stdarg.h>
  29. #include <limits.h>
  30. #if defined(__GNUC__) && (__GNUC__ >= 4)
  31. #define FC_ATTRIBUTE_SENTINEL(x) __attribute__((__sentinel__(0)))
  32. #else
  33. #define FC_ATTRIBUTE_SENTINEL(x)
  34. #endif
  35. #ifndef FcPublic
  36. #define FcPublic
  37. #endif
  38. typedef unsigned char FcChar8;
  39. typedef unsigned short FcChar16;
  40. typedef unsigned int FcChar32;
  41. typedef int FcBool;
  42. /*
  43. * Current Fontconfig version number. This same number
  44. * must appear in the fontconfig configure.in file. Yes,
  45. * it'a a pain to synchronize version numbers like this.
  46. */
  47. #define FC_MAJOR 2
  48. #define FC_MINOR 13
  49. #define FC_REVISION 92
  50. #define FC_VERSION ((FC_MAJOR * 10000) + (FC_MINOR * 100) + (FC_REVISION))
  51. /*
  52. * Current font cache file format version
  53. * This is appended to the cache files so that multiple
  54. * versions of the library will peacefully coexist
  55. *
  56. * Change this value whenever the disk format for the cache file
  57. * changes in any non-compatible way. Try to avoid such changes as
  58. * it means multiple copies of the font information.
  59. */
  60. #define FC_CACHE_VERSION_NUMBER 7
  61. #define _FC_STRINGIFY_(s) #s
  62. #define _FC_STRINGIFY(s) _FC_STRINGIFY_(s)
  63. #define FC_CACHE_VERSION _FC_STRINGIFY(FC_CACHE_VERSION_NUMBER)
  64. #define FcFalse 0
  65. #define FcTrue 1
  66. #define FcDontCare 2
  67. #define FC_FAMILY "family" /* String */
  68. #define FC_STYLE "style" /* String */
  69. #define FC_SLANT "slant" /* Int */
  70. #define FC_WEIGHT "weight" /* Int */
  71. #define FC_SIZE "size" /* Range (double) */
  72. #define FC_ASPECT "aspect" /* Double */
  73. #define FC_PIXEL_SIZE "pixelsize" /* Double */
  74. #define FC_SPACING "spacing" /* Int */
  75. #define FC_FOUNDRY "foundry" /* String */
  76. #define FC_ANTIALIAS "antialias" /* Bool (depends) */
  77. #define FC_HINTING "hinting" /* Bool (true) */
  78. #define FC_HINT_STYLE "hintstyle" /* Int */
  79. #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
  80. #define FC_AUTOHINT "autohint" /* Bool (false) */
  81. /* FC_GLOBAL_ADVANCE is deprecated. this is simply ignored on freetype 2.4.5 or later */
  82. #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
  83. #define FC_WIDTH "width" /* Int */
  84. #define FC_FILE "file" /* String */
  85. #define FC_INDEX "index" /* Int */
  86. #define FC_FT_FACE "ftface" /* FT_Face */
  87. #define FC_RASTERIZER "rasterizer" /* String (deprecated) */
  88. #define FC_OUTLINE "outline" /* Bool */
  89. #define FC_SCALABLE "scalable" /* Bool */
  90. #define FC_COLOR "color" /* Bool */
  91. #define FC_VARIABLE "variable" /* Bool */
  92. #define FC_SCALE "scale" /* double (deprecated) */
  93. #define FC_SYMBOL "symbol" /* Bool */
  94. #define FC_DPI "dpi" /* double */
  95. #define FC_RGBA "rgba" /* Int */
  96. #define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
  97. #define FC_SOURCE "source" /* String (deprecated) */
  98. #define FC_CHARSET "charset" /* CharSet */
  99. #define FC_LANG "lang" /* LangSet Set of RFC 3066 langs */
  100. #define FC_FONTVERSION "fontversion" /* Int from 'head' table */
  101. #define FC_FULLNAME "fullname" /* String */
  102. #define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */
  103. #define FC_STYLELANG "stylelang" /* String RFC 3066 langs */
  104. #define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */
  105. #define FC_CAPABILITY "capability" /* String */
  106. #define FC_FONTFORMAT "fontformat" /* String */
  107. #define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
  108. #define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
  109. #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
  110. #define FC_LCD_FILTER "lcdfilter" /* Int */
  111. #define FC_FONT_FEATURES "fontfeatures" /* String */
  112. #define FC_FONT_VARIATIONS "fontvariations" /* String */
  113. #define FC_NAMELANG "namelang" /* String RFC 3866 langs */
  114. #define FC_PRGNAME "prgname" /* String */
  115. #define FC_HASH "hash" /* String (deprecated) */
  116. #define FC_POSTSCRIPT_NAME "postscriptname" /* String */
  117. #define FC_FONT_HAS_HINT "fonthashint" /* Bool - true if font has hinting */
  118. #define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION
  119. #define FC_DIR_CACHE_FILE "fonts.cache-" FC_CACHE_VERSION
  120. #define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION
  121. /* Adjust outline rasterizer */
  122. #define FC_CHARWIDTH "charwidth" /* Int */
  123. #define FC_CHAR_WIDTH FC_CHARWIDTH
  124. #define FC_CHAR_HEIGHT "charheight"/* Int */
  125. #define FC_MATRIX "matrix" /* FcMatrix */
  126. #define FC_WEIGHT_THIN 0
  127. #define FC_WEIGHT_EXTRALIGHT 40
  128. #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
  129. #define FC_WEIGHT_LIGHT 50
  130. #define FC_WEIGHT_DEMILIGHT 55
  131. #define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
  132. #define FC_WEIGHT_BOOK 75
  133. #define FC_WEIGHT_REGULAR 80
  134. #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
  135. #define FC_WEIGHT_MEDIUM 100
  136. #define FC_WEIGHT_DEMIBOLD 180
  137. #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
  138. #define FC_WEIGHT_BOLD 200
  139. #define FC_WEIGHT_EXTRABOLD 205
  140. #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
  141. #define FC_WEIGHT_BLACK 210
  142. #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
  143. #define FC_WEIGHT_EXTRABLACK 215
  144. #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
  145. #define FC_SLANT_ROMAN 0
  146. #define FC_SLANT_ITALIC 100
  147. #define FC_SLANT_OBLIQUE 110
  148. #define FC_WIDTH_ULTRACONDENSED 50
  149. #define FC_WIDTH_EXTRACONDENSED 63
  150. #define FC_WIDTH_CONDENSED 75
  151. #define FC_WIDTH_SEMICONDENSED 87
  152. #define FC_WIDTH_NORMAL 100
  153. #define FC_WIDTH_SEMIEXPANDED 113
  154. #define FC_WIDTH_EXPANDED 125
  155. #define FC_WIDTH_EXTRAEXPANDED 150
  156. #define FC_WIDTH_ULTRAEXPANDED 200
  157. #define FC_PROPORTIONAL 0
  158. #define FC_DUAL 90
  159. #define FC_MONO 100
  160. #define FC_CHARCELL 110
  161. /* sub-pixel order */
  162. #define FC_RGBA_UNKNOWN 0
  163. #define FC_RGBA_RGB 1
  164. #define FC_RGBA_BGR 2
  165. #define FC_RGBA_VRGB 3
  166. #define FC_RGBA_VBGR 4
  167. #define FC_RGBA_NONE 5
  168. /* hinting style */
  169. #define FC_HINT_NONE 0
  170. #define FC_HINT_SLIGHT 1
  171. #define FC_HINT_MEDIUM 2
  172. #define FC_HINT_FULL 3
  173. /* LCD filter */
  174. #define FC_LCD_NONE 0
  175. #define FC_LCD_DEFAULT 1
  176. #define FC_LCD_LIGHT 2
  177. #define FC_LCD_LEGACY 3
  178. typedef enum _FcType {
  179. FcTypeUnknown = -1,
  180. FcTypeVoid,
  181. FcTypeInteger,
  182. FcTypeDouble,
  183. FcTypeString,
  184. FcTypeBool,
  185. FcTypeMatrix,
  186. FcTypeCharSet,
  187. FcTypeFTFace,
  188. FcTypeLangSet,
  189. FcTypeRange
  190. } FcType;
  191. typedef struct _FcMatrix {
  192. double xx, xy, yx, yy;
  193. } FcMatrix;
  194. #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
  195. (m)->xy = (m)->yx = 0)
  196. /*
  197. * A data structure to represent the available glyphs in a font.
  198. * This is represented as a sparse boolean btree.
  199. */
  200. typedef struct _FcCharSet FcCharSet;
  201. typedef struct _FcObjectType {
  202. char *object;
  203. FcType type;
  204. } FcObjectType;
  205. typedef struct _FcConstant {
  206. const FcChar8 *name;
  207. const char *object;
  208. int value;
  209. } FcConstant;
  210. typedef enum _FcResult {
  211. FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
  212. FcResultOutOfMemory
  213. } FcResult;
  214. typedef enum _FcValueBinding {
  215. FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
  216. /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
  217. FcValueBindingEnd = INT_MAX
  218. } FcValueBinding;
  219. typedef struct _FcPattern FcPattern;
  220. typedef struct _FcPatternIter {
  221. void *dummy1;
  222. void *dummy2;
  223. } FcPatternIter;
  224. typedef struct _FcLangSet FcLangSet;
  225. typedef struct _FcRange FcRange;
  226. typedef struct _FcValue {
  227. FcType type;
  228. union {
  229. const FcChar8 *s;
  230. int i;
  231. FcBool b;
  232. double d;
  233. const FcMatrix *m;
  234. const FcCharSet *c;
  235. void *f;
  236. const FcLangSet *l;
  237. const FcRange *r;
  238. } u;
  239. } FcValue;
  240. typedef struct _FcFontSet {
  241. int nfont;
  242. int sfont;
  243. FcPattern **fonts;
  244. } FcFontSet;
  245. typedef struct _FcObjectSet {
  246. int nobject;
  247. int sobject;
  248. const char **objects;
  249. } FcObjectSet;
  250. typedef enum _FcMatchKind {
  251. FcMatchPattern, FcMatchFont, FcMatchScan,
  252. FcMatchKindEnd,
  253. FcMatchKindBegin = FcMatchPattern
  254. } FcMatchKind;
  255. typedef enum _FcLangResult {
  256. FcLangEqual = 0,
  257. FcLangDifferentCountry = 1,
  258. FcLangDifferentTerritory = 1,
  259. FcLangDifferentLang = 2
  260. } FcLangResult;
  261. typedef enum _FcSetName {
  262. FcSetSystem = 0,
  263. FcSetApplication = 1
  264. } FcSetName;
  265. typedef struct _FcConfigFileInfoIter {
  266. void *dummy1;
  267. void *dummy2;
  268. void *dummy3;
  269. } FcConfigFileInfoIter;
  270. typedef struct _FcAtomic FcAtomic;
  271. #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
  272. #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
  273. #define _FCFUNCPROTOEND }
  274. #else
  275. #define _FCFUNCPROTOBEGIN
  276. #define _FCFUNCPROTOEND
  277. #endif
  278. typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
  279. typedef struct _FcConfig FcConfig;
  280. typedef struct _FcGlobalCache FcFileCache;
  281. typedef struct _FcBlanks FcBlanks;
  282. typedef struct _FcStrList FcStrList;
  283. typedef struct _FcStrSet FcStrSet;
  284. typedef struct _FcCache FcCache;
  285. _FCFUNCPROTOBEGIN
  286. /* fcblanks.c */
  287. FcPublic FcBlanks *
  288. FcBlanksCreate (void);
  289. FcPublic void
  290. FcBlanksDestroy (FcBlanks *b);
  291. FcPublic FcBool
  292. FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
  293. FcPublic FcBool
  294. FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
  295. /* fccache.c */
  296. FcPublic const FcChar8 *
  297. FcCacheDir(const FcCache *c);
  298. FcPublic FcFontSet *
  299. FcCacheCopySet(const FcCache *c);
  300. FcPublic const FcChar8 *
  301. FcCacheSubdir (const FcCache *c, int i);
  302. FcPublic int
  303. FcCacheNumSubdir (const FcCache *c);
  304. FcPublic int
  305. FcCacheNumFont (const FcCache *c);
  306. FcPublic FcBool
  307. FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
  308. FcPublic FcBool
  309. FcDirCacheValid (const FcChar8 *cache_file);
  310. FcPublic FcBool
  311. FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
  312. FcPublic void
  313. FcCacheCreateTagFile (const FcConfig *config);
  314. FcPublic FcBool
  315. FcDirCacheCreateUUID (FcChar8 *dir,
  316. FcBool force,
  317. FcConfig *config);
  318. FcPublic FcBool
  319. FcDirCacheDeleteUUID (const FcChar8 *dir,
  320. FcConfig *config);
  321. /* fccfg.c */
  322. FcPublic FcChar8 *
  323. FcConfigHome (void);
  324. FcPublic FcBool
  325. FcConfigEnableHome (FcBool enable);
  326. FcPublic FcChar8 *
  327. FcConfigFilename (const FcChar8 *url);
  328. FcPublic FcConfig *
  329. FcConfigCreate (void);
  330. FcPublic FcConfig *
  331. FcConfigReference (FcConfig *config);
  332. FcPublic void
  333. FcConfigDestroy (FcConfig *config);
  334. FcPublic FcBool
  335. FcConfigSetCurrent (FcConfig *config);
  336. FcPublic FcConfig *
  337. FcConfigGetCurrent (void);
  338. FcPublic FcBool
  339. FcConfigUptoDate (FcConfig *config);
  340. FcPublic FcBool
  341. FcConfigBuildFonts (FcConfig *config);
  342. FcPublic FcStrList *
  343. FcConfigGetFontDirs (FcConfig *config);
  344. FcPublic FcStrList *
  345. FcConfigGetConfigDirs (FcConfig *config);
  346. FcPublic FcStrList *
  347. FcConfigGetConfigFiles (FcConfig *config);
  348. FcPublic FcChar8 *
  349. FcConfigGetCache (FcConfig *config);
  350. FcPublic FcBlanks *
  351. FcConfigGetBlanks (FcConfig *config);
  352. FcPublic FcStrList *
  353. FcConfigGetCacheDirs (const FcConfig *config);
  354. FcPublic int
  355. FcConfigGetRescanInterval (FcConfig *config);
  356. FcPublic FcBool
  357. FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
  358. FcPublic FcFontSet *
  359. FcConfigGetFonts (FcConfig *config,
  360. FcSetName set);
  361. FcPublic FcBool
  362. FcConfigAppFontAddFile (FcConfig *config,
  363. const FcChar8 *file);
  364. FcPublic FcBool
  365. FcConfigAppFontAddDir (FcConfig *config,
  366. const FcChar8 *dir);
  367. FcPublic void
  368. FcConfigAppFontClear (FcConfig *config);
  369. FcPublic FcBool
  370. FcConfigSubstituteWithPat (FcConfig *config,
  371. FcPattern *p,
  372. FcPattern *p_pat,
  373. FcMatchKind kind);
  374. FcPublic FcBool
  375. FcConfigSubstitute (FcConfig *config,
  376. FcPattern *p,
  377. FcMatchKind kind);
  378. FcPublic const FcChar8 *
  379. FcConfigGetSysRoot (const FcConfig *config);
  380. FcPublic void
  381. FcConfigSetSysRoot (FcConfig *config,
  382. const FcChar8 *sysroot);
  383. FcPublic void
  384. FcConfigFileInfoIterInit (FcConfig *config,
  385. FcConfigFileInfoIter *iter);
  386. FcPublic FcBool
  387. FcConfigFileInfoIterNext (FcConfig *config,
  388. FcConfigFileInfoIter *iter);
  389. FcPublic FcBool
  390. FcConfigFileInfoIterGet (FcConfig *config,
  391. FcConfigFileInfoIter *iter,
  392. FcChar8 **name,
  393. FcChar8 **description,
  394. FcBool *enabled);
  395. /* fccharset.c */
  396. FcPublic FcCharSet*
  397. FcCharSetCreate (void);
  398. /* deprecated alias for FcCharSetCreate */
  399. FcPublic FcCharSet *
  400. FcCharSetNew (void);
  401. FcPublic void
  402. FcCharSetDestroy (FcCharSet *fcs);
  403. FcPublic FcBool
  404. FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
  405. FcPublic FcBool
  406. FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
  407. FcPublic FcCharSet*
  408. FcCharSetCopy (FcCharSet *src);
  409. FcPublic FcBool
  410. FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
  411. FcPublic FcCharSet*
  412. FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
  413. FcPublic FcCharSet*
  414. FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
  415. FcPublic FcCharSet*
  416. FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
  417. FcPublic FcBool
  418. FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
  419. FcPublic FcBool
  420. FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
  421. FcPublic FcChar32
  422. FcCharSetCount (const FcCharSet *a);
  423. FcPublic FcChar32
  424. FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
  425. FcPublic FcChar32
  426. FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
  427. FcPublic FcBool
  428. FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
  429. #define FC_CHARSET_MAP_SIZE (256/32)
  430. #define FC_CHARSET_DONE ((FcChar32) -1)
  431. FcPublic FcChar32
  432. FcCharSetFirstPage (const FcCharSet *a,
  433. FcChar32 map[FC_CHARSET_MAP_SIZE],
  434. FcChar32 *next);
  435. FcPublic FcChar32
  436. FcCharSetNextPage (const FcCharSet *a,
  437. FcChar32 map[FC_CHARSET_MAP_SIZE],
  438. FcChar32 *next);
  439. /*
  440. * old coverage API, rather hard to use correctly
  441. */
  442. FcPublic FcChar32
  443. FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
  444. /* fcdbg.c */
  445. FcPublic void
  446. FcValuePrint (const FcValue v);
  447. FcPublic void
  448. FcPatternPrint (const FcPattern *p);
  449. FcPublic void
  450. FcFontSetPrint (const FcFontSet *s);
  451. /* fcdefault.c */
  452. FcPublic FcStrSet *
  453. FcGetDefaultLangs (void);
  454. FcPublic void
  455. FcDefaultSubstitute (FcPattern *pattern);
  456. /* fcdir.c */
  457. FcPublic FcBool
  458. FcFileIsDir (const FcChar8 *file);
  459. FcPublic FcBool
  460. FcFileScan (FcFontSet *set,
  461. FcStrSet *dirs,
  462. FcFileCache *cache,
  463. FcBlanks *blanks,
  464. const FcChar8 *file,
  465. FcBool force);
  466. FcPublic FcBool
  467. FcDirScan (FcFontSet *set,
  468. FcStrSet *dirs,
  469. FcFileCache *cache,
  470. FcBlanks *blanks,
  471. const FcChar8 *dir,
  472. FcBool force);
  473. FcPublic FcBool
  474. FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
  475. FcPublic FcCache *
  476. FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
  477. FcPublic FcCache *
  478. FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
  479. FcPublic FcCache *
  480. FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
  481. FcPublic FcCache *
  482. FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
  483. FcPublic void
  484. FcDirCacheUnload (FcCache *cache);
  485. /* fcfreetype.c */
  486. FcPublic FcPattern *
  487. FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
  488. FcPublic unsigned int
  489. FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
  490. /* fcfs.c */
  491. FcPublic FcFontSet *
  492. FcFontSetCreate (void);
  493. FcPublic void
  494. FcFontSetDestroy (FcFontSet *s);
  495. FcPublic FcBool
  496. FcFontSetAdd (FcFontSet *s, FcPattern *font);
  497. /* fcinit.c */
  498. FcPublic FcConfig *
  499. FcInitLoadConfig (void);
  500. FcPublic FcConfig *
  501. FcInitLoadConfigAndFonts (void);
  502. FcPublic FcBool
  503. FcInit (void);
  504. FcPublic void
  505. FcFini (void);
  506. FcPublic int
  507. FcGetVersion (void);
  508. FcPublic FcBool
  509. FcInitReinitialize (void);
  510. FcPublic FcBool
  511. FcInitBringUptoDate (void);
  512. /* fclang.c */
  513. FcPublic FcStrSet *
  514. FcGetLangs (void);
  515. FcPublic FcChar8 *
  516. FcLangNormalize (const FcChar8 *lang);
  517. FcPublic const FcCharSet *
  518. FcLangGetCharSet (const FcChar8 *lang);
  519. FcPublic FcLangSet*
  520. FcLangSetCreate (void);
  521. FcPublic void
  522. FcLangSetDestroy (FcLangSet *ls);
  523. FcPublic FcLangSet*
  524. FcLangSetCopy (const FcLangSet *ls);
  525. FcPublic FcBool
  526. FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
  527. FcPublic FcBool
  528. FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);
  529. FcPublic FcLangResult
  530. FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
  531. FcPublic FcLangResult
  532. FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
  533. FcPublic FcBool
  534. FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
  535. FcPublic FcBool
  536. FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
  537. FcPublic FcChar32
  538. FcLangSetHash (const FcLangSet *ls);
  539. FcPublic FcStrSet *
  540. FcLangSetGetLangs (const FcLangSet *ls);
  541. FcPublic FcLangSet *
  542. FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);
  543. FcPublic FcLangSet *
  544. FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);
  545. /* fclist.c */
  546. FcPublic FcObjectSet *
  547. FcObjectSetCreate (void);
  548. FcPublic FcBool
  549. FcObjectSetAdd (FcObjectSet *os, const char *object);
  550. FcPublic void
  551. FcObjectSetDestroy (FcObjectSet *os);
  552. FcPublic FcObjectSet *
  553. FcObjectSetVaBuild (const char *first, va_list va);
  554. FcPublic FcObjectSet *
  555. FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
  556. FcPublic FcFontSet *
  557. FcFontSetList (FcConfig *config,
  558. FcFontSet **sets,
  559. int nsets,
  560. FcPattern *p,
  561. FcObjectSet *os);
  562. FcPublic FcFontSet *
  563. FcFontList (FcConfig *config,
  564. FcPattern *p,
  565. FcObjectSet *os);
  566. /* fcatomic.c */
  567. FcPublic FcAtomic *
  568. FcAtomicCreate (const FcChar8 *file);
  569. FcPublic FcBool
  570. FcAtomicLock (FcAtomic *atomic);
  571. FcPublic FcChar8 *
  572. FcAtomicNewFile (FcAtomic *atomic);
  573. FcPublic FcChar8 *
  574. FcAtomicOrigFile (FcAtomic *atomic);
  575. FcPublic FcBool
  576. FcAtomicReplaceOrig (FcAtomic *atomic);
  577. FcPublic void
  578. FcAtomicDeleteNew (FcAtomic *atomic);
  579. FcPublic void
  580. FcAtomicUnlock (FcAtomic *atomic);
  581. FcPublic void
  582. FcAtomicDestroy (FcAtomic *atomic);
  583. /* fcmatch.c */
  584. FcPublic FcPattern *
  585. FcFontSetMatch (FcConfig *config,
  586. FcFontSet **sets,
  587. int nsets,
  588. FcPattern *p,
  589. FcResult *result);
  590. FcPublic FcPattern *
  591. FcFontMatch (FcConfig *config,
  592. FcPattern *p,
  593. FcResult *result);
  594. FcPublic FcPattern *
  595. FcFontRenderPrepare (FcConfig *config,
  596. FcPattern *pat,
  597. FcPattern *font);
  598. FcPublic FcFontSet *
  599. FcFontSetSort (FcConfig *config,
  600. FcFontSet **sets,
  601. int nsets,
  602. FcPattern *p,
  603. FcBool trim,
  604. FcCharSet **csp,
  605. FcResult *result);
  606. FcPublic FcFontSet *
  607. FcFontSort (FcConfig *config,
  608. FcPattern *p,
  609. FcBool trim,
  610. FcCharSet **csp,
  611. FcResult *result);
  612. FcPublic void
  613. FcFontSetSortDestroy (FcFontSet *fs);
  614. /* fcmatrix.c */
  615. FcPublic FcMatrix *
  616. FcMatrixCopy (const FcMatrix *mat);
  617. FcPublic FcBool
  618. FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
  619. FcPublic void
  620. FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
  621. FcPublic void
  622. FcMatrixRotate (FcMatrix *m, double c, double s);
  623. FcPublic void
  624. FcMatrixScale (FcMatrix *m, double sx, double sy);
  625. FcPublic void
  626. FcMatrixShear (FcMatrix *m, double sh, double sv);
  627. /* fcname.c */
  628. /* Deprecated. Does nothing. Returns FcFalse. */
  629. FcPublic FcBool
  630. FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
  631. /* Deprecated. Does nothing. Returns FcFalse. */
  632. FcPublic FcBool
  633. FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
  634. FcPublic const FcObjectType *
  635. FcNameGetObjectType (const char *object);
  636. /* Deprecated. Does nothing. Returns FcFalse. */
  637. FcPublic FcBool
  638. FcNameRegisterConstants (const FcConstant *consts, int nconsts);
  639. /* Deprecated. Does nothing. Returns FcFalse. */
  640. FcPublic FcBool
  641. FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
  642. FcPublic const FcConstant *
  643. FcNameGetConstant (const FcChar8 *string);
  644. FcPublic FcBool
  645. FcNameConstant (const FcChar8 *string, int *result);
  646. FcPublic FcPattern *
  647. FcNameParse (const FcChar8 *name);
  648. FcPublic FcChar8 *
  649. FcNameUnparse (FcPattern *pat);
  650. /* fcpat.c */
  651. FcPublic FcPattern *
  652. FcPatternCreate (void);
  653. FcPublic FcPattern *
  654. FcPatternDuplicate (const FcPattern *p);
  655. FcPublic void
  656. FcPatternReference (FcPattern *p);
  657. FcPublic FcPattern *
  658. FcPatternFilter (FcPattern *p, const FcObjectSet *os);
  659. FcPublic void
  660. FcValueDestroy (FcValue v);
  661. FcPublic FcBool
  662. FcValueEqual (FcValue va, FcValue vb);
  663. FcPublic FcValue
  664. FcValueSave (FcValue v);
  665. FcPublic void
  666. FcPatternDestroy (FcPattern *p);
  667. int
  668. FcPatternObjectCount (const FcPattern *pat);
  669. FcPublic FcBool
  670. FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
  671. FcPublic FcBool
  672. FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
  673. FcPublic FcChar32
  674. FcPatternHash (const FcPattern *p);
  675. FcPublic FcBool
  676. FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
  677. FcPublic FcBool
  678. FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
  679. FcPublic FcResult
  680. FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
  681. FcPublic FcResult
  682. FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);
  683. FcPublic FcBool
  684. FcPatternDel (FcPattern *p, const char *object);
  685. FcPublic FcBool
  686. FcPatternRemove (FcPattern *p, const char *object, int id);
  687. FcPublic FcBool
  688. FcPatternAddInteger (FcPattern *p, const char *object, int i);
  689. FcPublic FcBool
  690. FcPatternAddDouble (FcPattern *p, const char *object, double d);
  691. FcPublic FcBool
  692. FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
  693. FcPublic FcBool
  694. FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
  695. FcPublic FcBool
  696. FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
  697. FcPublic FcBool
  698. FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
  699. FcPublic FcBool
  700. FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
  701. FcPublic FcBool
  702. FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
  703. FcPublic FcResult
  704. FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
  705. FcPublic FcResult
  706. FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
  707. FcPublic FcResult
  708. FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
  709. FcPublic FcResult
  710. FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
  711. FcPublic FcResult
  712. FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
  713. FcPublic FcResult
  714. FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
  715. FcPublic FcResult
  716. FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
  717. FcPublic FcResult
  718. FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
  719. FcPublic FcPattern *
  720. FcPatternVaBuild (FcPattern *p, va_list va);
  721. FcPublic FcPattern *
  722. FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
  723. FcPublic FcChar8 *
  724. FcPatternFormat (FcPattern *pat, const FcChar8 *format);
  725. /* fcrange.c */
  726. FcPublic FcRange *
  727. FcRangeCreateDouble (double begin, double end);
  728. FcPublic FcRange *
  729. FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
  730. FcPublic void
  731. FcRangeDestroy (FcRange *range);
  732. FcPublic FcRange *
  733. FcRangeCopy (const FcRange *r);
  734. FcPublic FcBool
  735. FcRangeGetDouble(const FcRange *range, double *begin, double *end);
  736. FcPublic void
  737. FcPatternIterStart (const FcPattern *pat, FcPatternIter *iter);
  738. FcPublic FcBool
  739. FcPatternIterNext (const FcPattern *pat, FcPatternIter *iter);
  740. FcPublic FcBool
  741. FcPatternIterEqual (const FcPattern *p1, FcPatternIter *i1,
  742. const FcPattern *p2, FcPatternIter *i2);
  743. FcPublic FcBool
  744. FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter, const char *object);
  745. FcPublic FcBool
  746. FcPatternIterIsValid (const FcPattern *pat, FcPatternIter *iter);
  747. FcPublic const char *
  748. FcPatternIterGetObject (const FcPattern *pat, FcPatternIter *iter);
  749. FcPublic int
  750. FcPatternIterValueCount (const FcPattern *pat, FcPatternIter *iter);
  751. FcPublic FcResult
  752. FcPatternIterGetValue (const FcPattern *pat, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b);
  753. /* fcweight.c */
  754. FcPublic int
  755. FcWeightFromOpenType (int ot_weight);
  756. FcPublic double
  757. FcWeightFromOpenTypeDouble (double ot_weight);
  758. FcPublic int
  759. FcWeightToOpenType (int fc_weight);
  760. FcPublic double
  761. FcWeightToOpenTypeDouble (double fc_weight);
  762. /* fcstr.c */
  763. FcPublic FcChar8 *
  764. FcStrCopy (const FcChar8 *s);
  765. FcPublic FcChar8 *
  766. FcStrCopyFilename (const FcChar8 *s);
  767. FcPublic FcChar8 *
  768. FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
  769. FcPublic void
  770. FcStrFree (FcChar8 *s);
  771. /* These are ASCII only, suitable only for pattern element names */
  772. #define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132))
  773. #define FcIsLower(c) ((0141 <= (c) && (c) <= 0172))
  774. #define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
  775. FcPublic FcChar8 *
  776. FcStrDowncase (const FcChar8 *s);
  777. FcPublic int
  778. FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  779. FcPublic int
  780. FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
  781. FcPublic const FcChar8 *
  782. FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  783. FcPublic const FcChar8 *
  784. FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
  785. FcPublic int
  786. FcUtf8ToUcs4 (const FcChar8 *src_orig,
  787. FcChar32 *dst,
  788. int len);
  789. FcPublic FcBool
  790. FcUtf8Len (const FcChar8 *string,
  791. int len,
  792. int *nchar,
  793. int *wchar);
  794. #define FC_UTF8_MAX_LEN 6
  795. FcPublic int
  796. FcUcs4ToUtf8 (FcChar32 ucs4,
  797. FcChar8 dest[FC_UTF8_MAX_LEN]);
  798. FcPublic int
  799. FcUtf16ToUcs4 (const FcChar8 *src_orig,
  800. FcEndian endian,
  801. FcChar32 *dst,
  802. int len); /* in bytes */
  803. FcPublic FcBool
  804. FcUtf16Len (const FcChar8 *string,
  805. FcEndian endian,
  806. int len, /* in bytes */
  807. int *nchar,
  808. int *wchar);
  809. FcPublic FcChar8 *
  810. FcStrBuildFilename (const FcChar8 *path,
  811. ...);
  812. FcPublic FcChar8 *
  813. FcStrDirname (const FcChar8 *file);
  814. FcPublic FcChar8 *
  815. FcStrBasename (const FcChar8 *file);
  816. FcPublic FcStrSet *
  817. FcStrSetCreate (void);
  818. FcPublic FcBool
  819. FcStrSetMember (FcStrSet *set, const FcChar8 *s);
  820. FcPublic FcBool
  821. FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
  822. FcPublic FcBool
  823. FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
  824. FcPublic FcBool
  825. FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
  826. FcPublic FcBool
  827. FcStrSetDel (FcStrSet *set, const FcChar8 *s);
  828. FcPublic void
  829. FcStrSetDestroy (FcStrSet *set);
  830. FcPublic FcStrList *
  831. FcStrListCreate (FcStrSet *set);
  832. FcPublic void
  833. FcStrListFirst (FcStrList *list);
  834. FcPublic FcChar8 *
  835. FcStrListNext (FcStrList *list);
  836. FcPublic void
  837. FcStrListDone (FcStrList *list);
  838. /* fcxml.c */
  839. FcPublic FcBool
  840. FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
  841. FcPublic FcBool
  842. FcConfigParseAndLoadFromMemory (FcConfig *config,
  843. const FcChar8 *buffer,
  844. FcBool complain);
  845. _FCFUNCPROTOEND
  846. #undef FC_ATTRIBUTE_SENTINEL
  847. #ifndef _FCINT_H_
  848. /*
  849. * Deprecated functions are placed here to help users fix their code without
  850. * digging through documentation
  851. */
  852. #define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
  853. #define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
  854. #endif
  855. #endif /* _FONTCONFIG_H_ */