PageRenderTime 58ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/freetype-1.3.1/docs/apirefx.txt

https://bitbucket.org/davaeron/uplink
Plain Text | 864 lines | 603 code | 261 blank | 0 comment | 0 complexity | 6e904853e6f1555109b4d13782f495ba MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1
  1. The FreeType Engine
  2. Extension Library Reference
  3. -----------------------------------
  4. Table of Contents:
  5. I. Engine extensions
  6. 1. kerning (ftxkern)
  7. 2. PostScript names (ftxpost)
  8. 3. TrueType Open (ftxopen)
  9. a. The `BASE' table (baseline data)
  10. b. The `GDEF' table (glyph definitions)
  11. c. The `GPOS' table (glyph positions)
  12. d. The `GSUB' table (glyph substitions)
  13. e. The `JSTF' table (justification data)
  14. f. auxiliary functions
  15. 4. embedded bitmaps (ftxsbit)
  16. II. API extensions
  17. 1. cmap iteration (ftxcmap)
  18. 2. internationalized error messages (ftxerr18)
  19. 3. access to the `gasp' table (ftxgasp)
  20. 4. fast retrieval of glyph widths and heights (ftxwidth)
  21. III. Error codes
  22. --------------------
  23. Please read the file `user.txt' for an introduction into FreeType's
  24. extension mechanism and the difference between engine and API
  25. extensions.
  26. I. Engine extensions
  27. ====================
  28. To use engine extensions you have to compile the library with the
  29. macro TT_CONFIG_OPTION_EXTEND_ENGINE. By default, this macro is set
  30. and all engine extensions are linked to the FreeType library.
  31. 1. kerning (ftxkern)
  32. --------------------
  33. TT_Init_Kerning_Extension( TT_Engine engine )
  34. Initializes the kerning extension for a given engine. This must
  35. be called just after the engine creation, and before any face
  36. object allocation. Example:
  37. TT_Init_FreeType( &engine );
  38. TT_Init_Kerning_Extension( engine );
  39. ..................................................................
  40. TT_Get_Kerning_Directory( TT_Face face,
  41. TT_Kerning* directory )
  42. Queries the kerning directory found in a face object. If no
  43. kerning table is found in the TrueType file, the error
  44. TT_Err_Table_Is_Missing will be returned.
  45. You can access the subtables through the pointers of the
  46. directory. However, by default, the directory is only loaded if
  47. a face object is created. You must load the subtables that
  48. interest you with a call to TT_Load_Kerning_Table().
  49. The layout of all kerning structures is defined in the file
  50. `lib/extend/ftxkern.h'. Formats 0 and 2 (as defined in the
  51. Microsoft TrueType specification) are exposed by this API.
  52. NOTE:
  53. This function must be called after the kerning extension has
  54. been initialized.
  55. ..................................................................
  56. TT_Load_Kerning_Table( TT_Face face,
  57. TT_UShort kernIndex )
  58. Loads the kerning subtable number `kern_index' into memory. The
  59. subtable can be accessed through the pointers provided by the
  60. kerning directory, obtained from a call to the function
  61. TT_Get_Kerning_Directory().
  62. Note that the interpretation of the kerning data is left to the
  63. client application. Read the TrueType specification for more
  64. information on kerning encoding.
  65. NOTE 1:
  66. This function must be called after the kerning extension were
  67. initialized.
  68. NOTE 2:
  69. An example can be found in the file `test/ftstrtto.c'.
  70. ====================================================================
  71. 2. PostScript names (ftxpost)
  72. -----------------------------
  73. TT_Init_Post_Extension( TT_Engine engine )
  74. Initializes the PostScript name extension to load the PostScript
  75. glyph names given in the `post' table. This must be called just
  76. after creation of the engine, and before any face object
  77. allocation. See description of TT_Get_PS_Name() for an example.
  78. ..................................................................
  79. TT_Load_PS_Names( TT_Face face,
  80. TT_Post* post )
  81. Loads the PostScript glyph names into memory. This must be done
  82. before TT_Get_PS_Name() is called. In case of error, either
  83. TT_Err_Invalid_Post_Table or TT_Err_Invalid_Post_Table_Format is
  84. returned. See description of TT_Get_PS_Name() for an example.
  85. ..................................................................
  86. TT_Get_PS_Name( TT_Face face,
  87. TT_UShort index,
  88. TT_String** PSname )
  89. Get the PostScript glyph name for a given glyph index. A
  90. pointer to the name is returned in `PSname'. Example:
  91. ...
  92. TT_Post post;
  93. char* PSname;
  94. ...
  95. TT_Init_Post_Extension( engine );
  96. TT_Load_PS_Names( face, &post );
  97. ...
  98. TT_Get_PS_Name( face, index, &PSname );
  99. NOTE:
  100. You must not alter the PostScript glyph name string returned
  101. in `PSname'.
  102. ====================================================================
  103. 3. TrueType Open (ftxopen)
  104. --------------------------
  105. Please note that TrueType Open specific error codes have the
  106. prefix `TTO_Err_' instead of `TT_Err_'.
  107. a. The `BASE' table (baseline data)
  108. Not yet supported.
  109. b. The `GDEF' table (glyph definitions)
  110. TT_Init_GDEF_Extension( TT_Engine engine )
  111. Initializes the GDEF extension to load the glyph definition
  112. data given in the `GDEF' table. This must be called just
  113. after creation of the engine, and before any face object
  114. allocation. See the file `ftstrtto.c' for an example.
  115. ................................................................
  116. TT_Load_GDEF_Table( TT_Face face,
  117. TTO_GDEFHeader* gdef )
  118. Loads the GDEF table into `gdef' for a given face `face'.
  119. This must be done before any queries about glyph properties
  120. with TT_GSUB_Get_Property(). Returns TT_Err_Table_Missing if
  121. there is no GDEF table in the font.
  122. ................................................................
  123. TT_GDEF_Get_Glyph_Property( TTO_GDEFHeader* gdef,
  124. TT_UShort glyphID,
  125. TT_UShort* property )
  126. Use this function to get glyph properties in the variable
  127. `property' for the glyph with index `glyphID' stored in the
  128. `gdef' table. This data is essential for many fonts to
  129. correctly apply contextual substitution (both GSUB and GPOS).
  130. As a special case, zero is assigned to `property' if `gdef' is
  131. NULL or the glyph has no special glyph property assigned to
  132. it. The other return values of `property' are TTO_BASE,
  133. TTO_LIGATURE, TTO_MARK, and TTO_COMPONENT; you can directly
  134. apply the `LookupFlag' mask to check for certain properties:
  135. TTO_GDEFHeader* gdef;
  136. TTO_Lookup* lo;
  137. TT_UShort glyph_ID;
  138. TT_UShort p;
  139. TT_GDEF_Get_Property( gdef, glyph_ID, &p );
  140. if ( p & lo->LookupFlag )
  141. return TTO_Err_Not_Covered;
  142. Usually, you don't need to take care of glyph properties by
  143. yourself since TT_GSUB_Apply_String() will do this for you by
  144. calling TT_GDEF_Get_Property().
  145. Some fonts need GDEF-like data even if no GDEF table is
  146. provided (for example, the Arabic script needs information
  147. which glyphs are base glyphs and which are mark glyphs). In
  148. such cases, you should use TT_GDEF_Build_ClassDefinition() to
  149. build the necessary structures so that TT_GDEF_Get_Property()
  150. returns meaningful values.
  151. See also TT_Load_GSUB_Table() and TT_Load_GPOS_Table().
  152. ................................................................
  153. TT_GDEF_Build_ClassDefinition( TTO_GDEFHeader* gdef,
  154. TT_UShort num_glyphs,
  155. TT_UShort glyph_count,
  156. TT_UShort* glyph_array,
  157. TT_UShort* class_array )
  158. Fills a `gdef' structure with data to make
  159. TT_GDEF_Get_Property() work in case no GDEF table is
  160. available. `num_glyphs' is the number of glyphs in the font.
  161. `glyph_count' is the number of glyphs resp. class values (as
  162. specified in the GDEF specification) given in the arrays
  163. `glyph_array' and `class_array', respectively. The glyph
  164. indices in `glyph_array' must be all different and sorted in
  165. ascending order; the function expects that glyph index
  166. `glyph_array[n]' has its class value in `class_array[n]'.
  167. Note that mark attach classes as defined in OpenType 1.2 are
  168. not supported for constructed GDEF tables.
  169. See `arabic.c' for an example.
  170. c. The `GPOS' table (glyph positions)
  171. Not yet supported.
  172. d. The `GSUB' table (glyph substitions)
  173. For glyph substitution, a string object of type TTO_GSUB_String
  174. is used. The field `length' holds the length of the string,
  175. `pos' points to the actual position in the glyph string `string'
  176. (for input strings) resp. the position where the substituted
  177. glyphs should be placed at (for output strings).
  178. Within the `properties' array (which must always have the same
  179. length as `string' if set), you can define properties for glyphs
  180. -- `string[n]' is associated with `properties[n]'. The idea is
  181. that some features apply to specific glyphs only. As an
  182. example, the `fina' feature for Arabic applies only to glyphs
  183. which appear at the end of a word (strictly speaking, this
  184. feature is used only for glyphs which have a `final' property;
  185. such glyphs can occur in the middle of a word also under certain
  186. circumstances which is dependent on Arabic script rules). The
  187. relationship between properties and features can be set up with
  188. the function TT_GSUB_Add_Feature(). If `properties' is set to
  189. NULL, all selected features apply to all glyphs in the given
  190. string object. If `properties' is non-NULL, the elements of the
  191. array are treated as bit fields. A set flag means that the
  192. corresponding feature (as set with the TT_GSUB_Add_Feature()
  193. function) should not be applied to the particular glyph. As a
  194. consequence, a zero value for these 16 bits means that all
  195. features should be applied, and a value of 0xFFFF implies that
  196. no feature at all should be used for the glyph.
  197. The field `allocated' is for internal use only and must not be
  198. modified. If its value is larger than zero, you should use
  199. free() to deallocate the memory used by `string' (and
  200. `properties' if set) in case you want to destroy a
  201. TTO_GSUB_String object (memory for `string' and `properties' is
  202. allocated automatically e.g. by TT_GSUB_Apply_String() for
  203. output string objects).
  204. struct TTO_GSUB_String_
  205. {
  206. TT_ULong length;
  207. TT_ULong pos;
  208. TT_ULong allocated;
  209. TT_UShort* string;
  210. TT_UShort* properties;
  211. };
  212. typedef struct TTO_GSUB_String_ TTO_GSUB_String;
  213. Note that the `string' field must contain glyph indices, not
  214. character codes.
  215. For initializing an input string object, you should set the
  216. `length', `string', and `properties' fields (the last one only
  217. if necessary) to appropriate values. `pos' has to be set to the
  218. position where the substitution lookups should start (usually
  219. zero). The `allocated' field will be ignored.
  220. For initializing an output string object, all fields (except
  221. `length' which will be ignored) must be set to zero. If you
  222. want to reuse the object, set `pos' to the position where the
  223. substituted glyphs should be placed at (usually zero), but don't
  224. touch the `allocated', `string', and `properties' fields.
  225. ................................................................
  226. TT_Init_GSUB_Extension( TT_Engine engine )
  227. Initializes the GSUB extension to load the glyph substitution
  228. data given in the `GSUB' table. This must be called just
  229. after creation of the engine, and before any face object
  230. allocation. See the files `ftstrtto.c' and `ftdump.c' for
  231. detailed examples.
  232. ................................................................
  233. TT_Load_GSUB_Table( TT_Face face,
  234. TTO_GSUBHeader* gsub,
  235. TTO_GDEFHeader* gdef )
  236. Loads the GSUB table into `gsub' for a given face `face'.
  237. This must be done before any queries about or selection of
  238. scripts, languages, and features. Returns
  239. TT_Err_Table_Missing if there is no GSUB table in the font.
  240. `gdef' should contain a pointer to an associated GDEF table,
  241. either a native one loaded with TT_Load_GDEF_Table() or
  242. emulated with TT_GDEF_Build_ClassDefinition(). If `gdef' is
  243. set to NULL, no GDEF data will be used.
  244. ................................................................
  245. TT_GSUB_Select_Script( TTO_GSUBHeader* gsub,
  246. TT_ULong script_tag,
  247. TT_UShort* script_index )
  248. This function sets the script index of a given script tag
  249. `script_tag' in the variable `script_index' for the GSUB table
  250. `gsub'. Returns TTO_Err_Not_Covered if the script tag cannot
  251. be found. The available script tags can be queried with the
  252. function TT_GSUB_Query_Scripts().
  253. ................................................................
  254. TT_GSUB_Select_Language( TTO_GSUBHeader* gsub,
  255. TT_ULong language_tag,
  256. TT_UShort script_index,
  257. TT_UShort* language_index,
  258. TT_UShort* req_feature_index )
  259. This function sets the language index of a given language tag
  260. `language_tag' and script index `script_index' in the variable
  261. `language_index' for the GSUB table `gsub'. Returns
  262. TTO_Err_Not_Covered if the language tag cannot be found. The
  263. available language tags can be queried with the function
  264. TT_GSUB_Query_Languages().
  265. Additionally, the index of the required feature for this
  266. language system is returned in `req_feature_index'; it must be
  267. later registered for use with TT_GSUB_Add_Feature().
  268. ................................................................
  269. TT_GSUB_Select_Feature( TTO_GSUBHeader* gsub,
  270. TT_ULong feature_tag,
  271. TT_UShort script_index,
  272. TT_UShort language_index,
  273. TT_UShort* feature_index )
  274. This function sets the feature index of a feature tag
  275. `feature_tag', script index `script_index', and language index
  276. `language_index' in the variable `feature_index' for the GSUB
  277. table `gsub'. Returns TTO_Err_Not_Covered if the feature tag
  278. cannot be found. The available feature tags can be queried
  279. with the function TT_GSUB_Query_Features(). Setting
  280. language_index to 0xFFFF selects the default language system.
  281. ................................................................
  282. TT_GSUB_Query_Scripts( TTO_GSUBHeader* gsub,
  283. TT_ULong** script_tag_list )
  284. Returns the available script tags for a given GSUB table
  285. `gsub' in the array `script_tag_list'. The array can be later
  286. deallocated with free().
  287. ................................................................
  288. TT_GSUB_Query_Languages( TTO_GSUBHeader* gsub,
  289. TT_UShort script_index,
  290. TT_ULong** language_tag_list )
  291. Returns the available language tags for a given GSUB table
  292. `gsub' and script index `script_index' in the array
  293. `language_tag_list'. The array can be later deallocated with
  294. free().
  295. ................................................................
  296. TT_GSUB_Query_Features( TTO_GSUBHeader* gsub,
  297. TT_UShort script_index,
  298. TT_UShort language_index,
  299. TT_ULong** feature_tag_list )
  300. Returns the available feature tags for a given GSUB table
  301. `gsub', script index `script_index', and language index
  302. `language_index' in the array `feature_tag_list'. If language
  303. index is set to 0xFFFF, the values for the default language
  304. system are returned. The array can be later deallocated with
  305. free().
  306. ................................................................
  307. TT_GSUB_Add_Feature( TTO_GSUBHeader* gsub,
  308. TT_UShort feature_index,
  309. TT_UShort property )
  310. To prepare a call to TT_GSUB_Apply_String() which should
  311. process a given feature with index `feature_index' and the
  312. property `property', you must use this function. Its task is
  313. to mark the lookup tables used by the feature for further
  314. processing.
  315. `property' defines a relationship between the input string
  316. object and the specific feature. The client must handle this
  317. variable as a bit field, i.e., up to 16 user properties can be
  318. defined. If `property' is set to ALL_GLYPHS (0xFFFF, the only
  319. predefined value), or if the input string object has no set
  320. bits in the `properties' field, the feature applies to all
  321. glyphs. If bit `x' is set in `property', the feature applies
  322. only to glyphs which have bit `x' not set in glyph's
  323. `properties' field in the input string object. See
  324. TT_GSUB_Apply_String() for an example.
  325. Returns TT_Err_Invalid_Argument in case of error.
  326. ................................................................
  327. TT_GSUB_Clear_Features( TTO_GSUBHeader* gsub )
  328. Clears the list of used features and properties. No lookup
  329. tables will be processed.
  330. ................................................................
  331. TT_GSUB_Register_Alternate_Function( TTO_GSUBHeader* gsub,
  332. TTO_AltFunction alt,
  333. void* data )
  334. Installs a callback function to handle alternate
  335. substitutions. `data' is a generic pointer to a user-defined
  336. structure which will be completely ignored by the ftxopen
  337. extension. `alt' is a function pointer defined as
  338. typedef TT_UShort
  339. (*TTO_AltFunction)(TT_ULong pos,
  340. TT_UShort glyphID,
  341. TT_UShort num_alternates,
  342. TT_UShort* alternates,
  343. void* data );
  344. If TT_GSUB_Apply_String() encounters an alternate lookup while
  345. processing the input string, it will call the function `alt'
  346. to find out which alternate glyph it should use. `pos' gives
  347. the position in the string, `glyphID' the glyph ID of the
  348. glyph to be replaced with an alternate glyph, and
  349. `num_alternates' the number of alternate glyphs in the
  350. `alternates' array. A pointer to the user-defined `data'
  351. structure is also available. `alt' must return an index into
  352. `alternates'.
  353. If `alt' is NULL or if this function isn't called at all,
  354. TT_GSUB_Apply_String() will always use the first alternate
  355. glyph.
  356. Please note that theoretically an alternate lookup can happen
  357. during any other lookup! For example, a lookup chain like
  358. single subst -> alternate subst -> ligature subst
  359. *is* possible (albeit rather unlikely). Thus be warned that
  360. `pos' does not necessarily reflect the position of a glyph to
  361. be displayed at all, nor does `glyphID' specifies a glyph
  362. which will be in the final output string.
  363. ................................................................
  364. TT_GSUB_Apply_String( TTO_GSUBHeader* gsub,
  365. TTO_GSUB_String* in,
  366. TTO_GSUB_String* out )
  367. This is the very function which handles glyph substitution
  368. according to the features set up with TT_GSUB_Add_Feature(),
  369. using both GSUB and GDEF data (if defined). Two
  370. TTO_GSUB_String objects `in' and `out' (as described above)
  371. are taken for input and output; after successful excecution,
  372. the converted glyph string can been found in `out', and
  373. `out.length' gives the actual length of the output string
  374. (counted from the begin of the array).
  375. Example:
  376. /* We assume that the feature `xxxx' has index 5, and */
  377. /* feature `yyyy' has index 8, applying only to glyphs */
  378. /* with the property `FINAL_GLYPHS' set (0x1000 is an */
  379. /* ad-hoc value just for this example). */
  380. /* The order of calls to TT_GSUB_Add_Feature() is not */
  381. /* significant. */
  382. #define FINAL_GLYPHS 0x1000
  383. TT_GSUB_Clear_Features( &gsub );
  384. TT_GSUB_Add_Feature( &gsub, 8, FINAL_GLYPHS );
  385. TT_GSUB_Add_Feature( &gsub, 5, ALL_GLYPHS );
  386. TT_GSUB_Apply_String( &gsub, &in, &out );
  387. You must initialize both `in' and `out' structures; allocation
  388. necessary for the `out' object will be handled automatically.
  389. In case you don't register a function to handle alternate
  390. substitutions (GSUB lookup 3), always the first alternate
  391. glyph will be used. See TT_GSUB_Register_Alternate_Function()
  392. above for more details.
  393. e. The `JSTF' table (justification data)
  394. Not yet supported.
  395. f. auxiliary functions
  396. TT_GSUB_Add_String( TTO_GSUB_String* in,
  397. TT_UShort num_in,
  398. TTO_GSUB_String* out,
  399. TT_UShort num_out,
  400. TT_UShort* data )
  401. This function copies `num_out' elements from `data' to `out',
  402. advancing the array pointer `in.pos' by `num_in' elements and
  403. `out.pos' by `num_out' elements. If the string (resp. the
  404. properties) array in `out' is empty or too small, it allocates
  405. resp. reallocates the string (and properties) array.
  406. Finally, it sets `out.length' equal to `out.pos'.
  407. The properties for all replaced glyphs are taken from the
  408. glyph at position `in->pos'.
  409. TT_GSUB_Add_String() is normally used in
  410. TT_GSUB_Apply_String(); you will need it for the special case
  411. to skip some glyphs (i.e., copy glyphs directly from the `in'
  412. to the `out' object), bypassing a possible GSUB substitution.
  413. Here an example which copies one glyph:
  414. TT_GSUB_Add_String( in, 1,
  415. out, 1,
  416. &in->string[in->pos] );
  417. ====================================================================
  418. 4. embedded bitmaps (ftxsbit)
  419. -----------------------------
  420. TT_Init_SBit_Extension( TT_Engine engine )
  421. Initializes the embedded bitmap extension to load the bitmap
  422. glyphs given in the various sbit tables: `EBLC', `bloc', `EBDT',
  423. and `bdat' (`bloc' and `bdat' tables are only in Apple fonts;
  424. the former is equivalent to `EBLC', the latter equivalent to
  425. `EBDT'). This must be called just after creation of the engine,
  426. and before any face object allocation. See description of
  427. TT_Load_Glyph_Bitmap() for an example.
  428. ..................................................................
  429. TT_Get_Face_Bitmaps( TT_Face face,
  430. TT_EBLC* eblc_table )
  431. Loads the `EBLC' (resp. `bloc') table from a font file into the
  432. `eblc_table' structure. Use this function for testing whether
  433. embedded bitmaps are available or not.
  434. This function returns TT_Err_Table_Missing if the font contains
  435. no embedded bitmaps. All fields in `eblc_table' will then be
  436. set to 0.
  437. ..................................................................
  438. TT_New_SBit_Image( TT_SBit_Image** image )
  439. Allocates a new embedded bitmap container, pointed to by
  440. `image'.
  441. ..................................................................
  442. void TT_Done_SBit_Image( TT_SBit_Image* image )
  443. ^^^^
  444. Releases the embedded bitmap container `image'.
  445. ..................................................................
  446. TT_Get_SBit_Strike( TT_Face face,
  447. TT_Instance instance,
  448. TT_SBit_Strike* strike )
  449. Loads a suitable strike (i.e. bitmap sizetable) for the given
  450. instance. Will return TT_Err_Invalid_PPem if there is no strike
  451. for the current x_ppem and y_ppem values.
  452. ..................................................................
  453. TT_Load_Glyph_Bitmap( TT_Face face,
  454. TT_Instance instance,
  455. TT_UShort glyph_index,
  456. TT_SBit_Image* bitmap );
  457. Loads a glyph bitmap for a given glyph index `glyph_index' (in
  458. face `face' and instance `instance') into `bitmap'. It calls
  459. TT_Get_SBit_Strike() internally for checking the current x_ppem
  460. and y_ppem values.
  461. This function returns an error if there is no embedded bitmap
  462. for the glyph at the given instance.
  463. Example (omitting the error handling):
  464. ...
  465. TT_SBit_Image* bitmap;
  466. ...
  467. TT_Init_SBit_Extension( engine );
  468. TT_New_SBit_Image( &bitmap );
  469. ...
  470. TT_Load_Glyph_Bitmap( face, instance, glyph_index, bitmap );
  471. --------------------------------------------------------------------
  472. --------------------------------------------------------------------
  473. II. API extensions
  474. ==================
  475. To use API extensions, simply compile the specific extension file
  476. and link it to the library or your program. By default, all
  477. extensions described below are linked to the library.
  478. 1. cmap iteration (ftxcmap)
  479. ---------------------------
  480. TT_Long TT_CharMap_First( TT_CharMap charMap,
  481. ^^^^^^^ TT_UShort* glyph_index )
  482. Returns the first valid character code in a given character map
  483. `charMap'. Also returns the corresponding glyph index (in the
  484. parameter `*glyph_index'). In case of failure, -1 is returned,
  485. and `*glyph_index' is undefined.
  486. ..................................................................
  487. TT_Long TT_CharMap_Next( TT_CharMap charMap,
  488. ^^^^^^^ TT_UShort last_char,
  489. TT_UShort* glyph_index )
  490. Returns the next valid character code in a given character map
  491. `charMap' which follows `last_char'. Also returns the
  492. corresponding glyph index (in the parameter `*glyph_index'). In
  493. case of failure, -1 is returned, and `glyph_index' is undefined.
  494. ..................................................................
  495. TT_Long TT_CharMap_Last( TT_CharMap charMap,
  496. ^^^^^^^ TT_UShort* glyph_index )
  497. Returns the last valid character code in a given character map
  498. `charMap'. Also returns the corresponding glyph index (in the
  499. parameter `*glyph_index'). In case of failure, -1 is returned,
  500. and `*glyph_index' is undefined.
  501. ====================================================================
  502. 2. internationalized error messages (ftxerr18)
  503. ----------------------------------------------
  504. This extension provides internationalized error strings from the
  505. various error messages. It uses the `gettext' package if
  506. available or returns English/American message strings if not.
  507. Currently, the gettext package is only available on UNIX-like
  508. systems like Linux; this means that for other platforms only
  509. English error strings are returned.
  510. If the gettext package is found on your system, the configure
  511. script automatically includes it by default. In case you don't
  512. want to use it, or if you encounter some problems compiling this
  513. file, try to disable nls support by configuring FreeType with
  514. `./configure --disable-nls'.
  515. Please read the gettext info files for more information how to set
  516. up your system for internationalized messages. A short
  517. introduction is also given in the file `i18n.txt'.
  518. TT_String* TT_ErrToString18( TT_Error i )
  519. ^^^^^^^^^^
  520. This function returns an error string for a given error code
  521. `i'. The type `TT_String' usually defaults to `char'; see
  522. apiref.txt for more details.
  523. An example how to use this function (in connection with the
  524. gettext interface) is given e.g. in test/ftdump.c.
  525. ====================================================================
  526. 3. access to the `gasp' table (ftxgasp)
  527. ---------------------------------------
  528. The `gasp' table is currently loaded by the core engine, but the
  529. standard API doesn't give access to it.
  530. TT_Get_Face_Gasp_Flags( TT_Face face,
  531. TT_UShort point_size,
  532. TT_Bool* grid_fit,
  533. TT_Bool* smooth_font )
  534. This function returns for a given `point_size' the values of the
  535. gasp flags `grid_fit' and `smooth_font'. The returned values
  536. are booleans (where 0 = NO, and 1 = YES).
  537. Note that this function will return TT_Err_Table_Missing if the
  538. font file doesn't contain any gasp table.
  539. ====================================================================
  540. 4. fast retrieval of glyph widths and heights (ftxwidth)
  541. --------------------------------------------------------
  542. This extension is used to parse the `glyf' table of a TrueType
  543. file in order to extract the bounding box of a given range of
  544. glyphs.
  545. The bounding box is then used to build font unit widths and
  546. heights that are returned in two parallel arrays.
  547. This extension is needed by the FreeType/2 OS/2 Font Driver.
  548. TT_Get_Face_Widths( TT_Face face,
  549. TT_UShort first_glyph,
  550. TT_UShort last_glyph,
  551. TT_UShort* widths,
  552. TT_UShort* heights )
  553. Returns the widths (in array `widths') and heights (in array
  554. `heights') of a glyph range which starts at `first_glyph' and
  555. ends at `last_glyph'. All returned values are returned in font
  556. units. If either `widths' or `heights' is set to a NULL
  557. pointer, no data will be returned for that particular array.
  558. Note: TT_Get_Face_Widths() does *not* allocate the two arrays!
  559. --------------------------------------------------------------------
  560. --------------------------------------------------------------------
  561. III. Error Messages
  562. ===================
  563. Most functions return an error code, typed to TT_Error. A return
  564. value of zero indicates no error. The error values are defined in
  565. the various extension header files (e.g. ftxkern.h). In the
  566. following table, the prefix `TT_Err_' is omitted, e.g. `Ok' ->
  567. `TT_Err_Ok'.
  568. Error Unprefixed Error
  569. Code Macro Name Description
  570. ------------------------------------------------------------------
  571. 0x0A00 Invalid_Kerning_Table_Format
  572. An invalid kerning subtable
  573. format was found in this font.
  574. 0x0A01 Invalid_Kerning_Table A kerning table contains illegal
  575. glyph indices.
  576. 0x0B00 Invalid_Post_Table_Format
  577. The post table format specified
  578. in the font is invalid.
  579. 0x0B01 Invalid_Post_Table The post table contains illegal
  580. entries.
  581. Here the TrueType Open error codes. In the following table, the
  582. prefix `TTO_Err_' is omitted.
  583. Error Unprefixed Error
  584. Code Macro Name Description
  585. ------------------------------------------------------------------
  586. 0x1000 Invalid_SubTable_Format The TrueType Open subtable format
  587. specified in the font is invalid.
  588. 0x1001 Invalid_SubTable A TrueType Open subtable contains
  589. illegal entries.
  590. 0x1002 Not_Covered The requested feature, glyph,
  591. etc. isn't covered by the actual
  592. function.
  593. 0x1010 Invalid_GSUB_SubTable_Format
  594. The GSUB subtable format
  595. specified in the font is invalid.
  596. 0x1011 Invalid_GSUB_SubTable The GSUB subtable contains
  597. illegal entries.
  598. 0x1020 Invalid_GPOS_SubTable_Format
  599. The GPOS subtable format
  600. specified in the font is invalid.
  601. 0x1021 Invalid_GPOS_SubTable The GPOS subtable contains
  602. illegal entries.
  603. --- end of apirefx.txt ---