fontconfig.h 25 KB

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