1 /***************************************************************************/
5 /* FreeType glyph image formats and default raster interface */
8 /* Copyright 1996-2000 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
17 /***************************************************************************/
19 /*************************************************************************/
21 /* Note: A `raster' is simply a scan-line converter, used to render */
22 /* FT_Outlines into FT_Bitmaps. */
24 /*************************************************************************/
36 /*************************************************************************/
42 /* The type FT_Pos is a 32-bit integer used to store vectorial */
43 /* coordinates. Depending on the context, these can represent */
44 /* distances in integer font units, or 26.6 fixed float pixel */
47 typedef signed long FT_Pos
;
50 /*************************************************************************/
56 /* A simple structure used to store a 2D vector; coordinates are of */
57 /* the FT_Pos type. */
60 /* x :: The horizontal coordinate. */
61 /* y :: The vertical coordinate. */
63 typedef struct FT_Vector_
71 /*************************************************************************/
77 /* An enumeration type used to describe the format of pixels in a */
78 /* given bitmap. Note that additional formats may be added in the */
82 /* ft_pixel_mode_mono :: A monochrome bitmap (1 bit/pixel). */
84 /* ft_pixel_mode_grays :: An 8-bit gray-levels bitmap. Note that the */
85 /* total number of gray levels is given in the */
86 /* `num_grays' field of the FT_Bitmap */
89 /* ft_pixel_mode_pal2 :: A 2-bit paletted bitmap. */
90 /* Currently unused by FreeType. */
92 /* ft_pixel_mode_pal4 :: A 4-bit paletted bitmap. */
93 /* Currently unused by FreeType. */
95 /* ft_pixel_mode_pal8 :: An 8-bit paletted bitmap. */
96 /* Currently unused by FreeType. */
98 /* ft_pixel_mode_rgb15 :: A 15-bit RGB bitmap. Uses 5:5:5 encoding. */
99 /* Currently unused by FreeType. */
101 /* ft_pixel_mode_rgb16 :: A 16-bit RGB bitmap. Uses 5:6:5 encoding. */
102 /* Currently unused by FreeType. */
104 /* ft_pixel_mode_rgb24 :: A 24-bit RGB bitmap. */
105 /* Currently unused by FreeType. */
107 /* ft_pixel_mode_rgb32 :: A 32-bit RGB bitmap. */
108 /* Currently unused by FreeType. */
111 /* Some anti-aliased bitmaps might be embedded in TrueType fonts */
112 /* using formats pal2 or pal4, though no fonts presenting those have */
113 /* been found to date. */
115 typedef enum FT_Pixel_Mode_
117 ft_pixel_mode_none
= 0,
128 ft_pixel_mode_max
/* do not remove */
133 /*************************************************************************/
136 /* FT_Palette_Mode */
139 /* An enumeration type used to describe the format of a bitmap */
140 /* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
143 /* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */
146 /* ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA */
150 /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
151 /* FreeType, these types are not handled by the library itself. */
153 typedef enum FT_Palette_Mode_
155 ft_palette_mode_rgb
= 0,
156 ft_palette_mode_rgba
,
158 ft_palettte_mode_max
/* do not remove */
163 /*************************************************************************/
169 /* A structure used to describe a bitmap or pixmap to the raster. */
170 /* Note that we now manage pixmaps of various depths through the */
171 /* `pixel_mode' field. */
174 /* rows :: The number of bitmap rows. */
176 /* width :: The number of pixels in bitmap row. */
178 /* pitch :: The pitch's absolute value is the number of bytes */
179 /* taken by one bitmap row, including padding. */
180 /* However, the pitch is positive when the bitmap has */
181 /* a `down' flow, and negative when it has an `up' */
182 /* flow. In all cases, the pitch is an offset to add */
183 /* to a bitmap pointer in order to go down one row. */
185 /* buffer :: A typeless pointer to the bitmap buffer. This */
186 /* value should be aligned on 32-bit boundaries in */
189 /* num_grays :: This field is only used with */
190 /* `ft_pixel_mode_grays'; it gives the number of gray */
191 /* levels used in the bitmap. */
193 /* pixel_mode :: The pixel_mode, i.e., how pixel bits are stored. */
195 /* palette_mode :: This field is only used with paletted pixel modes; */
196 /* it indicates how the palette is stored. */
198 /* palette :: A typeless pointer to the bitmap palette; only */
199 /* used for paletted pixel modes. */
202 /* For now, the only pixel mode supported by FreeType are mono and */
203 /* grays. However, drivers might be added in the future to support */
204 /* more `colorful' options. */
206 /* When using pixel modes pal2, pal4 and pal8 with a void `palette' */
207 /* field, a gray pixmap with respectively 4, 16, and 256 levels of */
208 /* gray is assumed. This, in order to be compatible with some */
209 /* embedded bitmap formats defined in the TrueType specification. */
211 /* Note that no font was found presenting such embedded bitmaps, so */
212 /* this is currently completely unhandled by the library. */
214 typedef struct FT_Bitmap_
219 unsigned char* buffer
;
228 /*************************************************************************/
234 /* This structure is used to describe an outline to the scan-line */
238 /* n_contours :: The number of contours in the outline. */
240 /* n_points :: The number of points in the outline. */
242 /* points :: A pointer to an array of `n_points' FT_Vector */
243 /* elements, giving the outline's point coordinates. */
245 /* tags :: A pointer to an array of `n_points' chars, giving */
246 /* giving each outline point's type. If bit 0 is */
247 /* unset, the point is 'off' the curve, i.e. a Bezier */
248 /* control point, while it is `on' when unset. */
250 /* Bit 1 is meaningful for `off' points only. If set, */
251 /* it indicates a third-order Bezier arc control point; */
252 /* and a second-order control point if unset. */
254 /* contours :: An array of `n_contours' shorts, giving the end */
255 /* point of each contour within the outline. For */
256 /* example, the first contour is defined by the points */
257 /* `0' to `contours[0]', the second one is defined by */
258 /* the points `contours[0]+1' to `contours[1]', etc. */
260 /* flags :: A set of bit flags used to characterize the outline */
261 /* and give hints to the scan-converter and hinter on */
262 /* how to convert/grid-fit it. See FT_Outline_Flags. */
264 typedef struct FT_Outline_
266 short n_contours
; /* number of contours in glyph */
267 short n_points
; /* number of points in the glyph */
269 FT_Vector
* points
; /* the outline's points */
270 char* tags
; /* the points flags */
271 short* contours
; /* the contour end points */
273 int flags
; /* outline masks */
278 /*************************************************************************/
281 /* FT_Outline_Flags */
284 /* A simple type used to enumerates the flags in an outline's */
285 /* `outline_flags' field. */
288 /* ft_outline_owner :: If set, this flag indicates that the */
289 /* outline's field arrays (i.e. */
290 /* `points', `flags' & `contours') are */
291 /* `owned' by the outline object, and */
292 /* should thus be freed when it is */
295 /* ft_outline_even_odd_fill :: By default, outlines are filled using */
296 /* the non-zero winding rule. If set to */
297 /* 1, the outline will be filled using */
298 /* the even-odd fill rule (only works */
299 /* with the smooth raster). */
301 /* ft_outline_reverse_fill :: By default, outside contours of an */
302 /* outline are oriented in clock-wise */
303 /* direction, as defined in the TrueType */
304 /* specification. This flag is set if */
305 /* the outline uses the opposite */
306 /* direction (typically for Type 1 */
307 /* fonts). This flag is ignored by the */
308 /* scan-converter. However, it is very */
309 /* important for the auto-hinter. */
311 /* ft_outline_ignore_dropouts :: By default, the scan converter will */
312 /* try to detect drop-outs in an outline */
313 /* and correct the glyph bitmap to */
314 /* ensure consistent shape continuity. */
315 /* If set, this flag hints the scan-line */
316 /* converter to ignore such cases. */
318 /* ft_outline_high_precision :: This flag indicates that the */
319 /* scan-line converter should try to */
320 /* convert this outline to bitmaps with */
321 /* the highest possible quality. It is */
322 /* typically set for small character */
323 /* sizes. Note that this is only a */
324 /* hint, that might be completely */
325 /* ignored by a given scan-converter. */
327 /* ft_outline_single_pass :: This flag is set to force a given */
328 /* scan-converter to only use a single */
329 /* pass over the outline to render a */
330 /* bitmap glyph image. Normally, it is */
331 /* set for very large character sizes. */
332 /* It is only a hint, that might be */
333 /* completely ignored by a given */
334 /* scan-converter. */
336 typedef enum FT_Outline_Flags_
339 ft_outline_owner
= 1,
340 ft_outline_even_odd_fill
= 2,
341 ft_outline_reverse_fill
= 4,
342 ft_outline_ignore_dropouts
= 8,
343 ft_outline_high_precision
= 256,
344 ft_outline_single_pass
= 512
349 #define FT_CURVE_TAG( flag ) ( flag & 3 )
351 #define FT_Curve_Tag_On 1
352 #define FT_Curve_Tag_Conic 0
353 #define FT_Curve_Tag_Cubic 2
355 #define FT_Curve_Tag_Touch_X 8 /* reserved for the TrueType hinter */
356 #define FT_Curve_Tag_Touch_Y 16 /* reserved for the TrueType hinter */
358 #define FT_Curve_Tag_Touch_Both ( FT_Curve_Tag_Touch_X | \
359 FT_Curve_Tag_Touch_Y )
362 /*************************************************************************/
365 /* FT_Outline_MoveTo_Func */
368 /* A function pointer type used to describe the signature of a `move */
369 /* to' function during outline walking/decomposition. */
371 /* A `move to' is emitted to start a new contour in an outline. */
374 /* to :: A pointer to the target point of the `move to'. */
376 /* user :: A typeless pointer which is passed from the caller of the */
377 /* decomposition function. */
380 /* Error code. 0 means success. */
382 typedef int (*FT_Outline_MoveTo_Func
)( FT_Vector
* to
,
386 /*************************************************************************/
389 /* FT_Outline_LineTo_Func */
392 /* A function pointer type used to describe the signature of a `line */
393 /* to' function during outline walking/decomposition. */
395 /* A `line to' is emitted to indicate a segment in the outline. */
398 /* to :: A pointer to the target point of the `line to'. */
400 /* user :: A typeless pointer which is passed from the caller of the */
401 /* decomposition function. */
404 /* Error code. 0 means success. */
406 typedef int (*FT_Outline_LineTo_Func
)( FT_Vector
* to
,
410 /*************************************************************************/
413 /* FT_Outline_ConicTo_Func */
416 /* A function pointer type use to describe the signature of a `conic */
417 /* to' function during outline walking/decomposition. */
419 /* A `conic to' is emitted to indicate a second-order Bezier arc in */
423 /* control :: An intermediate control point between the last position */
424 /* and the new target in `to'. */
426 /* to :: A pointer to the target end point of the conic arc. */
428 /* user :: A typeless pointer which is passed from the caller of */
429 /* the decomposition function. */
432 /* Error code. 0 means success. */
434 typedef int (*FT_Outline_ConicTo_Func
)( FT_Vector
* control
,
439 /*************************************************************************/
442 /* FT_Outline_CubicTo_Func */
445 /* A function pointer type used to describe the signature of a `cubic */
446 /* to' function during outline walking/decomposition. */
448 /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
451 /* control1 :: A pointer to the first Bezier control point. */
453 /* control2 :: A pointer to the second Bezier control point. */
455 /* to :: A pointer to the target end point. */
457 /* user :: A typeless pointer which is passed from the caller of */
458 /* the decomposition function. */
461 /* Error code. 0 means success. */
463 typedef int (*FT_Outline_CubicTo_Func
)( FT_Vector
* control1
,
469 /*************************************************************************/
472 /* FT_Outline_Funcs */
475 /* A structure to hold various function pointers used during outline */
476 /* decomposition in order to emit segments, conic, and cubic Beziers, */
477 /* as well as `move to' and `close to' operations. */
480 /* move_to :: The `move to' emitter. */
482 /* line_to :: The segment emitter. */
484 /* conic_to :: The second-order Bezier arc emitter. */
486 /* cubic_to :: The third-order Bezier arc emitter. */
488 /* shift :: The shift that is applied to coordinates before they */
489 /* are sent to the emitter. */
491 /* delta :: The delta that is applied to coordinates before they */
492 /* are sent to the emitter, but after the shift. */
495 /* The point coordinates sent to the emitters are the transformed */
496 /* version of the original coordinates (this is important for high */
497 /* accuracy during scan-conversion). The transformation is simple: */
499 /* x' = (x << shift) - delta */
500 /* y' = (x << shift) - delta */
502 /* Set the value of `shift' and `delta' to 0 to get the original */
503 /* point coordinates. */
505 typedef struct FT_Outline_Funcs_
507 FT_Outline_MoveTo_Func move_to
;
508 FT_Outline_LineTo_Func line_to
;
509 FT_Outline_ConicTo_Func conic_to
;
510 FT_Outline_CubicTo_Func cubic_to
;
518 /*************************************************************************/
524 /* This macro converts four letter tags into an unsigned long. */
526 #define FT_IMAGE_TAG( _x1, _x2, _x3, _x4 ) \
527 ( ( (unsigned long)_x1 << 24 ) | \
528 ( (unsigned long)_x2 << 16 ) | \
529 ( (unsigned long)_x3 << 8 ) | \
533 /*************************************************************************/
536 /* FT_Glyph_Format */
539 /* An enumeration type used to describe the format of a given glyph */
540 /* image. Note that this version of FreeType only supports two image */
541 /* formats, even though future font drivers will be able to register */
542 /* their own format. */
545 /* ft_glyph_format_composite :: The glyph image is a composite of */
546 /* several other images. This glyph */
547 /* format is _only_ used with the */
548 /* FT_LOAD_FLAG_NO_RECURSE flag (XXX: */
549 /* Which is currently unimplemented). */
551 /* ft_glyph_format_bitmap :: The glyph image is a bitmap, and can */
552 /* be described as a FT_Bitmap. */
554 /* ft_glyph_format_outline :: The glyph image is a vectorial image */
555 /* made of bezier control points, and */
556 /* can be described as a FT_Outline. */
558 /* ft_glyph_format_plotter :: The glyph image is a vectorial image */
559 /* made of plotter lines (some T1 fonts */
560 /* like Hershey contain glyph in this */
563 typedef enum FT_Glyph_Format_
565 ft_glyph_format_none
= 0,
566 ft_glyph_format_composite
= FT_IMAGE_TAG( 'c', 'o', 'm', 'p' ),
567 ft_glyph_format_bitmap
= FT_IMAGE_TAG( 'b', 'i', 't', 's' ),
568 ft_glyph_format_outline
= FT_IMAGE_TAG( 'o', 'u', 't', 'l' ),
569 ft_glyph_format_plotter
= FT_IMAGE_TAG( 'p', 'l', 'o', 't' )
574 /*************************************************************************/
575 /*************************************************************************/
576 /*************************************************************************/
578 /***** R A S T E R D E F I N I T I O N S *****/
580 /*************************************************************************/
581 /*************************************************************************/
582 /*************************************************************************/
585 /*************************************************************************/
587 /* A raster is a scan converter, in charge of rendering an outline into */
588 /* a a bitmap. This section contains the public API for rasters. */
590 /* Note that in FreeType 2, all rasters are now encapsulated within */
591 /* specific modules called `renderers'. See `freetype/ftrender.h' for */
592 /* more details on renderers. */
594 /*************************************************************************/
597 /*************************************************************************/
603 /* A handle (pointer) to a raster object. Each object can be used */
604 /* independently to convert an outline into a bitmap or pixmap. */
606 typedef struct FT_RasterRec_
* FT_Raster
;
609 /*************************************************************************/
615 /* A structure used to model a single span of gray (or black) pixels */
616 /* when rendering a monochrome or anti-aliased bitmap. */
619 /* x :: The span's horizontal start position. */
621 /* len :: The span's length in pixels. */
623 /* coverage :: The span color/coverage, ranging from 0 (background) */
624 /* to 255 (foreground). Only used for anti-aliased */
628 /* This structure is used by the span drawing callback type named */
629 /* FT_Raster_Span_Func(), which takes the y-coordinate of the span as */
632 /* The coverage value is always between 0 and 255, even if the number */
633 /* of gray levels have been set through FT_Set_Gray_Levels(). */
635 typedef struct FT_Span_
639 unsigned char coverage
;
644 /*************************************************************************/
647 /* FT_Raster_Span_Func */
650 /* A function used as a call-back by the anti-aliased renderer in */
651 /* order to let client applications draw themselves the gray pixel */
652 /* spans on each scan line. */
655 /* y :: The scanline's y-coordinate. */
657 /* count :: The number of spans to draw on this scanline. */
659 /* spans :: A table of `count' spans to draw on the scanline. */
661 /* user :: User-supplied data that is passed to the callback. */
664 /* This callback allows client applications to directly render the */
665 /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
667 /* This can be used to write anti-aliased outlines directly to a */
668 /* given background bitmap, and even perform translucency. */
670 /* Note that the `count' field cannot be greater than a fixed value */
671 /* defined by the FT_MAX_GRAY_SPANS configuration macro in */
672 /* ftoption.h. By default, this value is set to 32, which means that */
673 /* if there are more than 32 spans on a given scanline, the callback */
674 /* will be called several times with the same `y' parameter in order */
675 /* to draw all callbacks. */
677 /* Otherwise, the callback is only called once per scan-line, and */
678 /* only for those scanlines that do have `gray' pixels on them. */
680 typedef void (*FT_Raster_Span_Func
)( int y
,
686 /*************************************************************************/
689 /* FT_Raster_BitTest_Func */
692 /* A function used as a call-back by the monochrome scan-converter */
693 /* to test whether a given target pixel is already set to the drawing */
694 /* `color'. These tests are crucial to implement drop-out control */
695 /* per-se the TrueType spec. */
698 /* y :: The pixel's y-coordinate. */
700 /* x :: The pixel's x-coordinate. */
702 /* user :: User-supplied data that is passed to the callback. */
705 /* 1 if the pixel is `set', 0 otherwise. */
707 typedef int (*FT_Raster_BitTest_Func
)( int y
,
712 /*************************************************************************/
715 /* FT_Raster_BitSet_Func */
718 /* A function used as a call-back by the monochrome scan-converter */
719 /* to set an individual target pixel. This is crucial to implement */
720 /* drop-out control according to the TrueType specification. */
723 /* y :: The pixel's y-coordinate. */
725 /* x :: The pixel's x-coordinate. */
727 /* user :: User-supplied data that is passed to the callback. */
730 /* 1 if the pixel is `set', 0 otherwise. */
732 typedef void (*FT_Raster_BitSet_Func
)( int y
,
737 /*************************************************************************/
743 /* An enumeration to list the bit flags as used in the `flags' field */
744 /* of a FT_Raster_Params structure. */
747 /* ft_raster_flag_default :: This value is 0. */
749 /* ft_raster_flag_aa :: Requests the rendering of an */
750 /* anti-aliased glyph bitmap. If unset, a */
751 /* monchrome bitmap will be rendered. */
753 /* ft_raster_flag_direct :: Requests direct rendering over the */
754 /* target bitmap. Direct rendering uses */
755 /* user-provided callbacks in order to */
756 /* perform direct drawing or composition */
757 /* over an existing bitmap. If this bit is */
758 /* unset, the content of the target bitmap */
759 /* *must be zeroed*! */
763 ft_raster_flag_default
= 0,
764 ft_raster_flag_aa
= 1,
765 ft_raster_flag_direct
= 2
770 /*************************************************************************/
773 /* FT_Raster_Params */
776 /* A structure to hold the arguments used by a raster's render */
780 /* target :: The target bitmap. */
782 /* source :: A pointer to the source glyph image (e.g. an */
785 /* flags :: The rendering flags. */
787 /* gray_spans :: The gray span drawing callback. */
789 /* black_spans :: The black span drawing callback. */
791 /* bit_test :: The bit test callback. */
793 /* bit_set :: The bit set callback. */
795 /* user :: User-supplied data that is passed to each drawing */
799 /* An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit */
800 /* flag is set in the `flags' field, otherwise a monochrome bitmap */
801 /* will be generated. */
803 /* If the ft_raster_flag_direct bit flag is set in `flags', the */
804 /* raster will call the `gray_spans' callback to draw gray pixel */
805 /* spans, in the case of an aa glyph bitmap, it will call */
806 /* `black_spans', and `bit_test' and `bit_set' in the case of a */
807 /* monochrome bitmap. This allows direct composition over a */
808 /* pre-existing bitmap through user-provided callbacks to perform the */
809 /* span drawing/composition. */
811 /* Note that the `bit_test' and `bit_set' callbacks are required when */
812 /* rendering a monochrome bitmap, as they are crucial to implement */
813 /* correct drop-out control as defined in the TrueType specification. */
815 typedef struct FT_Raster_Params_
820 FT_Raster_Span_Func gray_spans
;
821 FT_Raster_Span_Func black_spans
;
822 FT_Raster_BitTest_Func bit_test
;
823 FT_Raster_BitSet_Func bit_set
;
829 /*************************************************************************/
832 /* FT_Raster_New_Func */
835 /* A function used to create a new raster object. */
838 /* memory :: A handle to the memory allocator. */
841 /* raster :: A handle to the new raster object. */
844 /* Error code. 0 means success. */
847 /* The `memory' parameter is a typeless pointer in order to avoid */
848 /* un-wanted dependencies on the rest of the FreeType code. In */
849 /* practice, it is a FT_Memory, i.e., a handle to the standard */
850 /* FreeType memory allocator. However, this field can be completely */
851 /* ignored by a given raster implementation. */
853 typedef int (*FT_Raster_New_Func
)( void* memory
,
857 /*************************************************************************/
860 /* FT_Raster_Done_Func */
863 /* A function used to destroy a given raster object. */
866 /* raster :: A handle to the raster object. */
868 typedef void (*FT_Raster_Done_Func
)( FT_Raster raster
);
871 /*************************************************************************/
874 /* FT_Raster_Reset_Func */
877 /* FreeType provides an area of memory called the `render pool', */
878 /* available to all registered rasters. This pool can be freely used */
879 /* during a given scan-conversion but is shared by all rasters. Its */
880 /* content is thus transient. */
882 /* This function is called each time the render pool changes, or just */
883 /* after a new raster object is created. */
886 /* raster :: A handle to the new raster object. */
888 /* pool_base :: The address in memory of the render pool. */
890 /* pool_size :: The size in bytes of the render pool. */
893 /* Rasters can ignore the render pool and rely on dynamic memory */
894 /* allocation if they want to (a handle to the memory allocator is */
895 /* passed to the raster constructor). However, this is not */
896 /* recommended for efficiency purposes. */
898 typedef void (*FT_Raster_Reset_Func
)( FT_Raster raster
,
899 unsigned char* pool_base
,
900 unsigned long pool_size
);
903 /*************************************************************************/
906 /* FT_Raster_Set_Mode_Func */
909 /* This function is a generic facility to change modes or attributes */
910 /* in a given raster. This can be used for debugging purposes, or */
911 /* simply to allow implementation-specific `features' in a given */
915 /* raster :: A handle to the new raster object. */
917 /* mode :: A 4-byte tag used to name the mode or property. */
919 /* args :: A pointer to the new mode/property to use. */
921 typedef int (*FT_Raster_Set_Mode_Func
)( FT_Raster raster
,
926 /*************************************************************************/
929 /* FT_Raster_Render_Func */
932 /* Invokes a given raster to scan-convert a given glyph image into a */
936 /* raster :: A handle to the raster object. */
938 /* params :: A pointer to a FT_Raster_Params structure used to store */
939 /* the rendering parameters. */
942 /* Error code. 0 means success. */
945 /* The exact format of the source image depends on the raster's glyph */
946 /* format defined in its FT_Raster_Funcs structure. It can be an */
947 /* FT_Outline or anything else in order to support a large array of */
950 /* Note also that the render function can fail and return a */
951 /* FT_Err_Unimplemented_Feature error code if the raster used does */
952 /* not support direct composition. */
954 /* XXX: For now, the standard raster doesn't support direct */
955 /* composition but this should change for the final release (see */
956 /* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
957 /* examples of distinct implementations which support direct */
960 typedef int (*FT_Raster_Render_Func
)( FT_Raster raster
,
961 FT_Raster_Params
* params
);
964 /*************************************************************************/
967 /* FT_Raster_Funcs */
970 /* A structure used to describe a given raster class to the library. */
973 /* glyph_format :: The supported glyph format for this raster. */
975 /* raster_new :: The raster constructor. */
977 /* raster_reset :: Used to reset the render pool within the raster. */
979 /* raster_render :: A function to render a glyph into a given bitmap. */
981 /* raster_done :: The raster destructor. */
983 typedef struct FT_Raster_Funcs_
985 FT_Glyph_Format glyph_format
;
986 FT_Raster_New_Func raster_new
;
987 FT_Raster_Reset_Func raster_reset
;
988 FT_Raster_Set_Mode_Func raster_set_mode
;
989 FT_Raster_Render_Func raster_render
;
990 FT_Raster_Done_Func raster_done
;
1000 #endif /* FTIMAGE_H */