ftglyph.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. /****************************************************************************
  2. *
  3. * ftglyph.h
  4. *
  5. * FreeType convenience functions to handle glyphs (specification).
  6. *
  7. * Copyright (C) 1996-2023 by
  8. * David Turner, Robert Wilhelm, and Werner Lemberg.
  9. *
  10. * This file is part of the FreeType project, and may only be used,
  11. * modified, and distributed under the terms of the FreeType project
  12. * license, LICENSE.TXT. By continuing to use, modify, or distribute
  13. * this file you indicate that you have read the license and
  14. * understand and accept it fully.
  15. *
  16. */
  17. /**************************************************************************
  18. *
  19. * This file contains the definition of several convenience functions that
  20. * can be used by client applications to easily retrieve glyph bitmaps and
  21. * outlines from a given face.
  22. *
  23. * These functions should be optional if you are writing a font server or
  24. * text layout engine on top of FreeType. However, they are pretty handy
  25. * for many other simple uses of the library.
  26. *
  27. */
  28. #ifndef FTGLYPH_H_
  29. #define FTGLYPH_H_
  30. #include <freetype/freetype.h>
  31. #ifdef FREETYPE_H
  32. #error "freetype.h of FreeType 1 has been loaded!"
  33. #error "Please fix the directory search order for header files"
  34. #error "so that freetype.h of FreeType 2 is found first."
  35. #endif
  36. FT_BEGIN_HEADER
  37. /**************************************************************************
  38. *
  39. * @section:
  40. * glyph_management
  41. *
  42. * @title:
  43. * Glyph Management
  44. *
  45. * @abstract:
  46. * Generic interface to manage individual glyph data.
  47. *
  48. * @description:
  49. * This section contains definitions used to manage glyph data through
  50. * generic @FT_Glyph objects. Each of them can contain a bitmap,
  51. * a vector outline, or even images in other formats. These objects are
  52. * detached from @FT_Face, contrary to @FT_GlyphSlot.
  53. *
  54. */
  55. /* forward declaration to a private type */
  56. typedef struct FT_Glyph_Class_ FT_Glyph_Class;
  57. /**************************************************************************
  58. *
  59. * @type:
  60. * FT_Glyph
  61. *
  62. * @description:
  63. * Handle to an object used to model generic glyph images. It is a
  64. * pointer to the @FT_GlyphRec structure and can contain a glyph bitmap
  65. * or pointer.
  66. *
  67. * @note:
  68. * Glyph objects are not owned by the library. You must thus release
  69. * them manually (through @FT_Done_Glyph) _before_ calling
  70. * @FT_Done_FreeType.
  71. */
  72. typedef struct FT_GlyphRec_* FT_Glyph;
  73. /**************************************************************************
  74. *
  75. * @struct:
  76. * FT_GlyphRec
  77. *
  78. * @description:
  79. * The root glyph structure contains a given glyph image plus its advance
  80. * width in 16.16 fixed-point format.
  81. *
  82. * @fields:
  83. * library ::
  84. * A handle to the FreeType library object.
  85. *
  86. * clazz ::
  87. * A pointer to the glyph's class. Private.
  88. *
  89. * format ::
  90. * The format of the glyph's image.
  91. *
  92. * advance ::
  93. * A 16.16 vector that gives the glyph's advance width.
  94. */
  95. typedef struct FT_GlyphRec_
  96. {
  97. FT_Library library;
  98. const FT_Glyph_Class* clazz;
  99. FT_Glyph_Format format;
  100. FT_Vector advance;
  101. } FT_GlyphRec;
  102. /**************************************************************************
  103. *
  104. * @type:
  105. * FT_BitmapGlyph
  106. *
  107. * @description:
  108. * A handle to an object used to model a bitmap glyph image. This is a
  109. * 'sub-class' of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
  110. */
  111. typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
  112. /**************************************************************************
  113. *
  114. * @struct:
  115. * FT_BitmapGlyphRec
  116. *
  117. * @description:
  118. * A structure used for bitmap glyph images. This really is a
  119. * 'sub-class' of @FT_GlyphRec.
  120. *
  121. * @fields:
  122. * root ::
  123. * The root fields of @FT_Glyph.
  124. *
  125. * left ::
  126. * The left-side bearing, i.e., the horizontal distance from the
  127. * current pen position to the left border of the glyph bitmap.
  128. *
  129. * top ::
  130. * The top-side bearing, i.e., the vertical distance from the current
  131. * pen position to the top border of the glyph bitmap. This distance
  132. * is positive for upwards~y!
  133. *
  134. * bitmap ::
  135. * A descriptor for the bitmap.
  136. *
  137. * @note:
  138. * You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have
  139. * `glyph->format == FT_GLYPH_FORMAT_BITMAP`. This lets you access the
  140. * bitmap's contents easily.
  141. *
  142. * The corresponding pixel buffer is always owned by @FT_BitmapGlyph and
  143. * is thus created and destroyed with it.
  144. */
  145. typedef struct FT_BitmapGlyphRec_
  146. {
  147. FT_GlyphRec root;
  148. FT_Int left;
  149. FT_Int top;
  150. FT_Bitmap bitmap;
  151. } FT_BitmapGlyphRec;
  152. /**************************************************************************
  153. *
  154. * @type:
  155. * FT_OutlineGlyph
  156. *
  157. * @description:
  158. * A handle to an object used to model an outline glyph image. This is a
  159. * 'sub-class' of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
  160. */
  161. typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
  162. /**************************************************************************
  163. *
  164. * @struct:
  165. * FT_OutlineGlyphRec
  166. *
  167. * @description:
  168. * A structure used for outline (vectorial) glyph images. This really is
  169. * a 'sub-class' of @FT_GlyphRec.
  170. *
  171. * @fields:
  172. * root ::
  173. * The root @FT_Glyph fields.
  174. *
  175. * outline ::
  176. * A descriptor for the outline.
  177. *
  178. * @note:
  179. * You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have
  180. * `glyph->format == FT_GLYPH_FORMAT_OUTLINE`. This lets you access the
  181. * outline's content easily.
  182. *
  183. * As the outline is extracted from a glyph slot, its coordinates are
  184. * expressed normally in 26.6 pixels, unless the flag @FT_LOAD_NO_SCALE
  185. * was used in @FT_Load_Glyph or @FT_Load_Char.
  186. *
  187. * The outline's tables are always owned by the object and are destroyed
  188. * with it.
  189. */
  190. typedef struct FT_OutlineGlyphRec_
  191. {
  192. FT_GlyphRec root;
  193. FT_Outline outline;
  194. } FT_OutlineGlyphRec;
  195. /**************************************************************************
  196. *
  197. * @type:
  198. * FT_SvgGlyph
  199. *
  200. * @description:
  201. * A handle to an object used to model an SVG glyph. This is a
  202. * 'sub-class' of @FT_Glyph, and a pointer to @FT_SvgGlyphRec.
  203. *
  204. * @since:
  205. * 2.12
  206. */
  207. typedef struct FT_SvgGlyphRec_* FT_SvgGlyph;
  208. /**************************************************************************
  209. *
  210. * @struct:
  211. * FT_SvgGlyphRec
  212. *
  213. * @description:
  214. * A structure used for OT-SVG glyphs. This is a 'sub-class' of
  215. * @FT_GlyphRec.
  216. *
  217. * @fields:
  218. * root ::
  219. * The root @FT_GlyphRec fields.
  220. *
  221. * svg_document ::
  222. * A pointer to the SVG document.
  223. *
  224. * svg_document_length ::
  225. * The length of `svg_document`.
  226. *
  227. * glyph_index ::
  228. * The index of the glyph to be rendered.
  229. *
  230. * metrics ::
  231. * A metrics object storing the size information.
  232. *
  233. * units_per_EM ::
  234. * The size of the EM square.
  235. *
  236. * start_glyph_id ::
  237. * The first glyph ID in the glyph range covered by this document.
  238. *
  239. * end_glyph_id ::
  240. * The last glyph ID in the glyph range covered by this document.
  241. *
  242. * transform ::
  243. * A 2x2 transformation matrix to apply to the glyph while rendering
  244. * it.
  245. *
  246. * delta ::
  247. * Translation to apply to the glyph while rendering.
  248. *
  249. * @note:
  250. * The Glyph Management API requires @FT_Glyph or its 'sub-class' to have
  251. * all the information needed to completely define the glyph's rendering.
  252. * Outline-based glyphs can directly apply transformations to the outline
  253. * but this is not possible for an SVG document that hasn't been parsed.
  254. * Therefore, the transformation is stored along with the document. In
  255. * the absence of a 'ViewBox' or 'Width'/'Height' attribute, the size of
  256. * the ViewPort should be assumed to be 'units_per_EM'.
  257. */
  258. typedef struct FT_SvgGlyphRec_
  259. {
  260. FT_GlyphRec root;
  261. FT_Byte* svg_document;
  262. FT_ULong svg_document_length;
  263. FT_UInt glyph_index;
  264. FT_Size_Metrics metrics;
  265. FT_UShort units_per_EM;
  266. FT_UShort start_glyph_id;
  267. FT_UShort end_glyph_id;
  268. FT_Matrix transform;
  269. FT_Vector delta;
  270. } FT_SvgGlyphRec;
  271. /**************************************************************************
  272. *
  273. * @function:
  274. * FT_New_Glyph
  275. *
  276. * @description:
  277. * A function used to create a new empty glyph image. Note that the
  278. * created @FT_Glyph object must be released with @FT_Done_Glyph.
  279. *
  280. * @input:
  281. * library ::
  282. * A handle to the FreeType library object.
  283. *
  284. * format ::
  285. * The format of the glyph's image.
  286. *
  287. * @output:
  288. * aglyph ::
  289. * A handle to the glyph object.
  290. *
  291. * @return:
  292. * FreeType error code. 0~means success.
  293. *
  294. * @since:
  295. * 2.10
  296. */
  297. FT_EXPORT( FT_Error )
  298. FT_New_Glyph( FT_Library library,
  299. FT_Glyph_Format format,
  300. FT_Glyph *aglyph );
  301. /**************************************************************************
  302. *
  303. * @function:
  304. * FT_Get_Glyph
  305. *
  306. * @description:
  307. * A function used to extract a glyph image from a slot. Note that the
  308. * created @FT_Glyph object must be released with @FT_Done_Glyph.
  309. *
  310. * @input:
  311. * slot ::
  312. * A handle to the source glyph slot.
  313. *
  314. * @output:
  315. * aglyph ::
  316. * A handle to the glyph object. `NULL` in case of error.
  317. *
  318. * @return:
  319. * FreeType error code. 0~means success.
  320. *
  321. * @note:
  322. * Because `*aglyph->advance.x` and `*aglyph->advance.y` are 16.16
  323. * fixed-point numbers, `slot->advance.x` and `slot->advance.y` (which
  324. * are in 26.6 fixed-point format) must be in the range ]-32768;32768[.
  325. */
  326. FT_EXPORT( FT_Error )
  327. FT_Get_Glyph( FT_GlyphSlot slot,
  328. FT_Glyph *aglyph );
  329. /**************************************************************************
  330. *
  331. * @function:
  332. * FT_Glyph_Copy
  333. *
  334. * @description:
  335. * A function used to copy a glyph image. Note that the created
  336. * @FT_Glyph object must be released with @FT_Done_Glyph.
  337. *
  338. * @input:
  339. * source ::
  340. * A handle to the source glyph object.
  341. *
  342. * @output:
  343. * target ::
  344. * A handle to the target glyph object. `NULL` in case of error.
  345. *
  346. * @return:
  347. * FreeType error code. 0~means success.
  348. */
  349. FT_EXPORT( FT_Error )
  350. FT_Glyph_Copy( FT_Glyph source,
  351. FT_Glyph *target );
  352. /**************************************************************************
  353. *
  354. * @function:
  355. * FT_Glyph_Transform
  356. *
  357. * @description:
  358. * Transform a glyph image if its format is scalable.
  359. *
  360. * @inout:
  361. * glyph ::
  362. * A handle to the target glyph object.
  363. *
  364. * @input:
  365. * matrix ::
  366. * A pointer to a 2x2 matrix to apply.
  367. *
  368. * delta ::
  369. * A pointer to a 2d vector to apply. Coordinates are expressed in
  370. * 1/64 of a pixel.
  371. *
  372. * @return:
  373. * FreeType error code (if not 0, the glyph format is not scalable).
  374. *
  375. * @note:
  376. * The 2x2 transformation matrix is also applied to the glyph's advance
  377. * vector.
  378. */
  379. FT_EXPORT( FT_Error )
  380. FT_Glyph_Transform( FT_Glyph glyph,
  381. const FT_Matrix* matrix,
  382. const FT_Vector* delta );
  383. /**************************************************************************
  384. *
  385. * @enum:
  386. * FT_Glyph_BBox_Mode
  387. *
  388. * @description:
  389. * The mode how the values of @FT_Glyph_Get_CBox are returned.
  390. *
  391. * @values:
  392. * FT_GLYPH_BBOX_UNSCALED ::
  393. * Return unscaled font units.
  394. *
  395. * FT_GLYPH_BBOX_SUBPIXELS ::
  396. * Return unfitted 26.6 coordinates.
  397. *
  398. * FT_GLYPH_BBOX_GRIDFIT ::
  399. * Return grid-fitted 26.6 coordinates.
  400. *
  401. * FT_GLYPH_BBOX_TRUNCATE ::
  402. * Return coordinates in integer pixels.
  403. *
  404. * FT_GLYPH_BBOX_PIXELS ::
  405. * Return grid-fitted pixel coordinates.
  406. */
  407. typedef enum FT_Glyph_BBox_Mode_
  408. {
  409. FT_GLYPH_BBOX_UNSCALED = 0,
  410. FT_GLYPH_BBOX_SUBPIXELS = 0,
  411. FT_GLYPH_BBOX_GRIDFIT = 1,
  412. FT_GLYPH_BBOX_TRUNCATE = 2,
  413. FT_GLYPH_BBOX_PIXELS = 3
  414. } FT_Glyph_BBox_Mode;
  415. /* these constants are deprecated; use the corresponding */
  416. /* `FT_Glyph_BBox_Mode` values instead */
  417. #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
  418. #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
  419. #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
  420. #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
  421. #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
  422. /**************************************************************************
  423. *
  424. * @function:
  425. * FT_Glyph_Get_CBox
  426. *
  427. * @description:
  428. * Return a glyph's 'control box'. The control box encloses all the
  429. * outline's points, including Bezier control points. Though it
  430. * coincides with the exact bounding box for most glyphs, it can be
  431. * slightly larger in some situations (like when rotating an outline that
  432. * contains Bezier outside arcs).
  433. *
  434. * Computing the control box is very fast, while getting the bounding box
  435. * can take much more time as it needs to walk over all segments and arcs
  436. * in the outline. To get the latter, you can use the 'ftbbox'
  437. * component, which is dedicated to this single task.
  438. *
  439. * @input:
  440. * glyph ::
  441. * A handle to the source glyph object.
  442. *
  443. * mode ::
  444. * The mode that indicates how to interpret the returned bounding box
  445. * values.
  446. *
  447. * @output:
  448. * acbox ::
  449. * The glyph coordinate bounding box. Coordinates are expressed in
  450. * 1/64 of pixels if it is grid-fitted.
  451. *
  452. * @note:
  453. * Coordinates are relative to the glyph origin, using the y~upwards
  454. * convention.
  455. *
  456. * If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode` must
  457. * be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font units in 26.6
  458. * pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS is another name for
  459. * this constant.
  460. *
  461. * If the font is tricky and the glyph has been loaded with
  462. * @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get
  463. * reasonable values for the CBox it is necessary to load the glyph at a
  464. * large ppem value (so that the hinting instructions can properly shift
  465. * and scale the subglyphs), then extracting the CBox, which can be
  466. * eventually converted back to font units.
  467. *
  468. * Note that the maximum coordinates are exclusive, which means that one
  469. * can compute the width and height of the glyph image (be it in integer
  470. * or 26.6 pixels) as:
  471. *
  472. * ```
  473. * width = bbox.xMax - bbox.xMin;
  474. * height = bbox.yMax - bbox.yMin;
  475. * ```
  476. *
  477. * Note also that for 26.6 coordinates, if `bbox_mode` is set to
  478. * @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,
  479. * which corresponds to:
  480. *
  481. * ```
  482. * bbox.xMin = FLOOR(bbox.xMin);
  483. * bbox.yMin = FLOOR(bbox.yMin);
  484. * bbox.xMax = CEILING(bbox.xMax);
  485. * bbox.yMax = CEILING(bbox.yMax);
  486. * ```
  487. *
  488. * To get the bbox in pixel coordinates, set `bbox_mode` to
  489. * @FT_GLYPH_BBOX_TRUNCATE.
  490. *
  491. * To get the bbox in grid-fitted pixel coordinates, set `bbox_mode` to
  492. * @FT_GLYPH_BBOX_PIXELS.
  493. */
  494. FT_EXPORT( void )
  495. FT_Glyph_Get_CBox( FT_Glyph glyph,
  496. FT_UInt bbox_mode,
  497. FT_BBox *acbox );
  498. /**************************************************************************
  499. *
  500. * @function:
  501. * FT_Glyph_To_Bitmap
  502. *
  503. * @description:
  504. * Convert a given glyph object to a bitmap glyph object.
  505. *
  506. * @inout:
  507. * the_glyph ::
  508. * A pointer to a handle to the target glyph.
  509. *
  510. * @input:
  511. * render_mode ::
  512. * An enumeration that describes how the data is rendered.
  513. *
  514. * origin ::
  515. * A pointer to a vector used to translate the glyph image before
  516. * rendering. Can be~0 (if no translation). The origin is expressed
  517. * in 26.6 pixels.
  518. *
  519. * destroy ::
  520. * A boolean that indicates that the original glyph image should be
  521. * destroyed by this function. It is never destroyed in case of error.
  522. *
  523. * @return:
  524. * FreeType error code. 0~means success.
  525. *
  526. * @note:
  527. * This function does nothing if the glyph format isn't scalable.
  528. *
  529. * The glyph image is translated with the `origin` vector before
  530. * rendering.
  531. *
  532. * The first parameter is a pointer to an @FT_Glyph handle that will be
  533. * _replaced_ by this function (with newly allocated data). Typically,
  534. * you would do something like the following (omitting error handling).
  535. *
  536. * ```
  537. * FT_Glyph glyph;
  538. * FT_BitmapGlyph glyph_bitmap;
  539. *
  540. *
  541. * // load glyph
  542. * error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT );
  543. *
  544. * // extract glyph image
  545. * error = FT_Get_Glyph( face->glyph, &glyph );
  546. *
  547. * // convert to a bitmap (default render mode + destroying old)
  548. * if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
  549. * {
  550. * error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
  551. * 0, 1 );
  552. * if ( error ) // `glyph' unchanged
  553. * ...
  554. * }
  555. *
  556. * // access bitmap content by typecasting
  557. * glyph_bitmap = (FT_BitmapGlyph)glyph;
  558. *
  559. * // do funny stuff with it, like blitting/drawing
  560. * ...
  561. *
  562. * // discard glyph image (bitmap or not)
  563. * FT_Done_Glyph( glyph );
  564. * ```
  565. *
  566. * Here is another example, again without error handling.
  567. *
  568. * ```
  569. * FT_Glyph glyphs[MAX_GLYPHS]
  570. *
  571. *
  572. * ...
  573. *
  574. * for ( idx = 0; i < MAX_GLYPHS; i++ )
  575. * error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||
  576. * FT_Get_Glyph ( face->glyph, &glyphs[idx] );
  577. *
  578. * ...
  579. *
  580. * for ( idx = 0; i < MAX_GLYPHS; i++ )
  581. * {
  582. * FT_Glyph bitmap = glyphs[idx];
  583. *
  584. *
  585. * ...
  586. *
  587. * // after this call, `bitmap' no longer points into
  588. * // the `glyphs' array (and the old value isn't destroyed)
  589. * FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );
  590. *
  591. * ...
  592. *
  593. * FT_Done_Glyph( bitmap );
  594. * }
  595. *
  596. * ...
  597. *
  598. * for ( idx = 0; i < MAX_GLYPHS; i++ )
  599. * FT_Done_Glyph( glyphs[idx] );
  600. * ```
  601. */
  602. FT_EXPORT( FT_Error )
  603. FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
  604. FT_Render_Mode render_mode,
  605. const FT_Vector* origin,
  606. FT_Bool destroy );
  607. /**************************************************************************
  608. *
  609. * @function:
  610. * FT_Done_Glyph
  611. *
  612. * @description:
  613. * Destroy a given glyph.
  614. *
  615. * @input:
  616. * glyph ::
  617. * A handle to the target glyph object. Can be `NULL`.
  618. */
  619. FT_EXPORT( void )
  620. FT_Done_Glyph( FT_Glyph glyph );
  621. /* */
  622. /* other helpful functions */
  623. /**************************************************************************
  624. *
  625. * @section:
  626. * computations
  627. *
  628. */
  629. /**************************************************************************
  630. *
  631. * @function:
  632. * FT_Matrix_Multiply
  633. *
  634. * @description:
  635. * Perform the matrix operation `b = a*b`.
  636. *
  637. * @input:
  638. * a ::
  639. * A pointer to matrix `a`.
  640. *
  641. * @inout:
  642. * b ::
  643. * A pointer to matrix `b`.
  644. *
  645. * @note:
  646. * The result is undefined if either `a` or `b` is zero.
  647. *
  648. * Since the function uses wrap-around arithmetic, results become
  649. * meaningless if the arguments are very large.
  650. */
  651. FT_EXPORT( void )
  652. FT_Matrix_Multiply( const FT_Matrix* a,
  653. FT_Matrix* b );
  654. /**************************************************************************
  655. *
  656. * @function:
  657. * FT_Matrix_Invert
  658. *
  659. * @description:
  660. * Invert a 2x2 matrix. Return an error if it can't be inverted.
  661. *
  662. * @inout:
  663. * matrix ::
  664. * A pointer to the target matrix. Remains untouched in case of error.
  665. *
  666. * @return:
  667. * FreeType error code. 0~means success.
  668. */
  669. FT_EXPORT( FT_Error )
  670. FT_Matrix_Invert( FT_Matrix* matrix );
  671. /* */
  672. FT_END_HEADER
  673. #endif /* FTGLYPH_H_ */
  674. /* END */
  675. /* Local Variables: */
  676. /* coding: utf-8 */
  677. /* End: */