📄 ftimage.h
字号:
/* used for paletted pixel modes. */ /* */ /* <Note> */ /* For now, the only pixel mode supported by FreeType are mono and */ /* grays. However, drivers might be added in the future to support */ /* more `colorful' options. */ /* */ /* When using pixel modes pal2, pal4 and pal8 with a void `palette' */ /* field, a gray pixmap with respectively 4, 16, and 256 levels of */ /* gray is assumed. This, in order to be compatible with some */ /* embedded bitmap formats defined in the TrueType specification. */ /* */ /* Note that no font was found presenting such embedded bitmaps, so */ /* this is currently completely unhandled by the library. */ /* */ typedef struct FT_Bitmap_ { int rows; int width; int pitch; unsigned char* buffer; short num_grays; char pixel_mode; char palette_mode; void* palette; } FT_Bitmap; /*************************************************************************/ /* */ /* <Struct> */ /* FT_Outline */ /* */ /* <Description> */ /* This structure is used to describe an outline to the scan-line */ /* converter. */ /* */ /* <Fields> */ /* n_contours :: The number of contours in the outline. */ /* */ /* n_points :: The number of points in the outline. */ /* */ /* points :: A pointer to an array of `n_points' FT_Vector */ /* elements, giving the outline's point coordinates. */ /* */ /* tags :: A pointer to an array of `n_points' chars, giving */ /* giving each outline point's type. If bit 0 is */ /* unset, the point is 'off' the curve, i.e. a Bezier */ /* control point, while it is `on' when set. */ /* */ /* Bit 1 is meaningful for `off' points only. If set, */ /* it indicates a third-order Bezier arc control point; */ /* and a second-order control point if unset. */ /* */ /* contours :: An array of `n_contours' shorts, giving the end */ /* point of each contour within the outline. For */ /* example, the first contour is defined by the points */ /* `0' to `contours[0]', the second one is defined by */ /* the points `contours[0]+1' to `contours[1]', etc. */ /* */ /* flags :: A set of bit flags used to characterize the outline */ /* and give hints to the scan-converter and hinter on */ /* how to convert/grid-fit it. See FT_Outline_Flags. */ /* */ typedef struct FT_Outline_ { short n_contours; /* number of contours in glyph */ short n_points; /* number of points in the glyph */ FT_Vector* points; /* the outline's points */ char* tags; /* the points flags */ short* contours; /* the contour end points */ int flags; /* outline masks */ } FT_Outline; /*************************************************************************/ /* */ /* <Enum> */ /* FT_Outline_Flags */ /* */ /* <Description> */ /* A simple type used to enumerates the flags in an outline's */ /* `outline_flags' field. */ /* */ /* <Fields> */ /* ft_outline_owner :: If set, this flag indicates that the */ /* outline's field arrays (i.e. */ /* `points', `flags' & `contours') are */ /* `owned' by the outline object, and */ /* should thus be freed when it is */ /* destroyed. */ /* */ /* ft_outline_even_odd_fill :: By default, outlines are filled using */ /* the non-zero winding rule. If set to */ /* 1, the outline will be filled using */ /* the even-odd fill rule (only works */ /* with the smooth raster). */ /* */ /* ft_outline_reverse_fill :: By default, outside contours of an */ /* outline are oriented in clock-wise */ /* direction, as defined in the TrueType */ /* specification. This flag is set if */ /* the outline uses the opposite */ /* direction (typically for Type 1 */ /* fonts). This flag is ignored by the */ /* scan-converter. However, it is very */ /* important for the auto-hinter. */ /* */ /* ft_outline_ignore_dropouts :: By default, the scan converter will */ /* try to detect drop-outs in an outline */ /* and correct the glyph bitmap to */ /* ensure consistent shape continuity. */ /* If set, this flag hints the scan-line */ /* converter to ignore such cases. */ /* */ /* ft_outline_high_precision :: This flag indicates that the */ /* scan-line converter should try to */ /* convert this outline to bitmaps with */ /* the highest possible quality. It is */ /* typically set for small character */ /* sizes. Note that this is only a */ /* hint, that might be completely */ /* ignored by a given scan-converter. */ /* */ /* ft_outline_single_pass :: This flag is set to force a given */ /* scan-converter to only use a single */ /* pass over the outline to render a */ /* bitmap glyph image. Normally, it is */ /* set for very large character sizes. */ /* It is only a hint, that might be */ /* completely ignored by a given */ /* scan-converter. */ /* */ typedef enum FT_Outline_Flags_ { ft_outline_none = 0, ft_outline_owner = 1, ft_outline_even_odd_fill = 2, ft_outline_reverse_fill = 4, ft_outline_ignore_dropouts = 8, ft_outline_high_precision = 256, ft_outline_single_pass = 512 } FT_Outline_Flags;#define FT_CURVE_TAG( flag ) ( flag & 3 )#define FT_Curve_Tag_On 1#define FT_Curve_Tag_Conic 0#define FT_Curve_Tag_Cubic 2#define FT_Curve_Tag_Touch_X 8 /* reserved for the TrueType hinter */#define FT_Curve_Tag_Touch_Y 16 /* reserved for the TrueType hinter */#define FT_Curve_Tag_Touch_Both ( FT_Curve_Tag_Touch_X | \ FT_Curve_Tag_Touch_Y ) /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_MoveTo_Func */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `move */ /* to' function during outline walking/decomposition. */ /* */ /* A `move to' is emitted to start a new contour in an outline. */ /* */ /* <Input> */ /* to :: A pointer to the target point of the `move to'. */ /* */ /* user :: A typeless pointer which is passed from the caller of the */ /* decomposition function. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ typedef int (*FT_Outline_MoveTo_Func)( FT_Vector* to, void* user ); /*************************************************************************/ /* */ /* <FuncType> */ /* FT_Outline_LineTo_Func */ /* */ /* <Description> */ /* A function pointer type used to describe the signature of a `line */ /* to' function during outline walking/decomposition. */ /* */ /* A `line to' is emitted to indicate a segment in the outline. */ /* */ /* <Input> */ /* to :: A pointer to the target point of the `line to'. */ /* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -