📄 ftimage.h
字号:
/* Note that we now manage pixmaps of various depths through the */ /* `pixel_mode' field. */ /* */ /* <Fields> */ /* rows :: The number of bitmap rows. */ /* */ /* width :: The number of pixels in bitmap row. */ /* */ /* pitch :: The pitch's absolute value is the number of bytes */ /* taken by one bitmap row, including padding. */ /* However, the pitch is positive when the bitmap has */ /* a `down' flow, and negative when it has an `up' */ /* flow. In all cases, the pitch is an offset to add */ /* to a bitmap pointer in order to go down one row. */ /* */ /* buffer :: A typeless pointer to the bitmap buffer. This */ /* value should be aligned on 32-bit boundaries in */ /* most cases. */ /* */ /* num_grays :: This field is only used with */ /* `ft_pixel_mode_grays'; it gives the number of gray */ /* levels used in the bitmap. */ /* */ /* pixel_mode :: The pixel_mode, i.e., how pixel bits are stored. */ /* */ /* palette_mode :: This field is only used with paletted pixel modes; */ /* it indicates how the palette is stored. */ /* */ /* palette :: A typeless pointer to the bitmap palette; only */ /* 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; /*************************************************************************/ /* */ /* <Section> */ /* outline_processing */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <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 */ /* 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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -