Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

964 lignes
23 KiB

  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 Keith Packard not be used in
  11. * advertising or publicity pertaining to distribution of the software without
  12. * specific, written prior permission. Keith Packard makes 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 <unistd.h>
  29. #include <stdarg.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 8
  49. #define FC_REVISION 0
  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 "3"
  61. #define FcTrue 1
  62. #define FcFalse 0
  63. #define FC_FAMILY "family" /* String */
  64. #define FC_STYLE "style" /* String */
  65. #define FC_SLANT "slant" /* Int */
  66. #define FC_WEIGHT "weight" /* Int */
  67. #define FC_SIZE "size" /* Double */
  68. #define FC_ASPECT "aspect" /* Double */
  69. #define FC_PIXEL_SIZE "pixelsize" /* Double */
  70. #define FC_SPACING "spacing" /* Int */
  71. #define FC_FOUNDRY "foundry" /* String */
  72. #define FC_ANTIALIAS "antialias" /* Bool (depends) */
  73. #define FC_HINTING "hinting" /* Bool (true) */
  74. #define FC_HINT_STYLE "hintstyle" /* Int */
  75. #define FC_VERTICAL_LAYOUT "verticallayout" /* Bool (false) */
  76. #define FC_AUTOHINT "autohint" /* Bool (false) */
  77. #define FC_GLOBAL_ADVANCE "globaladvance" /* Bool (true) */
  78. #define FC_WIDTH "width" /* Int */
  79. #define FC_FILE "file" /* String */
  80. #define FC_INDEX "index" /* Int */
  81. #define FC_FT_FACE "ftface" /* FT_Face */
  82. #define FC_RASTERIZER "rasterizer" /* String */
  83. #define FC_OUTLINE "outline" /* Bool */
  84. #define FC_SCALABLE "scalable" /* Bool */
  85. #define FC_SCALE "scale" /* double */
  86. #define FC_DPI "dpi" /* double */
  87. #define FC_RGBA "rgba" /* Int */
  88. #define FC_MINSPACE "minspace" /* Bool use minimum line spacing */
  89. #define FC_SOURCE "source" /* String (deprecated) */
  90. #define FC_CHARSET "charset" /* CharSet */
  91. #define FC_LANG "lang" /* String RFC 3066 langs */
  92. #define FC_FONTVERSION "fontversion" /* Int from 'head' table */
  93. #define FC_FULLNAME "fullname" /* String */
  94. #define FC_FAMILYLANG "familylang" /* String RFC 3066 langs */
  95. #define FC_STYLELANG "stylelang" /* String RFC 3066 langs */
  96. #define FC_FULLNAMELANG "fullnamelang" /* String RFC 3066 langs */
  97. #define FC_CAPABILITY "capability" /* String */
  98. #define FC_FONTFORMAT "fontformat" /* String */
  99. #define FC_EMBOLDEN "embolden" /* Bool - true if emboldening needed*/
  100. #define FC_EMBEDDED_BITMAP "embeddedbitmap" /* Bool - true to enable embedded bitmaps */
  101. #define FC_DECORATIVE "decorative" /* Bool - true if style is a decorative variant */
  102. #define FC_LCD_FILTER "lcdfilter" /* Int */
  103. #define FC_CACHE_SUFFIX ".cache-"FC_CACHE_VERSION
  104. #define FC_DIR_CACHE_FILE "fonts.cache-"FC_CACHE_VERSION
  105. #define FC_USER_CACHE_FILE ".fonts.cache-"FC_CACHE_VERSION
  106. /* Adjust outline rasterizer */
  107. #define FC_CHAR_WIDTH "charwidth" /* Int */
  108. #define FC_CHAR_HEIGHT "charheight"/* Int */
  109. #define FC_MATRIX "matrix" /* FcMatrix */
  110. #define FC_WEIGHT_THIN 0
  111. #define FC_WEIGHT_EXTRALIGHT 40
  112. #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
  113. #define FC_WEIGHT_LIGHT 50
  114. #define FC_WEIGHT_BOOK 75
  115. #define FC_WEIGHT_REGULAR 80
  116. #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
  117. #define FC_WEIGHT_MEDIUM 100
  118. #define FC_WEIGHT_DEMIBOLD 180
  119. #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
  120. #define FC_WEIGHT_BOLD 200
  121. #define FC_WEIGHT_EXTRABOLD 205
  122. #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
  123. #define FC_WEIGHT_BLACK 210
  124. #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
  125. #define FC_WEIGHT_EXTRABLACK 215
  126. #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
  127. #define FC_SLANT_ROMAN 0
  128. #define FC_SLANT_ITALIC 100
  129. #define FC_SLANT_OBLIQUE 110
  130. #define FC_WIDTH_ULTRACONDENSED 50
  131. #define FC_WIDTH_EXTRACONDENSED 63
  132. #define FC_WIDTH_CONDENSED 75
  133. #define FC_WIDTH_SEMICONDENSED 87
  134. #define FC_WIDTH_NORMAL 100
  135. #define FC_WIDTH_SEMIEXPANDED 113
  136. #define FC_WIDTH_EXPANDED 125
  137. #define FC_WIDTH_EXTRAEXPANDED 150
  138. #define FC_WIDTH_ULTRAEXPANDED 200
  139. #define FC_PROPORTIONAL 0
  140. #define FC_DUAL 90
  141. #define FC_MONO 100
  142. #define FC_CHARCELL 110
  143. /* sub-pixel order */
  144. #define FC_RGBA_UNKNOWN 0
  145. #define FC_RGBA_RGB 1
  146. #define FC_RGBA_BGR 2
  147. #define FC_RGBA_VRGB 3
  148. #define FC_RGBA_VBGR 4
  149. #define FC_RGBA_NONE 5
  150. /* hinting style */
  151. #define FC_HINT_NONE 0
  152. #define FC_HINT_SLIGHT 1
  153. #define FC_HINT_MEDIUM 2
  154. #define FC_HINT_FULL 3
  155. /* LCD filter */
  156. #define FC_LCD_NONE 0
  157. #define FC_LCD_DEFAULT 1
  158. #define FC_LCD_LIGHT 2
  159. #define FC_LCD_LEGACY 3
  160. typedef enum _FcType {
  161. FcTypeVoid,
  162. FcTypeInteger,
  163. FcTypeDouble,
  164. FcTypeString,
  165. FcTypeBool,
  166. FcTypeMatrix,
  167. FcTypeCharSet,
  168. FcTypeFTFace,
  169. FcTypeLangSet
  170. } FcType;
  171. typedef struct _FcMatrix {
  172. double xx, xy, yx, yy;
  173. } FcMatrix;
  174. #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
  175. (m)->xy = (m)->yx = 0)
  176. /*
  177. * A data structure to represent the available glyphs in a font.
  178. * This is represented as a sparse boolean btree.
  179. */
  180. typedef struct _FcCharSet FcCharSet;
  181. typedef struct _FcObjectType {
  182. const char *object;
  183. FcType type;
  184. } FcObjectType;
  185. typedef struct _FcConstant {
  186. const FcChar8 *name;
  187. const char *object;
  188. int value;
  189. } FcConstant;
  190. typedef enum _FcResult {
  191. FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
  192. FcResultOutOfMemory
  193. } FcResult;
  194. typedef struct _FcPattern FcPattern;
  195. typedef struct _FcLangSet FcLangSet;
  196. typedef struct _FcValue {
  197. FcType type;
  198. union {
  199. const FcChar8 *s;
  200. int i;
  201. FcBool b;
  202. double d;
  203. const FcMatrix *m;
  204. const FcCharSet *c;
  205. void *f;
  206. const FcLangSet *l;
  207. } u;
  208. } FcValue;
  209. typedef struct _FcFontSet {
  210. int nfont;
  211. int sfont;
  212. FcPattern **fonts;
  213. } FcFontSet;
  214. typedef struct _FcObjectSet {
  215. int nobject;
  216. int sobject;
  217. const char **objects;
  218. } FcObjectSet;
  219. typedef enum _FcMatchKind {
  220. FcMatchPattern, FcMatchFont, FcMatchScan
  221. } FcMatchKind;
  222. typedef enum _FcLangResult {
  223. FcLangEqual = 0,
  224. FcLangDifferentCountry = 1,
  225. FcLangDifferentTerritory = 1,
  226. FcLangDifferentLang = 2
  227. } FcLangResult;
  228. typedef enum _FcSetName {
  229. FcSetSystem = 0,
  230. FcSetApplication = 1
  231. } FcSetName;
  232. typedef struct _FcAtomic FcAtomic;
  233. #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
  234. #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
  235. #define _FCFUNCPROTOEND }
  236. #else
  237. #define _FCFUNCPROTOBEGIN
  238. #define _FCFUNCPROTOEND
  239. #endif
  240. typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
  241. typedef struct _FcConfig FcConfig;
  242. typedef struct _FcGlobalCache FcFileCache;
  243. typedef struct _FcBlanks FcBlanks;
  244. typedef struct _FcStrList FcStrList;
  245. typedef struct _FcStrSet FcStrSet;
  246. typedef struct _FcCache FcCache;
  247. _FCFUNCPROTOBEGIN
  248. /* fcblanks.c */
  249. FcPublic FcBlanks *
  250. FcBlanksCreate (void);
  251. FcPublic void
  252. FcBlanksDestroy (FcBlanks *b);
  253. FcPublic FcBool
  254. FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
  255. FcPublic FcBool
  256. FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
  257. /* fccache.c */
  258. FcPublic const FcChar8 *
  259. FcCacheDir(const FcCache *c);
  260. FcPublic FcFontSet *
  261. FcCacheCopySet(const FcCache *c);
  262. FcPublic const FcChar8 *
  263. FcCacheSubdir (const FcCache *c, int i);
  264. FcPublic int
  265. FcCacheNumSubdir (const FcCache *c);
  266. FcPublic int
  267. FcCacheNumFont (const FcCache *c);
  268. FcPublic FcBool
  269. FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
  270. FcPublic FcBool
  271. FcDirCacheValid (const FcChar8 *cache_file);
  272. /* fccfg.c */
  273. FcPublic FcChar8 *
  274. FcConfigHome (void);
  275. FcPublic FcBool
  276. FcConfigEnableHome (FcBool enable);
  277. FcPublic FcChar8 *
  278. FcConfigFilename (const FcChar8 *url);
  279. FcPublic FcConfig *
  280. FcConfigCreate (void);
  281. FcPublic FcConfig *
  282. FcConfigReference (FcConfig *config);
  283. FcPublic void
  284. FcConfigDestroy (FcConfig *config);
  285. FcPublic FcBool
  286. FcConfigSetCurrent (FcConfig *config);
  287. FcPublic FcConfig *
  288. FcConfigGetCurrent (void);
  289. FcPublic FcBool
  290. FcConfigUptoDate (FcConfig *config);
  291. FcPublic FcBool
  292. FcConfigBuildFonts (FcConfig *config);
  293. FcPublic FcStrList *
  294. FcConfigGetFontDirs (FcConfig *config);
  295. FcPublic FcStrList *
  296. FcConfigGetConfigDirs (FcConfig *config);
  297. FcPublic FcStrList *
  298. FcConfigGetConfigFiles (FcConfig *config);
  299. FcPublic FcChar8 *
  300. FcConfigGetCache (FcConfig *config);
  301. FcPublic FcBlanks *
  302. FcConfigGetBlanks (FcConfig *config);
  303. FcPublic FcStrList *
  304. FcConfigGetCacheDirs (FcConfig *config);
  305. FcPublic int
  306. FcConfigGetRescanInterval (FcConfig *config);
  307. FcPublic FcBool
  308. FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
  309. FcPublic FcFontSet *
  310. FcConfigGetFonts (FcConfig *config,
  311. FcSetName set);
  312. FcPublic FcBool
  313. FcConfigAppFontAddFile (FcConfig *config,
  314. const FcChar8 *file);
  315. FcPublic FcBool
  316. FcConfigAppFontAddDir (FcConfig *config,
  317. const FcChar8 *dir);
  318. FcPublic void
  319. FcConfigAppFontClear (FcConfig *config);
  320. FcPublic FcBool
  321. FcConfigSubstituteWithPat (FcConfig *config,
  322. FcPattern *p,
  323. FcPattern *p_pat,
  324. FcMatchKind kind);
  325. FcPublic FcBool
  326. FcConfigSubstitute (FcConfig *config,
  327. FcPattern *p,
  328. FcMatchKind kind);
  329. /* fccharset.c */
  330. FcPublic FcCharSet*
  331. FcCharSetCreate (void);
  332. /* deprecated alias for FcCharSetCreate */
  333. FcPublic FcCharSet *
  334. FcCharSetNew (void);
  335. FcPublic void
  336. FcCharSetDestroy (FcCharSet *fcs);
  337. FcPublic FcBool
  338. FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
  339. FcPublic FcCharSet*
  340. FcCharSetCopy (FcCharSet *src);
  341. FcPublic FcBool
  342. FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
  343. FcPublic FcCharSet*
  344. FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
  345. FcPublic FcCharSet*
  346. FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
  347. FcPublic FcCharSet*
  348. FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
  349. FcPublic FcBool
  350. FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
  351. FcPublic FcBool
  352. FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
  353. FcPublic FcChar32
  354. FcCharSetCount (const FcCharSet *a);
  355. FcPublic FcChar32
  356. FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
  357. FcPublic FcChar32
  358. FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
  359. FcPublic FcBool
  360. FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
  361. #define FC_CHARSET_MAP_SIZE (256/32)
  362. #define FC_CHARSET_DONE ((FcChar32) -1)
  363. FcPublic FcChar32
  364. FcCharSetFirstPage (const FcCharSet *a,
  365. FcChar32 map[FC_CHARSET_MAP_SIZE],
  366. FcChar32 *next);
  367. FcPublic FcChar32
  368. FcCharSetNextPage (const FcCharSet *a,
  369. FcChar32 map[FC_CHARSET_MAP_SIZE],
  370. FcChar32 *next);
  371. /*
  372. * old coverage API, rather hard to use correctly
  373. */
  374. FcPublic FcChar32
  375. FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
  376. /* fcdbg.c */
  377. FcPublic void
  378. FcValuePrint (const FcValue v);
  379. FcPublic void
  380. FcPatternPrint (const FcPattern *p);
  381. FcPublic void
  382. FcFontSetPrint (const FcFontSet *s);
  383. /* fcdefault.c */
  384. FcPublic void
  385. FcDefaultSubstitute (FcPattern *pattern);
  386. /* fcdir.c */
  387. FcPublic FcBool
  388. FcFileIsDir (const FcChar8 *file);
  389. FcPublic FcBool
  390. FcFileScan (FcFontSet *set,
  391. FcStrSet *dirs,
  392. FcFileCache *cache,
  393. FcBlanks *blanks,
  394. const FcChar8 *file,
  395. FcBool force);
  396. FcPublic FcBool
  397. FcDirScan (FcFontSet *set,
  398. FcStrSet *dirs,
  399. FcFileCache *cache,
  400. FcBlanks *blanks,
  401. const FcChar8 *dir,
  402. FcBool force);
  403. FcPublic FcBool
  404. FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
  405. FcPublic FcCache *
  406. FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
  407. FcPublic FcCache *
  408. FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
  409. FcPublic FcCache *
  410. FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
  411. FcPublic void
  412. FcDirCacheUnload (FcCache *cache);
  413. /* fcfreetype.c */
  414. FcPublic FcPattern *
  415. FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
  416. /* fcfs.c */
  417. FcPublic FcFontSet *
  418. FcFontSetCreate (void);
  419. FcPublic void
  420. FcFontSetDestroy (FcFontSet *s);
  421. FcPublic FcBool
  422. FcFontSetAdd (FcFontSet *s, FcPattern *font);
  423. /* fcinit.c */
  424. FcPublic FcConfig *
  425. FcInitLoadConfig (void);
  426. FcPublic FcConfig *
  427. FcInitLoadConfigAndFonts (void);
  428. FcPublic FcBool
  429. FcInit (void);
  430. FcPublic void
  431. FcFini (void);
  432. FcPublic int
  433. FcGetVersion (void);
  434. FcPublic FcBool
  435. FcInitReinitialize (void);
  436. FcPublic FcBool
  437. FcInitBringUptoDate (void);
  438. /* fclang.c */
  439. FcPublic FcStrSet *
  440. FcGetLangs (void);
  441. FcPublic const FcCharSet *
  442. FcLangGetCharSet (const FcChar8 *lang);
  443. FcPublic FcLangSet*
  444. FcLangSetCreate (void);
  445. FcPublic void
  446. FcLangSetDestroy (FcLangSet *ls);
  447. FcPublic FcLangSet*
  448. FcLangSetCopy (const FcLangSet *ls);
  449. FcPublic FcBool
  450. FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
  451. FcPublic FcLangResult
  452. FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
  453. FcPublic FcLangResult
  454. FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
  455. FcPublic FcBool
  456. FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
  457. FcPublic FcBool
  458. FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
  459. FcPublic FcChar32
  460. FcLangSetHash (const FcLangSet *ls);
  461. FcPublic FcStrSet *
  462. FcLangSetGetLangs (const FcLangSet *ls);
  463. /* fclist.c */
  464. FcPublic FcObjectSet *
  465. FcObjectSetCreate (void);
  466. FcPublic FcBool
  467. FcObjectSetAdd (FcObjectSet *os, const char *object);
  468. FcPublic void
  469. FcObjectSetDestroy (FcObjectSet *os);
  470. FcPublic FcObjectSet *
  471. FcObjectSetVaBuild (const char *first, va_list va);
  472. FcPublic FcObjectSet *
  473. FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
  474. FcPublic FcFontSet *
  475. FcFontSetList (FcConfig *config,
  476. FcFontSet **sets,
  477. int nsets,
  478. FcPattern *p,
  479. FcObjectSet *os);
  480. FcPublic FcFontSet *
  481. FcFontList (FcConfig *config,
  482. FcPattern *p,
  483. FcObjectSet *os);
  484. /* fcatomic.c */
  485. FcPublic FcAtomic *
  486. FcAtomicCreate (const FcChar8 *file);
  487. FcPublic FcBool
  488. FcAtomicLock (FcAtomic *atomic);
  489. FcPublic FcChar8 *
  490. FcAtomicNewFile (FcAtomic *atomic);
  491. FcPublic FcChar8 *
  492. FcAtomicOrigFile (FcAtomic *atomic);
  493. FcPublic FcBool
  494. FcAtomicReplaceOrig (FcAtomic *atomic);
  495. FcPublic void
  496. FcAtomicDeleteNew (FcAtomic *atomic);
  497. FcPublic void
  498. FcAtomicUnlock (FcAtomic *atomic);
  499. FcPublic void
  500. FcAtomicDestroy (FcAtomic *atomic);
  501. /* fcmatch.c */
  502. FcPublic FcPattern *
  503. FcFontSetMatch (FcConfig *config,
  504. FcFontSet **sets,
  505. int nsets,
  506. FcPattern *p,
  507. FcResult *result);
  508. FcPublic FcPattern *
  509. FcFontMatch (FcConfig *config,
  510. FcPattern *p,
  511. FcResult *result);
  512. FcPublic FcPattern *
  513. FcFontRenderPrepare (FcConfig *config,
  514. FcPattern *pat,
  515. FcPattern *font);
  516. FcPublic FcFontSet *
  517. FcFontSetSort (FcConfig *config,
  518. FcFontSet **sets,
  519. int nsets,
  520. FcPattern *p,
  521. FcBool trim,
  522. FcCharSet **csp,
  523. FcResult *result);
  524. FcPublic FcFontSet *
  525. FcFontSort (FcConfig *config,
  526. FcPattern *p,
  527. FcBool trim,
  528. FcCharSet **csp,
  529. FcResult *result);
  530. FcPublic void
  531. FcFontSetSortDestroy (FcFontSet *fs);
  532. /* fcmatrix.c */
  533. FcPublic FcMatrix *
  534. FcMatrixCopy (const FcMatrix *mat);
  535. FcPublic FcBool
  536. FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
  537. FcPublic void
  538. FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
  539. FcPublic void
  540. FcMatrixRotate (FcMatrix *m, double c, double s);
  541. FcPublic void
  542. FcMatrixScale (FcMatrix *m, double sx, double sy);
  543. FcPublic void
  544. FcMatrixShear (FcMatrix *m, double sh, double sv);
  545. /* fcname.c */
  546. FcPublic FcBool
  547. FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
  548. FcPublic FcBool
  549. FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
  550. FcPublic const FcObjectType *
  551. FcNameGetObjectType (const char *object);
  552. FcPublic FcBool
  553. FcNameRegisterConstants (const FcConstant *consts, int nconsts);
  554. FcPublic FcBool
  555. FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
  556. FcPublic const FcConstant *
  557. FcNameGetConstant (FcChar8 *string);
  558. FcPublic FcBool
  559. FcNameConstant (FcChar8 *string, int *result);
  560. FcPublic FcPattern *
  561. FcNameParse (const FcChar8 *name);
  562. FcPublic FcChar8 *
  563. FcNameUnparse (FcPattern *pat);
  564. /* fcpat.c */
  565. FcPublic FcPattern *
  566. FcPatternCreate (void);
  567. FcPublic FcPattern *
  568. FcPatternDuplicate (const FcPattern *p);
  569. FcPublic void
  570. FcPatternReference (FcPattern *p);
  571. FcPublic FcPattern *
  572. FcPatternFilter (FcPattern *p, const FcObjectSet *os);
  573. FcPublic void
  574. FcValueDestroy (FcValue v);
  575. FcPublic FcBool
  576. FcValueEqual (FcValue va, FcValue vb);
  577. FcPublic FcValue
  578. FcValueSave (FcValue v);
  579. FcPublic void
  580. FcPatternDestroy (FcPattern *p);
  581. FcPublic FcBool
  582. FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
  583. FcPublic FcBool
  584. FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
  585. FcPublic FcChar32
  586. FcPatternHash (const FcPattern *p);
  587. FcPublic FcBool
  588. FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
  589. FcPublic FcBool
  590. FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
  591. FcPublic FcResult
  592. FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
  593. FcPublic FcBool
  594. FcPatternDel (FcPattern *p, const char *object);
  595. FcPublic FcBool
  596. FcPatternRemove (FcPattern *p, const char *object, int id);
  597. FcPublic FcBool
  598. FcPatternAddInteger (FcPattern *p, const char *object, int i);
  599. FcPublic FcBool
  600. FcPatternAddDouble (FcPattern *p, const char *object, double d);
  601. FcPublic FcBool
  602. FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
  603. FcPublic FcBool
  604. FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
  605. FcPublic FcBool
  606. FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
  607. FcPublic FcBool
  608. FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
  609. FcPublic FcBool
  610. FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
  611. FcPublic FcResult
  612. FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
  613. FcPublic FcResult
  614. FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
  615. FcPublic FcResult
  616. FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
  617. FcPublic FcResult
  618. FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
  619. FcPublic FcResult
  620. FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
  621. FcPublic FcResult
  622. FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
  623. FcPublic FcResult
  624. FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
  625. FcPublic FcPattern *
  626. FcPatternVaBuild (FcPattern *p, va_list va);
  627. FcPublic FcPattern *
  628. FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
  629. FcPublic FcChar8 *
  630. FcPatternFormat (FcPattern *pat, const FcChar8 *format);
  631. /* fcstr.c */
  632. FcPublic FcChar8 *
  633. FcStrCopy (const FcChar8 *s);
  634. FcPublic FcChar8 *
  635. FcStrCopyFilename (const FcChar8 *s);
  636. FcPublic FcChar8 *
  637. FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
  638. FcPublic void
  639. FcStrFree (FcChar8 *s);
  640. /* These are ASCII only, suitable only for pattern element names */
  641. #define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132))
  642. #define FcIsLower(c) ((0141 <= (c) && (c) <= 0172))
  643. #define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
  644. FcPublic FcChar8 *
  645. FcStrDowncase (const FcChar8 *s);
  646. FcPublic int
  647. FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  648. FcPublic int
  649. FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
  650. FcPublic const FcChar8 *
  651. FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  652. FcPublic const FcChar8 *
  653. FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
  654. FcPublic int
  655. FcUtf8ToUcs4 (const FcChar8 *src_orig,
  656. FcChar32 *dst,
  657. int len);
  658. FcPublic FcBool
  659. FcUtf8Len (const FcChar8 *string,
  660. int len,
  661. int *nchar,
  662. int *wchar);
  663. #define FC_UTF8_MAX_LEN 6
  664. FcPublic int
  665. FcUcs4ToUtf8 (FcChar32 ucs4,
  666. FcChar8 dest[FC_UTF8_MAX_LEN]);
  667. FcPublic int
  668. FcUtf16ToUcs4 (const FcChar8 *src_orig,
  669. FcEndian endian,
  670. FcChar32 *dst,
  671. int len); /* in bytes */
  672. FcPublic FcBool
  673. FcUtf16Len (const FcChar8 *string,
  674. FcEndian endian,
  675. int len, /* in bytes */
  676. int *nchar,
  677. int *wchar);
  678. FcPublic FcChar8 *
  679. FcStrDirname (const FcChar8 *file);
  680. FcPublic FcChar8 *
  681. FcStrBasename (const FcChar8 *file);
  682. FcPublic FcStrSet *
  683. FcStrSetCreate (void);
  684. FcPublic FcBool
  685. FcStrSetMember (FcStrSet *set, const FcChar8 *s);
  686. FcPublic FcBool
  687. FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
  688. FcPublic FcBool
  689. FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
  690. FcPublic FcBool
  691. FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
  692. FcPublic FcBool
  693. FcStrSetDel (FcStrSet *set, const FcChar8 *s);
  694. FcPublic void
  695. FcStrSetDestroy (FcStrSet *set);
  696. FcPublic FcStrList *
  697. FcStrListCreate (FcStrSet *set);
  698. FcPublic FcChar8 *
  699. FcStrListNext (FcStrList *list);
  700. FcPublic void
  701. FcStrListDone (FcStrList *list);
  702. /* fcxml.c */
  703. FcPublic FcBool
  704. FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
  705. _FCFUNCPROTOEND
  706. #undef FC_ATTRIBUTE_SENTINEL
  707. #ifndef _FCINT_H_
  708. /*
  709. * Deprecated functions are placed here to help users fix their code without
  710. * digging through documentation
  711. */
  712. #define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
  713. #define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
  714. #endif
  715. #endif /* _FONTCONFIG_H_ */