fontconfig.h 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160
  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 15
  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_NUMBER 9
  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_ORDER "order" /* Integer */
  119. #define FC_DESKTOP_NAME "desktop" /* String */
  120. #define FC_NAMED_INSTANCE "namedinstance" /* Bool - true if font is named instance */
  121. #define FC_FONT_WRAPPER "fontwrapper" /* String */
  122. #define FC_CACHE_SUFFIX ".cache-" FC_CACHE_VERSION
  123. #define FC_DIR_CACHE_FILE "fonts.cache-" FC_CACHE_VERSION
  124. #define FC_USER_CACHE_FILE ".fonts.cache-" FC_CACHE_VERSION
  125. /* Adjust outline rasterizer */
  126. #define FC_CHARWIDTH "charwidth" /* Int */
  127. #define FC_CHAR_WIDTH FC_CHARWIDTH
  128. #define FC_CHAR_HEIGHT "charheight"/* Int */
  129. #define FC_MATRIX "matrix" /* FcMatrix */
  130. #define FC_WEIGHT_THIN 0
  131. #define FC_WEIGHT_EXTRALIGHT 40
  132. #define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
  133. #define FC_WEIGHT_LIGHT 50
  134. #define FC_WEIGHT_DEMILIGHT 55
  135. #define FC_WEIGHT_SEMILIGHT FC_WEIGHT_DEMILIGHT
  136. #define FC_WEIGHT_BOOK 75
  137. #define FC_WEIGHT_REGULAR 80
  138. #define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
  139. #define FC_WEIGHT_MEDIUM 100
  140. #define FC_WEIGHT_DEMIBOLD 180
  141. #define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
  142. #define FC_WEIGHT_BOLD 200
  143. #define FC_WEIGHT_EXTRABOLD 205
  144. #define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
  145. #define FC_WEIGHT_BLACK 210
  146. #define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
  147. #define FC_WEIGHT_EXTRABLACK 215
  148. #define FC_WEIGHT_ULTRABLACK FC_WEIGHT_EXTRABLACK
  149. #define FC_SLANT_ROMAN 0
  150. #define FC_SLANT_ITALIC 100
  151. #define FC_SLANT_OBLIQUE 110
  152. #define FC_WIDTH_ULTRACONDENSED 50
  153. #define FC_WIDTH_EXTRACONDENSED 63
  154. #define FC_WIDTH_CONDENSED 75
  155. #define FC_WIDTH_SEMICONDENSED 87
  156. #define FC_WIDTH_NORMAL 100
  157. #define FC_WIDTH_SEMIEXPANDED 113
  158. #define FC_WIDTH_EXPANDED 125
  159. #define FC_WIDTH_EXTRAEXPANDED 150
  160. #define FC_WIDTH_ULTRAEXPANDED 200
  161. #define FC_PROPORTIONAL 0
  162. #define FC_DUAL 90
  163. #define FC_MONO 100
  164. #define FC_CHARCELL 110
  165. /* sub-pixel order */
  166. #define FC_RGBA_UNKNOWN 0
  167. #define FC_RGBA_RGB 1
  168. #define FC_RGBA_BGR 2
  169. #define FC_RGBA_VRGB 3
  170. #define FC_RGBA_VBGR 4
  171. #define FC_RGBA_NONE 5
  172. /* hinting style */
  173. #define FC_HINT_NONE 0
  174. #define FC_HINT_SLIGHT 1
  175. #define FC_HINT_MEDIUM 2
  176. #define FC_HINT_FULL 3
  177. /* LCD filter */
  178. #define FC_LCD_NONE 0
  179. #define FC_LCD_DEFAULT 1
  180. #define FC_LCD_LIGHT 2
  181. #define FC_LCD_LEGACY 3
  182. typedef enum _FcType {
  183. FcTypeUnknown = -1,
  184. FcTypeVoid,
  185. FcTypeInteger,
  186. FcTypeDouble,
  187. FcTypeString,
  188. FcTypeBool,
  189. FcTypeMatrix,
  190. FcTypeCharSet,
  191. FcTypeFTFace,
  192. FcTypeLangSet,
  193. FcTypeRange
  194. } FcType;
  195. typedef struct _FcMatrix {
  196. double xx, xy, yx, yy;
  197. } FcMatrix;
  198. #define FcMatrixInit(m) ((m)->xx = (m)->yy = 1, \
  199. (m)->xy = (m)->yx = 0)
  200. /*
  201. * A data structure to represent the available glyphs in a font.
  202. * This is represented as a sparse boolean btree.
  203. */
  204. typedef struct _FcCharSet FcCharSet;
  205. typedef struct _FcObjectType {
  206. char *object;
  207. FcType type;
  208. } FcObjectType;
  209. typedef struct _FcConstant {
  210. const FcChar8 *name;
  211. const char *object;
  212. int value;
  213. } FcConstant;
  214. typedef enum _FcResult {
  215. FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId,
  216. FcResultOutOfMemory
  217. } FcResult;
  218. typedef enum _FcValueBinding {
  219. FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
  220. /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
  221. FcValueBindingEnd = INT_MAX
  222. } FcValueBinding;
  223. typedef struct _FcPattern FcPattern;
  224. typedef struct _FcPatternIter {
  225. void *dummy1;
  226. void *dummy2;
  227. } FcPatternIter;
  228. typedef struct _FcLangSet FcLangSet;
  229. typedef struct _FcRange FcRange;
  230. typedef struct _FcValue {
  231. FcType type;
  232. union {
  233. const FcChar8 *s;
  234. int i;
  235. FcBool b;
  236. double d;
  237. const FcMatrix *m;
  238. const FcCharSet *c;
  239. void *f;
  240. const FcLangSet *l;
  241. const FcRange *r;
  242. } u;
  243. } FcValue;
  244. typedef struct _FcFontSet {
  245. int nfont;
  246. int sfont;
  247. FcPattern **fonts;
  248. } FcFontSet;
  249. typedef struct _FcObjectSet {
  250. int nobject;
  251. int sobject;
  252. const char **objects;
  253. } FcObjectSet;
  254. typedef enum _FcMatchKind {
  255. FcMatchPattern, FcMatchFont, FcMatchScan,
  256. FcMatchKindEnd,
  257. FcMatchKindBegin = FcMatchPattern
  258. } FcMatchKind;
  259. typedef enum _FcLangResult {
  260. FcLangEqual = 0,
  261. FcLangDifferentCountry = 1,
  262. FcLangDifferentTerritory = 1,
  263. FcLangDifferentLang = 2
  264. } FcLangResult;
  265. typedef enum _FcSetName {
  266. FcSetSystem = 0,
  267. FcSetApplication = 1
  268. } FcSetName;
  269. typedef struct _FcConfigFileInfoIter {
  270. void *dummy1;
  271. void *dummy2;
  272. void *dummy3;
  273. } FcConfigFileInfoIter;
  274. typedef struct _FcAtomic FcAtomic;
  275. #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */
  276. #define _FCFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
  277. #define _FCFUNCPROTOEND }
  278. #else
  279. #define _FCFUNCPROTOBEGIN
  280. #define _FCFUNCPROTOEND
  281. #endif
  282. typedef enum { FcEndianBig, FcEndianLittle } FcEndian;
  283. typedef struct _FcConfig FcConfig;
  284. typedef struct _FcGlobalCache FcFileCache;
  285. typedef struct _FcBlanks FcBlanks;
  286. typedef struct _FcStrList FcStrList;
  287. typedef struct _FcStrSet FcStrSet;
  288. typedef struct _FcCache FcCache;
  289. _FCFUNCPROTOBEGIN
  290. /* fcblanks.c */
  291. FcPublic FcBlanks *
  292. FcBlanksCreate (void);
  293. FcPublic void
  294. FcBlanksDestroy (FcBlanks *b);
  295. FcPublic FcBool
  296. FcBlanksAdd (FcBlanks *b, FcChar32 ucs4);
  297. FcPublic FcBool
  298. FcBlanksIsMember (FcBlanks *b, FcChar32 ucs4);
  299. /* fccache.c */
  300. FcPublic const FcChar8 *
  301. FcCacheDir(const FcCache *c);
  302. FcPublic FcFontSet *
  303. FcCacheCopySet(const FcCache *c);
  304. FcPublic const FcChar8 *
  305. FcCacheSubdir (const FcCache *c, int i);
  306. FcPublic int
  307. FcCacheNumSubdir (const FcCache *c);
  308. FcPublic int
  309. FcCacheNumFont (const FcCache *c);
  310. FcPublic FcBool
  311. FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);
  312. FcPublic FcBool
  313. FcDirCacheValid (const FcChar8 *cache_file);
  314. FcPublic FcBool
  315. FcDirCacheClean (const FcChar8 *cache_dir, FcBool verbose);
  316. FcPublic void
  317. FcCacheCreateTagFile (FcConfig *config);
  318. FcPublic FcBool
  319. FcDirCacheCreateUUID (FcChar8 *dir,
  320. FcBool force,
  321. FcConfig *config);
  322. FcPublic FcBool
  323. FcDirCacheDeleteUUID (const FcChar8 *dir,
  324. FcConfig *config);
  325. /* fccfg.c */
  326. FcPublic FcChar8 *
  327. FcConfigHome (void);
  328. FcPublic FcBool
  329. FcConfigEnableHome (FcBool enable);
  330. FcPublic FcChar8 *
  331. FcConfigGetFilename (FcConfig *config,
  332. const FcChar8 *url);
  333. FcPublic FcChar8 *
  334. FcConfigFilename (const FcChar8 *url);
  335. FcPublic FcConfig *
  336. FcConfigCreate (void);
  337. FcPublic FcConfig *
  338. FcConfigReference (FcConfig *config);
  339. FcPublic void
  340. FcConfigDestroy (FcConfig *config);
  341. FcPublic FcBool
  342. FcConfigSetCurrent (FcConfig *config);
  343. FcPublic FcConfig *
  344. FcConfigGetCurrent (void);
  345. FcPublic FcBool
  346. FcConfigUptoDate (FcConfig *config);
  347. FcPublic FcBool
  348. FcConfigBuildFonts (FcConfig *config);
  349. FcPublic FcStrList *
  350. FcConfigGetFontDirs (FcConfig *config);
  351. FcPublic FcStrList *
  352. FcConfigGetConfigDirs (FcConfig *config);
  353. FcPublic FcStrList *
  354. FcConfigGetConfigFiles (FcConfig *config);
  355. FcPublic FcChar8 *
  356. FcConfigGetCache (FcConfig *config);
  357. FcPublic FcBlanks *
  358. FcConfigGetBlanks (FcConfig *config);
  359. FcPublic FcStrList *
  360. FcConfigGetCacheDirs (FcConfig *config);
  361. FcPublic int
  362. FcConfigGetRescanInterval (FcConfig *config);
  363. FcPublic FcBool
  364. FcConfigSetRescanInterval (FcConfig *config, int rescanInterval);
  365. FcPublic FcFontSet *
  366. FcConfigGetFonts (FcConfig *config,
  367. FcSetName set);
  368. FcPublic FcBool
  369. FcConfigAppFontAddFile (FcConfig *config,
  370. const FcChar8 *file);
  371. FcPublic FcBool
  372. FcConfigAppFontAddDir (FcConfig *config,
  373. const FcChar8 *dir);
  374. FcPublic void
  375. FcConfigAppFontClear (FcConfig *config);
  376. FcPublic FcBool
  377. FcConfigSubstituteWithPat (FcConfig *config,
  378. FcPattern *p,
  379. FcPattern *p_pat,
  380. FcMatchKind kind);
  381. FcPublic FcBool
  382. FcConfigSubstitute (FcConfig *config,
  383. FcPattern *p,
  384. FcMatchKind kind);
  385. FcPublic const FcChar8 *
  386. FcConfigGetSysRoot (const FcConfig *config);
  387. FcPublic void
  388. FcConfigSetSysRoot (FcConfig *config,
  389. const FcChar8 *sysroot);
  390. FcPublic void
  391. FcConfigFileInfoIterInit (FcConfig *config,
  392. FcConfigFileInfoIter *iter);
  393. FcPublic FcBool
  394. FcConfigFileInfoIterNext (FcConfig *config,
  395. FcConfigFileInfoIter *iter);
  396. FcPublic FcBool
  397. FcConfigFileInfoIterGet (FcConfig *config,
  398. FcConfigFileInfoIter *iter,
  399. FcChar8 **name,
  400. FcChar8 **description,
  401. FcBool *enabled);
  402. /* fccharset.c */
  403. FcPublic FcCharSet*
  404. FcCharSetCreate (void);
  405. /* deprecated alias for FcCharSetCreate */
  406. FcPublic FcCharSet *
  407. FcCharSetNew (void);
  408. FcPublic void
  409. FcCharSetDestroy (FcCharSet *fcs);
  410. FcPublic FcBool
  411. FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
  412. FcPublic FcBool
  413. FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
  414. FcPublic FcCharSet*
  415. FcCharSetCopy (FcCharSet *src);
  416. FcPublic FcBool
  417. FcCharSetEqual (const FcCharSet *a, const FcCharSet *b);
  418. FcPublic FcCharSet*
  419. FcCharSetIntersect (const FcCharSet *a, const FcCharSet *b);
  420. FcPublic FcCharSet*
  421. FcCharSetUnion (const FcCharSet *a, const FcCharSet *b);
  422. FcPublic FcCharSet*
  423. FcCharSetSubtract (const FcCharSet *a, const FcCharSet *b);
  424. FcPublic FcBool
  425. FcCharSetMerge (FcCharSet *a, const FcCharSet *b, FcBool *changed);
  426. FcPublic FcBool
  427. FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4);
  428. FcPublic FcChar32
  429. FcCharSetCount (const FcCharSet *a);
  430. FcPublic FcChar32
  431. FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b);
  432. FcPublic FcChar32
  433. FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b);
  434. FcPublic FcBool
  435. FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b);
  436. #define FC_CHARSET_MAP_SIZE (256/32)
  437. #define FC_CHARSET_DONE ((FcChar32) -1)
  438. FcPublic FcChar32
  439. FcCharSetFirstPage (const FcCharSet *a,
  440. FcChar32 map[FC_CHARSET_MAP_SIZE],
  441. FcChar32 *next);
  442. FcPublic FcChar32
  443. FcCharSetNextPage (const FcCharSet *a,
  444. FcChar32 map[FC_CHARSET_MAP_SIZE],
  445. FcChar32 *next);
  446. /*
  447. * old coverage API, rather hard to use correctly
  448. */
  449. FcPublic FcChar32
  450. FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result);
  451. /* fcdbg.c */
  452. FcPublic void
  453. FcValuePrint (const FcValue v);
  454. FcPublic void
  455. FcPatternPrint (const FcPattern *p);
  456. FcPublic void
  457. FcFontSetPrint (const FcFontSet *s);
  458. /* fcdefault.c */
  459. FcPublic FcStrSet *
  460. FcGetDefaultLangs (void);
  461. FcPublic void
  462. FcDefaultSubstitute (FcPattern *pattern);
  463. /* fcdir.c */
  464. FcPublic FcBool
  465. FcFileIsDir (const FcChar8 *file);
  466. FcPublic FcBool
  467. FcFileScan (FcFontSet *set,
  468. FcStrSet *dirs,
  469. FcFileCache *cache,
  470. FcBlanks *blanks,
  471. const FcChar8 *file,
  472. FcBool force);
  473. FcPublic FcBool
  474. FcDirScan (FcFontSet *set,
  475. FcStrSet *dirs,
  476. FcFileCache *cache,
  477. FcBlanks *blanks,
  478. const FcChar8 *dir,
  479. FcBool force);
  480. FcPublic FcBool
  481. FcDirSave (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir);
  482. FcPublic FcCache *
  483. FcDirCacheLoad (const FcChar8 *dir, FcConfig *config, FcChar8 **cache_file);
  484. FcPublic FcCache *
  485. FcDirCacheRescan (const FcChar8 *dir, FcConfig *config);
  486. FcPublic FcCache *
  487. FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config);
  488. FcPublic FcCache *
  489. FcDirCacheLoadFile (const FcChar8 *cache_file, struct stat *file_stat);
  490. FcPublic void
  491. FcDirCacheUnload (FcCache *cache);
  492. /* fcfreetype.c */
  493. FcPublic FcPattern *
  494. FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
  495. FcPublic unsigned int
  496. FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
  497. /* fcfs.c */
  498. FcPublic FcFontSet *
  499. FcFontSetCreate (void);
  500. FcPublic void
  501. FcFontSetDestroy (FcFontSet *s);
  502. FcPublic FcBool
  503. FcFontSetAdd (FcFontSet *s, FcPattern *font);
  504. /* fcinit.c */
  505. FcPublic FcConfig *
  506. FcInitLoadConfig (void);
  507. FcPublic FcConfig *
  508. FcInitLoadConfigAndFonts (void);
  509. FcPublic FcBool
  510. FcInit (void);
  511. FcPublic void
  512. FcFini (void);
  513. FcPublic int
  514. FcGetVersion (void);
  515. FcPublic FcBool
  516. FcInitReinitialize (void);
  517. FcPublic FcBool
  518. FcInitBringUptoDate (void);
  519. /* fclang.c */
  520. FcPublic FcStrSet *
  521. FcGetLangs (void);
  522. FcPublic FcChar8 *
  523. FcLangNormalize (const FcChar8 *lang);
  524. FcPublic const FcCharSet *
  525. FcLangGetCharSet (const FcChar8 *lang);
  526. FcPublic FcLangSet*
  527. FcLangSetCreate (void);
  528. FcPublic void
  529. FcLangSetDestroy (FcLangSet *ls);
  530. FcPublic FcLangSet*
  531. FcLangSetCopy (const FcLangSet *ls);
  532. FcPublic FcBool
  533. FcLangSetAdd (FcLangSet *ls, const FcChar8 *lang);
  534. FcPublic FcBool
  535. FcLangSetDel (FcLangSet *ls, const FcChar8 *lang);
  536. FcPublic FcLangResult
  537. FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang);
  538. FcPublic FcLangResult
  539. FcLangSetCompare (const FcLangSet *lsa, const FcLangSet *lsb);
  540. FcPublic FcBool
  541. FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb);
  542. FcPublic FcBool
  543. FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
  544. FcPublic FcChar32
  545. FcLangSetHash (const FcLangSet *ls);
  546. FcPublic FcStrSet *
  547. FcLangSetGetLangs (const FcLangSet *ls);
  548. FcPublic FcLangSet *
  549. FcLangSetUnion (const FcLangSet *a, const FcLangSet *b);
  550. FcPublic FcLangSet *
  551. FcLangSetSubtract (const FcLangSet *a, const FcLangSet *b);
  552. /* fclist.c */
  553. FcPublic FcObjectSet *
  554. FcObjectSetCreate (void);
  555. FcPublic FcBool
  556. FcObjectSetAdd (FcObjectSet *os, const char *object);
  557. FcPublic void
  558. FcObjectSetDestroy (FcObjectSet *os);
  559. FcPublic FcObjectSet *
  560. FcObjectSetVaBuild (const char *first, va_list va);
  561. FcPublic FcObjectSet *
  562. FcObjectSetBuild (const char *first, ...) FC_ATTRIBUTE_SENTINEL(0);
  563. FcPublic FcFontSet *
  564. FcFontSetList (FcConfig *config,
  565. FcFontSet **sets,
  566. int nsets,
  567. FcPattern *p,
  568. FcObjectSet *os);
  569. FcPublic FcFontSet *
  570. FcFontList (FcConfig *config,
  571. FcPattern *p,
  572. FcObjectSet *os);
  573. /* fcatomic.c */
  574. FcPublic FcAtomic *
  575. FcAtomicCreate (const FcChar8 *file);
  576. FcPublic FcBool
  577. FcAtomicLock (FcAtomic *atomic);
  578. FcPublic FcChar8 *
  579. FcAtomicNewFile (FcAtomic *atomic);
  580. FcPublic FcChar8 *
  581. FcAtomicOrigFile (FcAtomic *atomic);
  582. FcPublic FcBool
  583. FcAtomicReplaceOrig (FcAtomic *atomic);
  584. FcPublic void
  585. FcAtomicDeleteNew (FcAtomic *atomic);
  586. FcPublic void
  587. FcAtomicUnlock (FcAtomic *atomic);
  588. FcPublic void
  589. FcAtomicDestroy (FcAtomic *atomic);
  590. /* fcmatch.c */
  591. FcPublic FcPattern *
  592. FcFontSetMatch (FcConfig *config,
  593. FcFontSet **sets,
  594. int nsets,
  595. FcPattern *p,
  596. FcResult *result);
  597. FcPublic FcPattern *
  598. FcFontMatch (FcConfig *config,
  599. FcPattern *p,
  600. FcResult *result);
  601. FcPublic FcPattern *
  602. FcFontRenderPrepare (FcConfig *config,
  603. FcPattern *pat,
  604. FcPattern *font);
  605. FcPublic FcFontSet *
  606. FcFontSetSort (FcConfig *config,
  607. FcFontSet **sets,
  608. int nsets,
  609. FcPattern *p,
  610. FcBool trim,
  611. FcCharSet **csp,
  612. FcResult *result);
  613. FcPublic FcFontSet *
  614. FcFontSort (FcConfig *config,
  615. FcPattern *p,
  616. FcBool trim,
  617. FcCharSet **csp,
  618. FcResult *result);
  619. FcPublic void
  620. FcFontSetSortDestroy (FcFontSet *fs);
  621. /* fcmatrix.c */
  622. FcPublic FcMatrix *
  623. FcMatrixCopy (const FcMatrix *mat);
  624. FcPublic FcBool
  625. FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2);
  626. FcPublic void
  627. FcMatrixMultiply (FcMatrix *result, const FcMatrix *a, const FcMatrix *b);
  628. FcPublic void
  629. FcMatrixRotate (FcMatrix *m, double c, double s);
  630. FcPublic void
  631. FcMatrixScale (FcMatrix *m, double sx, double sy);
  632. FcPublic void
  633. FcMatrixShear (FcMatrix *m, double sh, double sv);
  634. /* fcname.c */
  635. /* Deprecated. Does nothing. Returns FcFalse. */
  636. FcPublic FcBool
  637. FcNameRegisterObjectTypes (const FcObjectType *types, int ntype);
  638. /* Deprecated. Does nothing. Returns FcFalse. */
  639. FcPublic FcBool
  640. FcNameUnregisterObjectTypes (const FcObjectType *types, int ntype);
  641. FcPublic const FcObjectType *
  642. FcNameGetObjectType (const char *object);
  643. /* Deprecated. Does nothing. Returns FcFalse. */
  644. FcPublic FcBool
  645. FcNameRegisterConstants (const FcConstant *consts, int nconsts);
  646. /* Deprecated. Does nothing. Returns FcFalse. */
  647. FcPublic FcBool
  648. FcNameUnregisterConstants (const FcConstant *consts, int nconsts);
  649. FcPublic const FcConstant *
  650. FcNameGetConstant (const FcChar8 *string);
  651. FcPublic const FcConstant *
  652. FcNameGetConstantFor (const FcChar8 *string, const char *object);
  653. FcPublic FcBool
  654. FcNameConstant (const FcChar8 *string, int *result);
  655. FcPublic FcPattern *
  656. FcNameParse (const FcChar8 *name);
  657. FcPublic FcChar8 *
  658. FcNameUnparse (FcPattern *pat);
  659. /* fcpat.c */
  660. FcPublic FcPattern *
  661. FcPatternCreate (void);
  662. FcPublic FcPattern *
  663. FcPatternDuplicate (const FcPattern *p);
  664. FcPublic void
  665. FcPatternReference (FcPattern *p);
  666. FcPublic FcPattern *
  667. FcPatternFilter (FcPattern *p, const FcObjectSet *os);
  668. FcPublic void
  669. FcValueDestroy (FcValue v);
  670. FcPublic FcBool
  671. FcValueEqual (FcValue va, FcValue vb);
  672. FcPublic FcValue
  673. FcValueSave (FcValue v);
  674. FcPublic void
  675. FcPatternDestroy (FcPattern *p);
  676. int
  677. FcPatternObjectCount (const FcPattern *pat);
  678. FcPublic FcBool
  679. FcPatternEqual (const FcPattern *pa, const FcPattern *pb);
  680. FcPublic FcBool
  681. FcPatternEqualSubset (const FcPattern *pa, const FcPattern *pb, const FcObjectSet *os);
  682. FcPublic FcChar32
  683. FcPatternHash (const FcPattern *p);
  684. FcPublic FcBool
  685. FcPatternAdd (FcPattern *p, const char *object, FcValue value, FcBool append);
  686. FcPublic FcBool
  687. FcPatternAddWeak (FcPattern *p, const char *object, FcValue value, FcBool append);
  688. FcPublic FcResult
  689. FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v);
  690. FcPublic FcResult
  691. FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b);
  692. FcPublic FcBool
  693. FcPatternDel (FcPattern *p, const char *object);
  694. FcPublic FcBool
  695. FcPatternRemove (FcPattern *p, const char *object, int id);
  696. FcPublic FcBool
  697. FcPatternAddInteger (FcPattern *p, const char *object, int i);
  698. FcPublic FcBool
  699. FcPatternAddDouble (FcPattern *p, const char *object, double d);
  700. FcPublic FcBool
  701. FcPatternAddString (FcPattern *p, const char *object, const FcChar8 *s);
  702. FcPublic FcBool
  703. FcPatternAddMatrix (FcPattern *p, const char *object, const FcMatrix *s);
  704. FcPublic FcBool
  705. FcPatternAddCharSet (FcPattern *p, const char *object, const FcCharSet *c);
  706. FcPublic FcBool
  707. FcPatternAddBool (FcPattern *p, const char *object, FcBool b);
  708. FcPublic FcBool
  709. FcPatternAddLangSet (FcPattern *p, const char *object, const FcLangSet *ls);
  710. FcPublic FcBool
  711. FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r);
  712. FcPublic FcResult
  713. FcPatternGetInteger (const FcPattern *p, const char *object, int n, int *i);
  714. FcPublic FcResult
  715. FcPatternGetDouble (const FcPattern *p, const char *object, int n, double *d);
  716. FcPublic FcResult
  717. FcPatternGetString (const FcPattern *p, const char *object, int n, FcChar8 ** s);
  718. FcPublic FcResult
  719. FcPatternGetMatrix (const FcPattern *p, const char *object, int n, FcMatrix **s);
  720. FcPublic FcResult
  721. FcPatternGetCharSet (const FcPattern *p, const char *object, int n, FcCharSet **c);
  722. FcPublic FcResult
  723. FcPatternGetBool (const FcPattern *p, const char *object, int n, FcBool *b);
  724. FcPublic FcResult
  725. FcPatternGetLangSet (const FcPattern *p, const char *object, int n, FcLangSet **ls);
  726. FcPublic FcResult
  727. FcPatternGetRange (const FcPattern *p, const char *object, int id, FcRange **r);
  728. FcPublic FcPattern *
  729. FcPatternVaBuild (FcPattern *p, va_list va);
  730. FcPublic FcPattern *
  731. FcPatternBuild (FcPattern *p, ...) FC_ATTRIBUTE_SENTINEL(0);
  732. FcPublic FcChar8 *
  733. FcPatternFormat (FcPattern *pat, const FcChar8 *format);
  734. /* fcrange.c */
  735. FcPublic FcRange *
  736. FcRangeCreateDouble (double begin, double end);
  737. FcPublic FcRange *
  738. FcRangeCreateInteger (FcChar32 begin, FcChar32 end);
  739. FcPublic void
  740. FcRangeDestroy (FcRange *range);
  741. FcPublic FcRange *
  742. FcRangeCopy (const FcRange *r);
  743. FcPublic FcBool
  744. FcRangeGetDouble(const FcRange *range, double *begin, double *end);
  745. FcPublic void
  746. FcPatternIterStart (const FcPattern *pat, FcPatternIter *iter);
  747. FcPublic FcBool
  748. FcPatternIterNext (const FcPattern *pat, FcPatternIter *iter);
  749. FcPublic FcBool
  750. FcPatternIterEqual (const FcPattern *p1, FcPatternIter *i1,
  751. const FcPattern *p2, FcPatternIter *i2);
  752. FcPublic FcBool
  753. FcPatternFindIter (const FcPattern *pat, FcPatternIter *iter, const char *object);
  754. FcPublic FcBool
  755. FcPatternIterIsValid (const FcPattern *pat, FcPatternIter *iter);
  756. FcPublic const char *
  757. FcPatternIterGetObject (const FcPattern *pat, FcPatternIter *iter);
  758. FcPublic int
  759. FcPatternIterValueCount (const FcPattern *pat, FcPatternIter *iter);
  760. FcPublic FcResult
  761. FcPatternIterGetValue (const FcPattern *pat, FcPatternIter *iter, int id, FcValue *v, FcValueBinding *b);
  762. /* fcweight.c */
  763. FcPublic int
  764. FcWeightFromOpenType (int ot_weight);
  765. FcPublic double
  766. FcWeightFromOpenTypeDouble (double ot_weight);
  767. FcPublic int
  768. FcWeightToOpenType (int fc_weight);
  769. FcPublic double
  770. FcWeightToOpenTypeDouble (double fc_weight);
  771. /* fcstr.c */
  772. FcPublic FcChar8 *
  773. FcStrCopy (const FcChar8 *s);
  774. FcPublic FcChar8 *
  775. FcStrCopyFilename (const FcChar8 *s);
  776. FcPublic FcChar8 *
  777. FcStrPlus (const FcChar8 *s1, const FcChar8 *s2);
  778. FcPublic void
  779. FcStrFree (FcChar8 *s);
  780. /* These are ASCII only, suitable only for pattern element names */
  781. #define FcIsUpper(c) ((0101 <= (c) && (c) <= 0132))
  782. #define FcIsLower(c) ((0141 <= (c) && (c) <= 0172))
  783. #define FcToLower(c) (FcIsUpper(c) ? (c) - 0101 + 0141 : (c))
  784. FcPublic FcChar8 *
  785. FcStrDowncase (const FcChar8 *s);
  786. FcPublic int
  787. FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  788. FcPublic int
  789. FcStrCmp (const FcChar8 *s1, const FcChar8 *s2);
  790. FcPublic const FcChar8 *
  791. FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2);
  792. FcPublic const FcChar8 *
  793. FcStrStr (const FcChar8 *s1, const FcChar8 *s2);
  794. FcPublic int
  795. FcUtf8ToUcs4 (const FcChar8 *src_orig,
  796. FcChar32 *dst,
  797. int len);
  798. FcPublic FcBool
  799. FcUtf8Len (const FcChar8 *string,
  800. int len,
  801. int *nchar,
  802. int *wchar);
  803. #define FC_UTF8_MAX_LEN 6
  804. FcPublic int
  805. FcUcs4ToUtf8 (FcChar32 ucs4,
  806. FcChar8 dest[FC_UTF8_MAX_LEN]);
  807. FcPublic int
  808. FcUtf16ToUcs4 (const FcChar8 *src_orig,
  809. FcEndian endian,
  810. FcChar32 *dst,
  811. int len); /* in bytes */
  812. FcPublic FcBool
  813. FcUtf16Len (const FcChar8 *string,
  814. FcEndian endian,
  815. int len, /* in bytes */
  816. int *nchar,
  817. int *wchar);
  818. FcPublic FcChar8 *
  819. FcStrBuildFilename (const FcChar8 *path,
  820. ...);
  821. FcPublic FcChar8 *
  822. FcStrDirname (const FcChar8 *file);
  823. FcPublic FcChar8 *
  824. FcStrBasename (const FcChar8 *file);
  825. FcPublic FcStrSet *
  826. FcStrSetCreate (void);
  827. FcPublic FcBool
  828. FcStrSetMember (FcStrSet *set, const FcChar8 *s);
  829. FcPublic FcBool
  830. FcStrSetEqual (FcStrSet *sa, FcStrSet *sb);
  831. FcPublic FcBool
  832. FcStrSetAdd (FcStrSet *set, const FcChar8 *s);
  833. FcPublic FcBool
  834. FcStrSetAddFilename (FcStrSet *set, const FcChar8 *s);
  835. FcPublic FcBool
  836. FcStrSetDel (FcStrSet *set, const FcChar8 *s);
  837. FcPublic void
  838. FcStrSetDestroy (FcStrSet *set);
  839. FcPublic FcStrList *
  840. FcStrListCreate (FcStrSet *set);
  841. FcPublic void
  842. FcStrListFirst (FcStrList *list);
  843. FcPublic FcChar8 *
  844. FcStrListNext (FcStrList *list);
  845. FcPublic void
  846. FcStrListDone (FcStrList *list);
  847. /* fcxml.c */
  848. FcPublic FcBool
  849. FcConfigParseAndLoad (FcConfig *config, const FcChar8 *file, FcBool complain);
  850. FcPublic FcBool
  851. FcConfigParseAndLoadFromMemory (FcConfig *config,
  852. const FcChar8 *buffer,
  853. FcBool complain);
  854. _FCFUNCPROTOEND
  855. #undef FC_ATTRIBUTE_SENTINEL
  856. #ifndef _FCINT_H_
  857. /*
  858. * Deprecated functions are placed here to help users fix their code without
  859. * digging through documentation
  860. */
  861. #define FcConfigGetRescanInverval FcConfigGetRescanInverval_REPLACE_BY_FcConfigGetRescanInterval
  862. #define FcConfigSetRescanInverval FcConfigSetRescanInverval_REPLACE_BY_FcConfigSetRescanInterval
  863. #endif
  864. #endif /* _FONTCONFIG_H_ */