ftimage.h 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  1. /***************************************************************************/
  2. /* */
  3. /* ftimage.h */
  4. /* */
  5. /* FreeType glyph image formats and default raster interface */
  6. /* (specification). */
  7. /* */
  8. /* Copyright 1996-2001, 2002 by */
  9. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  10. /* */
  11. /* This file is part of the FreeType project, and may only be used, */
  12. /* modified, and distributed under the terms of the FreeType project */
  13. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  14. /* this file you indicate that you have read the license and */
  15. /* understand and accept it fully. */
  16. /* */
  17. /***************************************************************************/
  18. /*************************************************************************/
  19. /* */
  20. /* Note: A `raster' is simply a scan-line converter, used to render */
  21. /* FT_Outlines into FT_Bitmaps. */
  22. /* */
  23. /*************************************************************************/
  24. #ifndef __FTIMAGE_H__
  25. #define __FTIMAGE_H__
  26. /* _STANDALONE_ is from ftgrays.c */
  27. #ifndef _STANDALONE_
  28. #include <ft2build.h>
  29. #endif
  30. FT_BEGIN_HEADER
  31. /*************************************************************************/
  32. /* */
  33. /* <Section> */
  34. /* basic_types */
  35. /* */
  36. /*************************************************************************/
  37. /*************************************************************************/
  38. /* */
  39. /* <Type> */
  40. /* FT_Pos */
  41. /* */
  42. /* <Description> */
  43. /* The type FT_Pos is a 32-bit integer used to store vectorial */
  44. /* coordinates. Depending on the context, these can represent */
  45. /* distances in integer font units, or 26.6 fixed float pixel */
  46. /* coordinates. */
  47. /* */
  48. typedef signed long FT_Pos;
  49. /*************************************************************************/
  50. /* */
  51. /* <Struct> */
  52. /* FT_Vector */
  53. /* */
  54. /* <Description> */
  55. /* A simple structure used to store a 2D vector; coordinates are of */
  56. /* the FT_Pos type. */
  57. /* */
  58. /* <Fields> */
  59. /* x :: The horizontal coordinate. */
  60. /* y :: The vertical coordinate. */
  61. /* */
  62. typedef struct FT_Vector_
  63. {
  64. FT_Pos x;
  65. FT_Pos y;
  66. } FT_Vector;
  67. /*************************************************************************/
  68. /* */
  69. /* <Struct> */
  70. /* FT_BBox */
  71. /* */
  72. /* <Description> */
  73. /* A structure used to hold an outline's bounding box, i.e., the */
  74. /* coordinates of its extrema in the horizontal and vertical */
  75. /* directions. */
  76. /* */
  77. /* <Fields> */
  78. /* xMin :: The horizontal minimum (left-most). */
  79. /* */
  80. /* yMin :: The vertical minimum (bottom-most). */
  81. /* */
  82. /* xMax :: The horizontal maximum (right-most). */
  83. /* */
  84. /* yMax :: The vertical maximum (top-most). */
  85. /* */
  86. typedef struct FT_BBox_
  87. {
  88. FT_Pos xMin, yMin;
  89. FT_Pos xMax, yMax;
  90. } FT_BBox;
  91. /*************************************************************************/
  92. /* */
  93. /* <Enum> */
  94. /* FT_Pixel_Mode */
  95. /* */
  96. /* <Description> */
  97. /* An enumeration type used to describe the format of pixels in a */
  98. /* given bitmap. Note that additional formats may be added in the */
  99. /* future. */
  100. /* */
  101. /* <Values> */
  102. /* FT_PIXEL_MODE_NONE :: */
  103. /* Value 0 is reserved. */
  104. /* */
  105. /* FT_PIXEL_MODE_MONO :: */
  106. /* A monochrome bitmap, using 1 bit per pixel. Note that pixels */
  107. /* are stored in most-significant order (MSB), which means that */
  108. /* the left-most pixel in a byte has value 128. */
  109. /* */
  110. /* FT_PIXEL_MODE_GRAY :: */
  111. /* An 8-bit bitmap, generally used to represent anti-aliased glyph */
  112. /* images. Each pixel is stored in one byte. Note that the number */
  113. /* of value "gray" levels is stored in the `num_bytes' field of */
  114. /* the @FT_Bitmap structure (it generally is 256). */
  115. /* */
  116. /* FT_PIXEL_MODE_GRAY2 :: */
  117. /* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */
  118. /* bitmaps in font files according to the OpenType specification. */
  119. /* We haven't found a single font using this format, however. */
  120. /* */
  121. /* FT_PIXEL_MODE_GRAY4 :: */
  122. /* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */
  123. /* bitmaps in font files according to the OpenType specification. */
  124. /* We haven't found a single font using this format, however. */
  125. /* */
  126. /* FT_PIXEL_MODE_LCD :: */
  127. /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
  128. /* images used for display on LCD displays; the bitmap's width is */
  129. /* three times wider than the original glyph image. See also */
  130. /* @FT_RENDER_MODE_LCD. */
  131. /* */
  132. /* FT_PIXEL_MODE_LCD_V :: */
  133. /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
  134. /* images used for display on rotated LCD displays; the bitmap's */
  135. /* height is three times taller than the original glyph image. */
  136. /* See also @FT_RENDER_MODE_LCD_V. */
  137. /* */
  138. typedef enum FT_Pixel_Mode_
  139. {
  140. FT_PIXEL_MODE_NONE = 0,
  141. FT_PIXEL_MODE_MONO,
  142. FT_PIXEL_MODE_GRAY,
  143. FT_PIXEL_MODE_GRAY2,
  144. FT_PIXEL_MODE_GRAY4,
  145. FT_PIXEL_MODE_LCD,
  146. FT_PIXEL_MODE_LCD_V,
  147. FT_PIXEL_MODE_MAX /* do not remove */
  148. } FT_Pixel_Mode;
  149. /*************************************************************************/
  150. /* */
  151. /* <Enum> */
  152. /* ft_pixel_mode_xxx */
  153. /* */
  154. /* <Description> */
  155. /* A list of deprecated constants. Use the corresponding */
  156. /* @FT_Pixel_Mode values instead. */
  157. /* */
  158. /* <Values> */
  159. /* ft_pixel_mode_none :: see @FT_PIXEL_MODE_NONE */
  160. /* ft_pixel_mode_mono :: see @FT_PIXEL_MODE_MONO */
  161. /* ft_pixel_mode_grays :: see @FT_PIXEL_MODE_GRAY */
  162. /* ft_pixel_mode_pal2 :: see @FT_PIXEL_MODE_GRAY2 */
  163. /* ft_pixel_mode_pal4 :: see @FT_PIXEL_MODE_GRAY4 */
  164. /* */
  165. #define ft_pixel_mode_none FT_PIXEL_MODE_NONE
  166. #define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
  167. #define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
  168. #define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
  169. #define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
  170. /* */
  171. #if 0
  172. /*************************************************************************/
  173. /* */
  174. /* <Enum> */
  175. /* FT_Palette_Mode */
  176. /* */
  177. /* <Description> */
  178. /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
  179. /* */
  180. /* An enumeration type used to describe the format of a bitmap */
  181. /* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
  182. /* */
  183. /* <Fields> */
  184. /* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */
  185. /* records. */
  186. /* */
  187. /* ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA */
  188. /* records. */
  189. /* */
  190. /* <Note> */
  191. /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
  192. /* FreeType, these types are not handled by the library itself. */
  193. /* */
  194. typedef enum FT_Palette_Mode_
  195. {
  196. ft_palette_mode_rgb = 0,
  197. ft_palette_mode_rgba,
  198. ft_palettte_mode_max /* do not remove */
  199. } FT_Palette_Mode;
  200. /* */
  201. #endif
  202. /*************************************************************************/
  203. /* */
  204. /* <Struct> */
  205. /* FT_Bitmap */
  206. /* */
  207. /* <Description> */
  208. /* A structure used to describe a bitmap or pixmap to the raster. */
  209. /* Note that we now manage pixmaps of various depths through the */
  210. /* `pixel_mode' field. */
  211. /* */
  212. /* <Fields> */
  213. /* rows :: The number of bitmap rows. */
  214. /* */
  215. /* width :: The number of pixels in bitmap row. */
  216. /* */
  217. /* pitch :: The pitch's absolute value is the number of bytes */
  218. /* taken by one bitmap row, including padding. */
  219. /* However, the pitch is positive when the bitmap has */
  220. /* a `down' flow, and negative when it has an `up' */
  221. /* flow. In all cases, the pitch is an offset to add */
  222. /* to a bitmap pointer in order to go down one row. */
  223. /* */
  224. /* buffer :: A typeless pointer to the bitmap buffer. This */
  225. /* value should be aligned on 32-bit boundaries in */
  226. /* most cases. */
  227. /* */
  228. /* num_grays :: This field is only used with */
  229. /* `FT_PIXEL_MODE_GRAY'; it gives the number of gray */
  230. /* levels used in the bitmap. */
  231. /* */
  232. /* pixel_mode :: The pixel_mode, i.e., how pixel bits are stored. */
  233. /* */
  234. /* palette_mode :: This field is only used with paletted pixel modes; */
  235. /* it indicates how the palette is stored. */
  236. /* */
  237. /* palette :: A typeless pointer to the bitmap palette; only */
  238. /* used for paletted pixel modes. */
  239. /* */
  240. /* <Note> */
  241. /* For now, the only pixel mode supported by FreeType are mono and */
  242. /* grays. However, drivers might be added in the future to support */
  243. /* more `colorful' options. */
  244. /* */
  245. /* When using pixel modes pal2, pal4 and pal8 with a void `palette' */
  246. /* field, a gray pixmap with respectively 4, 16, and 256 levels of */
  247. /* gray is assumed. This, in order to be compatible with some */
  248. /* embedded bitmap formats defined in the TrueType specification. */
  249. /* */
  250. /* Note that no font was found presenting such embedded bitmaps, so */
  251. /* this is currently completely unhandled by the library. */
  252. /* */
  253. typedef struct FT_Bitmap_
  254. {
  255. int rows;
  256. int width;
  257. int pitch;
  258. unsigned char* buffer;
  259. short num_grays;
  260. char pixel_mode;
  261. char palette_mode;
  262. void* palette;
  263. } FT_Bitmap;
  264. /*************************************************************************/
  265. /* */
  266. /* <Section> */
  267. /* outline_processing */
  268. /* */
  269. /*************************************************************************/
  270. /*************************************************************************/
  271. /* */
  272. /* <Struct> */
  273. /* FT_Outline */
  274. /* */
  275. /* <Description> */
  276. /* This structure is used to describe an outline to the scan-line */
  277. /* converter. */
  278. /* */
  279. /* <Fields> */
  280. /* n_contours :: The number of contours in the outline. */
  281. /* */
  282. /* n_points :: The number of points in the outline. */
  283. /* */
  284. /* points :: A pointer to an array of `n_points' FT_Vector */
  285. /* elements, giving the outline's point coordinates. */
  286. /* */
  287. /* tags :: A pointer to an array of `n_points' chars, giving */
  288. /* each outline point's type. If bit 0 is unset, the */
  289. /* point is `off' the curve, i.e. a Bezier control */
  290. /* point, while it is `on' when set. */
  291. /* */
  292. /* Bit 1 is meaningful for `off' points only. If set, */
  293. /* it indicates a third-order Bezier arc control point; */
  294. /* and a second-order control point if unset. */
  295. /* */
  296. /* contours :: An array of `n_contours' shorts, giving the end */
  297. /* point of each contour within the outline. For */
  298. /* example, the first contour is defined by the points */
  299. /* `0' to `contours[0]', the second one is defined by */
  300. /* the points `contours[0]+1' to `contours[1]', etc. */
  301. /* */
  302. /* flags :: A set of bit flags used to characterize the outline */
  303. /* and give hints to the scan-converter and hinter on */
  304. /* how to convert/grid-fit it. See FT_Outline_Flags. */
  305. /* */
  306. typedef struct FT_Outline_
  307. {
  308. short n_contours; /* number of contours in glyph */
  309. short n_points; /* number of points in the glyph */
  310. FT_Vector* points; /* the outline's points */
  311. char* tags; /* the points flags */
  312. short* contours; /* the contour end points */
  313. int flags; /* outline masks */
  314. } FT_Outline;
  315. /*************************************************************************/
  316. /* */
  317. /* <Enum> */
  318. /* FT_Outline_Flags */
  319. /* */
  320. /* <Description> */
  321. /* A simple type used to enumerates the flags in an outline's */
  322. /* `outline_flags' field. */
  323. /* */
  324. /* <Values> */
  325. /* FT_OUTLINE_NONE :: Value 0 is reserved. */
  326. /* */
  327. /* FT_OUTLINE_OWNER :: If set, this flag indicates that the */
  328. /* outline's field arrays (i.e. */
  329. /* `points', `flags' & `contours') are */
  330. /* `owned' by the outline object, and */
  331. /* should thus be freed when it is */
  332. /* destroyed. */
  333. /* */
  334. /* FT_OUTLINE_EVEN_ODD_FILL :: By default, outlines are filled using */
  335. /* the non-zero winding rule. If set to */
  336. /* 1, the outline will be filled using */
  337. /* the even-odd fill rule (only works */
  338. /* with the smooth raster). */
  339. /* */
  340. /* FT_OUTLINE_REVERSE_FILL :: By default, outside contours of an */
  341. /* outline are oriented in clock-wise */
  342. /* direction, as defined in the TrueType */
  343. /* specification. This flag is set if */
  344. /* the outline uses the opposite */
  345. /* direction (typically for Type 1 */
  346. /* fonts). This flag is ignored by the */
  347. /* scan-converter. However, it is very */
  348. /* important for the auto-hinter. */
  349. /* */
  350. /* FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */
  351. /* try to detect drop-outs in an outline */
  352. /* and correct the glyph bitmap to */
  353. /* ensure consistent shape continuity. */
  354. /* If set, this flag hints the scan-line */
  355. /* converter to ignore such cases. */
  356. /* */
  357. /* FT_OUTLINE_HIGH_PRECISION :: This flag indicates that the */
  358. /* scan-line converter should try to */
  359. /* convert this outline to bitmaps with */
  360. /* the highest possible quality. It is */
  361. /* typically set for small character */
  362. /* sizes. Note that this is only a */
  363. /* hint, that might be completely */
  364. /* ignored by a given scan-converter. */
  365. /* */
  366. /* FT_OUTLINE_SINGLE_PASS :: This flag is set to force a given */
  367. /* scan-converter to only use a single */
  368. /* pass over the outline to render a */
  369. /* bitmap glyph image. Normally, it is */
  370. /* set for very large character sizes. */
  371. /* It is only a hint, that might be */
  372. /* completely ignored by a given */
  373. /* scan-converter. */
  374. /* */
  375. typedef enum FT_Outline_Flags_
  376. {
  377. FT_OUTLINE_NONE = 0,
  378. FT_OUTLINE_OWNER = 1,
  379. FT_OUTLINE_EVEN_ODD_FILL = 2,
  380. FT_OUTLINE_REVERSE_FILL = 4,
  381. FT_OUTLINE_IGNORE_DROPOUTS = 8,
  382. FT_OUTLINE_HIGH_PRECISION = 256,
  383. FT_OUTLINE_SINGLE_PASS = 512
  384. } FT_Outline_Flags;
  385. /*************************************************************************
  386. *
  387. * @enum:
  388. * ft_outline_xxx
  389. *
  390. * @description:
  391. * These constants are deprecated. Please use the corresponding
  392. * @FT_OUTLINE_XXX values.
  393. *
  394. * @values:
  395. * ft_outline_none :: See @FT_OUTLINE_NONE.
  396. * ft_outline_owner :: See @FT_OUTLINE_OWNER.
  397. * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
  398. * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
  399. * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
  400. * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
  401. * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
  402. */
  403. #define ft_outline_none FT_OUTLINE_NONE
  404. #define ft_outline_owner FT_OUTLINE_OWNER
  405. #define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
  406. #define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
  407. #define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
  408. #define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
  409. #define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
  410. /* */
  411. #define FT_CURVE_TAG( flag ) ( flag & 3 )
  412. #define FT_CURVE_TAG_ON 1
  413. #define FT_CURVE_TAG_CONIC 0
  414. #define FT_CURVE_TAG_CUBIC 2
  415. #define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
  416. #define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
  417. #define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
  418. FT_CURVE_TAG_TOUCH_Y )
  419. #define FT_Curve_Tag_On FT_CURVE_TAG_ON
  420. #define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
  421. #define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
  422. #define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
  423. #define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
  424. /*************************************************************************/
  425. /* */
  426. /* <FuncType> */
  427. /* FT_Outline_MoveToFunc */
  428. /* */
  429. /* <Description> */
  430. /* A function pointer type used to describe the signature of a `move */
  431. /* to' function during outline walking/decomposition. */
  432. /* */
  433. /* A `move to' is emitted to start a new contour in an outline. */
  434. /* */
  435. /* <Input> */
  436. /* to :: A pointer to the target point of the `move to'. */
  437. /* */
  438. /* user :: A typeless pointer which is passed from the caller of the */
  439. /* decomposition function. */
  440. /* */
  441. /* <Return> */
  442. /* Error code. 0 means success. */
  443. /* */
  444. typedef int
  445. (*FT_Outline_MoveToFunc)( FT_Vector* to,
  446. void* user );
  447. #define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
  448. /*************************************************************************/
  449. /* */
  450. /* <FuncType> */
  451. /* FT_Outline_LineToFunc */
  452. /* */
  453. /* <Description> */
  454. /* A function pointer type used to describe the signature of a `line */
  455. /* to' function during outline walking/decomposition. */
  456. /* */
  457. /* A `line to' is emitted to indicate a segment in the outline. */
  458. /* */
  459. /* <Input> */
  460. /* to :: A pointer to the target point of the `line to'. */
  461. /* */
  462. /* user :: A typeless pointer which is passed from the caller of the */
  463. /* decomposition function. */
  464. /* */
  465. /* <Return> */
  466. /* Error code. 0 means success. */
  467. /* */
  468. typedef int
  469. (*FT_Outline_LineToFunc)( FT_Vector* to,
  470. void* user );
  471. #define FT_Outline_LineTo_Func FT_Outline_LineToFunc
  472. /*************************************************************************/
  473. /* */
  474. /* <FuncType> */
  475. /* FT_Outline_ConicToFunc */
  476. /* */
  477. /* <Description> */
  478. /* A function pointer type use to describe the signature of a `conic */
  479. /* to' function during outline walking/decomposition. */
  480. /* */
  481. /* A `conic to' is emitted to indicate a second-order Bezier arc in */
  482. /* the outline. */
  483. /* */
  484. /* <Input> */
  485. /* control :: An intermediate control point between the last position */
  486. /* and the new target in `to'. */
  487. /* */
  488. /* to :: A pointer to the target end point of the conic arc. */
  489. /* */
  490. /* user :: A typeless pointer which is passed from the caller of */
  491. /* the decomposition function. */
  492. /* */
  493. /* <Return> */
  494. /* Error code. 0 means success. */
  495. /* */
  496. typedef int
  497. (*FT_Outline_ConicToFunc)( FT_Vector* control,
  498. FT_Vector* to,
  499. void* user );
  500. #define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
  501. /*************************************************************************/
  502. /* */
  503. /* <FuncType> */
  504. /* FT_Outline_CubicToFunc */
  505. /* */
  506. /* <Description> */
  507. /* A function pointer type used to describe the signature of a `cubic */
  508. /* to' function during outline walking/decomposition. */
  509. /* */
  510. /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
  511. /* */
  512. /* <Input> */
  513. /* control1 :: A pointer to the first Bezier control point. */
  514. /* */
  515. /* control2 :: A pointer to the second Bezier control point. */
  516. /* */
  517. /* to :: A pointer to the target end point. */
  518. /* */
  519. /* user :: A typeless pointer which is passed from the caller of */
  520. /* the decomposition function. */
  521. /* */
  522. /* <Return> */
  523. /* Error code. 0 means success. */
  524. /* */
  525. typedef int
  526. (*FT_Outline_CubicToFunc)( FT_Vector* control1,
  527. FT_Vector* control2,
  528. FT_Vector* to,
  529. void* user );
  530. #define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
  531. /*************************************************************************/
  532. /* */
  533. /* <Struct> */
  534. /* FT_Outline_Funcs */
  535. /* */
  536. /* <Description> */
  537. /* A structure to hold various function pointers used during outline */
  538. /* decomposition in order to emit segments, conic, and cubic Beziers, */
  539. /* as well as `move to' and `close to' operations. */
  540. /* */
  541. /* <Fields> */
  542. /* move_to :: The `move to' emitter. */
  543. /* */
  544. /* line_to :: The segment emitter. */
  545. /* */
  546. /* conic_to :: The second-order Bezier arc emitter. */
  547. /* */
  548. /* cubic_to :: The third-order Bezier arc emitter. */
  549. /* */
  550. /* shift :: The shift that is applied to coordinates before they */
  551. /* are sent to the emitter. */
  552. /* */
  553. /* delta :: The delta that is applied to coordinates before they */
  554. /* are sent to the emitter, but after the shift. */
  555. /* */
  556. /* <Note> */
  557. /* The point coordinates sent to the emitters are the transformed */
  558. /* version of the original coordinates (this is important for high */
  559. /* accuracy during scan-conversion). The transformation is simple: */
  560. /* */
  561. /* x' = (x << shift) - delta */
  562. /* y' = (x << shift) - delta */
  563. /* */
  564. /* Set the value of `shift' and `delta' to 0 to get the original */
  565. /* point coordinates. */
  566. /* */
  567. typedef struct FT_Outline_Funcs_
  568. {
  569. FT_Outline_MoveToFunc move_to;
  570. FT_Outline_LineToFunc line_to;
  571. FT_Outline_ConicToFunc conic_to;
  572. FT_Outline_CubicToFunc cubic_to;
  573. int shift;
  574. FT_Pos delta;
  575. } FT_Outline_Funcs;
  576. /*************************************************************************/
  577. /* */
  578. /* <Section> */
  579. /* basic_types */
  580. /* */
  581. /*************************************************************************/
  582. /*************************************************************************/
  583. /* */
  584. /* <Macro> */
  585. /* FT_IMAGE_TAG */
  586. /* */
  587. /* <Description> */
  588. /* This macro converts four letter tags into an unsigned long. */
  589. /* */
  590. /* <Note> */
  591. /* Since many 16bit compilers don't like 32bit enumerations, you */
  592. /* should redefine this macro in case of problems to something like */
  593. /* this: */
  594. /* */
  595. /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) (value) */
  596. /* */
  597. /* to get a simple enumeration without assigning special numbers. */
  598. /* */
  599. #ifndef FT_IMAGE_TAG
  600. #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
  601. value = ( ( (unsigned long)_x1 << 24 ) | \
  602. ( (unsigned long)_x2 << 16 ) | \
  603. ( (unsigned long)_x3 << 8 ) | \
  604. (unsigned long)_x4 )
  605. #endif /* FT_IMAGE_TAG */
  606. /*************************************************************************/
  607. /* */
  608. /* <Enum> */
  609. /* FT_Glyph_Format */
  610. /* */
  611. /* <Description> */
  612. /* An enumeration type used to describe the format of a given glyph */
  613. /* image. Note that this version of FreeType only supports two image */
  614. /* formats, even though future font drivers will be able to register */
  615. /* their own format. */
  616. /* */
  617. /* <Values> */
  618. /* FT_GLYPH_FORMAT_NONE :: */
  619. /* The value 0 is reserved and does describe a glyph format. */
  620. /* */
  621. /* FT_GLYPH_FORMAT_COMPOSITE :: */
  622. /* The glyph image is a composite of several other images. This */
  623. /* format is _only_ used with @FT_LOAD_FLAG_NO_RECURSE, and is */
  624. /* used to report compound glyphs (like accented characters). */
  625. /* */
  626. /* FT_GLYPH_FORMAT_BITMAP :: */
  627. /* The glyph image is a bitmap, and can be described as an */
  628. /* @FT_Bitmap. You generally need to access the `bitmap' field of */
  629. /* the @FT_GlyphSlotRec structure to read it. */
  630. /* */
  631. /* FT_GLYPH_FORMAT_OUTLINE :: */
  632. /* The glyph image is a vertorial outline made of line segments */
  633. /* and Bezier arcs; it can be described as an @FT_Outline; you */
  634. /* generally want to access the `outline' field of the */
  635. /* @FT_GlyphSlotRec structure to read it. */
  636. /* */
  637. /* FT_GLYPH_FORMAT_PLOTTER :: */
  638. /* The glyph image is a vectorial path with no inside/outside */
  639. /* contours. Some Type 1 fonts, like those in the Hershey family, */
  640. /* contain glyphs in this format. These are described as */
  641. /* @FT_Outline, but FreeType isn't currently capable of rendering */
  642. /* them correctly. */
  643. /* */
  644. typedef enum FT_Glyph_Format_
  645. {
  646. FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
  647. FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
  648. FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
  649. FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
  650. FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
  651. } FT_Glyph_Format;
  652. /*************************************************************************/
  653. /* */
  654. /* <Enum> */
  655. /* ft_glyph_format_xxx */
  656. /* */
  657. /* <Description> */
  658. /* A list of decprecated constants. Use the corresponding */
  659. /* @FT_Glyph_Format values instead. */
  660. /* */
  661. /* <Values> */
  662. /* ft_glyph_format_none :: see @FT_GLYPH_FORMAT_NONE */
  663. /* ft_glyph_format_composite :: see @FT_GLYPH_FORMAT_COMPOSITE */
  664. /* ft_glyph_format_bitmap :: see @FT_GLYPH_FORMAT_BITMAP */
  665. /* ft_glyph_format_outline :: see @FT_GLYPH_FORMAT_OUTLINE */
  666. /* ft_glyph_format_plotter :: see @FT_GLYPH_FORMAT_PLOTTER */
  667. /* */
  668. #define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
  669. #define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
  670. #define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
  671. #define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
  672. #define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
  673. /*************************************************************************/
  674. /*************************************************************************/
  675. /*************************************************************************/
  676. /***** *****/
  677. /***** R A S T E R D E F I N I T I O N S *****/
  678. /***** *****/
  679. /*************************************************************************/
  680. /*************************************************************************/
  681. /*************************************************************************/
  682. /*************************************************************************/
  683. /* */
  684. /* A raster is a scan converter, in charge of rendering an outline into */
  685. /* a a bitmap. This section contains the public API for rasters. */
  686. /* */
  687. /* Note that in FreeType 2, all rasters are now encapsulated within */
  688. /* specific modules called `renderers'. See `freetype/ftrender.h' for */
  689. /* more details on renderers. */
  690. /* */
  691. /*************************************************************************/
  692. /*************************************************************************/
  693. /* */
  694. /* <Section> */
  695. /* raster */
  696. /* */
  697. /* <Title> */
  698. /* Scanline converter */
  699. /* */
  700. /* <Abstract> */
  701. /* How vectorial outlines are converted into bitmaps and pixmaps. */
  702. /* */
  703. /* <Description> */
  704. /* This section contains technical definitions. */
  705. /* */
  706. /*************************************************************************/
  707. /*************************************************************************/
  708. /* */
  709. /* <Type> */
  710. /* FT_Raster */
  711. /* */
  712. /* <Description> */
  713. /* A handle (pointer) to a raster object. Each object can be used */
  714. /* independently to convert an outline into a bitmap or pixmap. */
  715. /* */
  716. typedef struct FT_RasterRec_* FT_Raster;
  717. /*************************************************************************/
  718. /* */
  719. /* <Struct> */
  720. /* FT_Span */
  721. /* */
  722. /* <Description> */
  723. /* A structure used to model a single span of gray (or black) pixels */
  724. /* when rendering a monochrome or anti-aliased bitmap. */
  725. /* */
  726. /* <Fields> */
  727. /* x :: The span's horizontal start position. */
  728. /* */
  729. /* len :: The span's length in pixels. */
  730. /* */
  731. /* coverage :: The span color/coverage, ranging from 0 (background) */
  732. /* to 255 (foreground). Only used for anti-aliased */
  733. /* rendering. */
  734. /* */
  735. /* <Note> */
  736. /* This structure is used by the span drawing callback type named */
  737. /* FT_SpanFunc which takes the y-coordinate of the span as a */
  738. /* a parameter. */
  739. /* */
  740. /* The coverage value is always between 0 and 255, even if the number */
  741. /* of gray levels have been set through FT_Set_Gray_Levels(). */
  742. /* */
  743. typedef struct FT_Span_
  744. {
  745. short x;
  746. unsigned short len;
  747. unsigned char coverage;
  748. } FT_Span;
  749. /*************************************************************************/
  750. /* */
  751. /* <FuncType> */
  752. /* FT_SpanFunc */
  753. /* */
  754. /* <Description> */
  755. /* A function used as a call-back by the anti-aliased renderer in */
  756. /* order to let client applications draw themselves the gray pixel */
  757. /* spans on each scan line. */
  758. /* */
  759. /* <Input> */
  760. /* y :: The scanline's y-coordinate. */
  761. /* */
  762. /* count :: The number of spans to draw on this scanline. */
  763. /* */
  764. /* spans :: A table of `count' spans to draw on the scanline. */
  765. /* */
  766. /* user :: User-supplied data that is passed to the callback. */
  767. /* */
  768. /* <Note> */
  769. /* This callback allows client applications to directly render the */
  770. /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
  771. /* */
  772. /* This can be used to write anti-aliased outlines directly to a */
  773. /* given background bitmap, and even perform translucency. */
  774. /* */
  775. /* Note that the `count' field cannot be greater than a fixed value */
  776. /* defined by the FT_MAX_GRAY_SPANS configuration macro in */
  777. /* ftoption.h. By default, this value is set to 32, which means that */
  778. /* if there are more than 32 spans on a given scanline, the callback */
  779. /* will be called several times with the same `y' parameter in order */
  780. /* to draw all callbacks. */
  781. /* */
  782. /* Otherwise, the callback is only called once per scan-line, and */
  783. /* only for those scanlines that do have `gray' pixels on them. */
  784. /* */
  785. typedef void
  786. (*FT_SpanFunc)( int y,
  787. int count,
  788. FT_Span* spans,
  789. void* user );
  790. #define FT_Raster_Span_Func FT_SpanFunc
  791. /*************************************************************************/
  792. /* */
  793. /* <FuncType> */
  794. /* FT_Raster_BitTest_Func */
  795. /* */
  796. /* <Description> */
  797. /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
  798. /* */
  799. /* A function used as a call-back by the monochrome scan-converter */
  800. /* to test whether a given target pixel is already set to the drawing */
  801. /* `color'. These tests are crucial to implement drop-out control */
  802. /* per-se the TrueType spec. */
  803. /* */
  804. /* <Input> */
  805. /* y :: The pixel's y-coordinate. */
  806. /* */
  807. /* x :: The pixel's x-coordinate. */
  808. /* */
  809. /* user :: User-supplied data that is passed to the callback. */
  810. /* */
  811. /* <Return> */
  812. /* 1 if the pixel is `set', 0 otherwise. */
  813. /* */
  814. typedef int
  815. (*FT_Raster_BitTest_Func)( int y,
  816. int x,
  817. void* user );
  818. /*************************************************************************/
  819. /* */
  820. /* <FuncType> */
  821. /* FT_Raster_BitSet_Func */
  822. /* */
  823. /* <Description> */
  824. /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
  825. /* */
  826. /* A function used as a call-back by the monochrome scan-converter */
  827. /* to set an individual target pixel. This is crucial to implement */
  828. /* drop-out control according to the TrueType specification. */
  829. /* */
  830. /* <Input> */
  831. /* y :: The pixel's y-coordinate. */
  832. /* */
  833. /* x :: The pixel's x-coordinate. */
  834. /* */
  835. /* user :: User-supplied data that is passed to the callback. */
  836. /* */
  837. /* <Return> */
  838. /* 1 if the pixel is `set', 0 otherwise. */
  839. /* */
  840. typedef void
  841. (*FT_Raster_BitSet_Func)( int y,
  842. int x,
  843. void* user );
  844. /*************************************************************************/
  845. /* */
  846. /* <Enum> */
  847. /* FT_Raster_Flag */
  848. /* */
  849. /* <Description> */
  850. /* An enumeration to list the bit flags as used in the `flags' field */
  851. /* of a FT_Raster_Params structure. */
  852. /* */
  853. /* <Values> */
  854. /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
  855. /* */
  856. /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
  857. /* anti-aliased glyph image should be */
  858. /* generated. Otherwise, it will be */
  859. /* monochrome (1-bit) */
  860. /* */
  861. /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
  862. /* rendering. In this mode, client */
  863. /* applications must provide their own span */
  864. /* callback. This lets them directly */
  865. /* draw or compose over an existing bitmap. */
  866. /* If this bit is not set, the target */
  867. /* pixmap's buffer _must_ be zeroed before */
  868. /* rendering. */
  869. /* */
  870. /* Note that for now, direct rendering is */
  871. /* only possible with anti-aliased glyphs. */
  872. /* */
  873. /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
  874. /* rendering mode. If set, the output will */
  875. /* be clipped to a box specified in the */
  876. /* "clip_box" field of the FT_Raster_Params */
  877. /* structure. */
  878. /* */
  879. /* Note that by default, the glyph bitmap */
  880. /* is clipped to the target pixmap, except */
  881. /* in direct rendering mode where all spans */
  882. /* are generated if no clipping box is set. */
  883. /* */
  884. typedef enum
  885. {
  886. FT_RASTER_FLAG_DEFAULT = 0,
  887. FT_RASTER_FLAG_AA = 1,
  888. FT_RASTER_FLAG_DIRECT = 2,
  889. FT_RASTER_FLAG_CLIP = 4
  890. } FT_Raster_Flag;
  891. #define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
  892. #define ft_raster_flag_aa FT_RASTER_FLAG_AA
  893. #define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
  894. #define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
  895. /*************************************************************************/
  896. /* */
  897. /* <Struct> */
  898. /* FT_Raster_Params */
  899. /* */
  900. /* <Description> */
  901. /* A structure to hold the arguments used by a raster's render */
  902. /* function. */
  903. /* */
  904. /* <Fields> */
  905. /* target :: The target bitmap. */
  906. /* */
  907. /* source :: A pointer to the source glyph image (e.g. an */
  908. /* FT_Outline). */
  909. /* */
  910. /* flags :: The rendering flags. */
  911. /* */
  912. /* gray_spans :: The gray span drawing callback. */
  913. /* */
  914. /* black_spans :: The black span drawing callback. */
  915. /* */
  916. /* bit_test :: The bit test callback. UNIMPLEMENTED! */
  917. /* */
  918. /* bit_set :: The bit set callback. UNIMPLEMENTED! */
  919. /* */
  920. /* user :: User-supplied data that is passed to each drawing */
  921. /* callback. */
  922. /* */
  923. /* clip_box :: An optional clipping box. It is only used in */
  924. /* direct rendering mode. Note that coordinates here */
  925. /* should be expressed in _integer_ pixels (and not in */
  926. /* 26.6 fixed-point units). */
  927. /* */
  928. /* <Note> */
  929. /* An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit */
  930. /* flag is set in the `flags' field, otherwise a monochrome bitmap */
  931. /* will be generated. */
  932. /* */
  933. /* If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
  934. /* raster will call the `gray_spans' callback to draw gray pixel */
  935. /* spans, in the case of an aa glyph bitmap, it will call */
  936. /* `black_spans', and `bit_test' and `bit_set' in the case of a */
  937. /* monochrome bitmap. This allows direct composition over a */
  938. /* pre-existing bitmap through user-provided callbacks to perform the */
  939. /* span drawing/composition. */
  940. /* */
  941. /* Note that the `bit_test' and `bit_set' callbacks are required when */
  942. /* rendering a monochrome bitmap, as they are crucial to implement */
  943. /* correct drop-out control as defined in the TrueType specification. */
  944. /* */
  945. typedef struct FT_Raster_Params_
  946. {
  947. FT_Bitmap* target;
  948. void* source;
  949. int flags;
  950. FT_SpanFunc gray_spans;
  951. FT_SpanFunc black_spans;
  952. FT_Raster_BitTest_Func bit_test; /* doesn't work! */
  953. FT_Raster_BitSet_Func bit_set; /* doesn't work! */
  954. void* user;
  955. FT_BBox clip_box;
  956. } FT_Raster_Params;
  957. /*************************************************************************/
  958. /* */
  959. /* <FuncType> */
  960. /* FT_Raster_NewFunc */
  961. /* */
  962. /* <Description> */
  963. /* A function used to create a new raster object. */
  964. /* */
  965. /* <Input> */
  966. /* memory :: A handle to the memory allocator. */
  967. /* */
  968. /* <Output> */
  969. /* raster :: A handle to the new raster object. */
  970. /* */
  971. /* <Return> */
  972. /* Error code. 0 means success. */
  973. /* */
  974. /* <Note> */
  975. /* The `memory' parameter is a typeless pointer in order to avoid */
  976. /* un-wanted dependencies on the rest of the FreeType code. In */
  977. /* practice, it is a FT_Memory, i.e., a handle to the standard */
  978. /* FreeType memory allocator. However, this field can be completely */
  979. /* ignored by a given raster implementation. */
  980. /* */
  981. typedef int
  982. (*FT_Raster_NewFunc)( void* memory,
  983. FT_Raster* raster );
  984. #define FT_Raster_New_Func FT_Raster_NewFunc
  985. /*************************************************************************/
  986. /* */
  987. /* <FuncType> */
  988. /* FT_Raster_DoneFunc */
  989. /* */
  990. /* <Description> */
  991. /* A function used to destroy a given raster object. */
  992. /* */
  993. /* <Input> */
  994. /* raster :: A handle to the raster object. */
  995. /* */
  996. typedef void
  997. (*FT_Raster_DoneFunc)( FT_Raster raster );
  998. #define FT_Raster_Done_Func FT_Raster_DoneFunc
  999. /*************************************************************************/
  1000. /* */
  1001. /* <FuncType> */
  1002. /* FT_Raster_ResetFunc */
  1003. /* */
  1004. /* <Description> */
  1005. /* FreeType provides an area of memory called the `render pool', */
  1006. /* available to all registered rasters. This pool can be freely used */
  1007. /* during a given scan-conversion but is shared by all rasters. Its */
  1008. /* content is thus transient. */
  1009. /* */
  1010. /* This function is called each time the render pool changes, or just */
  1011. /* after a new raster object is created. */
  1012. /* */
  1013. /* <Input> */
  1014. /* raster :: A handle to the new raster object. */
  1015. /* */
  1016. /* pool_base :: The address in memory of the render pool. */
  1017. /* */
  1018. /* pool_size :: The size in bytes of the render pool. */
  1019. /* */
  1020. /* <Note> */
  1021. /* Rasters can ignore the render pool and rely on dynamic memory */
  1022. /* allocation if they want to (a handle to the memory allocator is */
  1023. /* passed to the raster constructor). However, this is not */
  1024. /* recommended for efficiency purposes. */
  1025. /* */
  1026. typedef void
  1027. (*FT_Raster_ResetFunc)( FT_Raster raster,
  1028. unsigned char* pool_base,
  1029. unsigned long pool_size );
  1030. #define FT_Raster_Reset_Func FT_Raster_ResetFunc
  1031. /*************************************************************************/
  1032. /* */
  1033. /* <FuncType> */
  1034. /* FT_Raster_SetModeFunc */
  1035. /* */
  1036. /* <Description> */
  1037. /* This function is a generic facility to change modes or attributes */
  1038. /* in a given raster. This can be used for debugging purposes, or */
  1039. /* simply to allow implementation-specific `features' in a given */
  1040. /* raster module. */
  1041. /* */
  1042. /* <Input> */
  1043. /* raster :: A handle to the new raster object. */
  1044. /* */
  1045. /* mode :: A 4-byte tag used to name the mode or property. */
  1046. /* */
  1047. /* args :: A pointer to the new mode/property to use. */
  1048. /* */
  1049. typedef int
  1050. (*FT_Raster_SetModeFunc)( FT_Raster raster,
  1051. unsigned long mode,
  1052. void* args );
  1053. #define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
  1054. /*************************************************************************/
  1055. /* */
  1056. /* <FuncType> */
  1057. /* FT_Raster_RenderFunc */
  1058. /* */
  1059. /* <Description> */
  1060. /* Invokes a given raster to scan-convert a given glyph image into a */
  1061. /* target bitmap. */
  1062. /* */
  1063. /* <Input> */
  1064. /* raster :: A handle to the raster object. */
  1065. /* */
  1066. /* params :: A pointer to a FT_Raster_Params structure used to store */
  1067. /* the rendering parameters. */
  1068. /* */
  1069. /* <Return> */
  1070. /* Error code. 0 means success. */
  1071. /* */
  1072. /* <Note> */
  1073. /* The exact format of the source image depends on the raster's glyph */
  1074. /* format defined in its FT_Raster_Funcs structure. It can be an */
  1075. /* FT_Outline or anything else in order to support a large array of */
  1076. /* glyph formats. */
  1077. /* */
  1078. /* Note also that the render function can fail and return a */
  1079. /* FT_Err_Unimplemented_Feature error code if the raster used does */
  1080. /* not support direct composition. */
  1081. /* */
  1082. /* XXX: For now, the standard raster doesn't support direct */
  1083. /* composition but this should change for the final release (see */
  1084. /* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
  1085. /* examples of distinct implementations which support direct */
  1086. /* composition). */
  1087. /* */
  1088. typedef int
  1089. (*FT_Raster_RenderFunc)( FT_Raster raster,
  1090. FT_Raster_Params* params );
  1091. #define FT_Raster_Render_Func FT_Raster_RenderFunc
  1092. /*************************************************************************/
  1093. /* */
  1094. /* <Struct> */
  1095. /* FT_Raster_Funcs */
  1096. /* */
  1097. /* <Description> */
  1098. /* A structure used to describe a given raster class to the library. */
  1099. /* */
  1100. /* <Fields> */
  1101. /* glyph_format :: The supported glyph format for this raster. */
  1102. /* */
  1103. /* raster_new :: The raster constructor. */
  1104. /* */
  1105. /* raster_reset :: Used to reset the render pool within the raster. */
  1106. /* */
  1107. /* raster_render :: A function to render a glyph into a given bitmap. */
  1108. /* */
  1109. /* raster_done :: The raster destructor. */
  1110. /* */
  1111. typedef struct FT_Raster_Funcs_
  1112. {
  1113. FT_Glyph_Format glyph_format;
  1114. FT_Raster_NewFunc raster_new;
  1115. FT_Raster_ResetFunc raster_reset;
  1116. FT_Raster_SetModeFunc raster_set_mode;
  1117. FT_Raster_RenderFunc raster_render;
  1118. FT_Raster_DoneFunc raster_done;
  1119. } FT_Raster_Funcs;
  1120. /* */
  1121. FT_END_HEADER
  1122. #endif /* __FTIMAGE_H__ */
  1123. /* END */