root / trunk / tbeta / Linux / libs / freetype / include / freetype2 / freetype / ftglyph.h @ 164
View | Annotate | Download (35.5 KB)
| 1 | 164 | ss | /***************************************************************************/
|
|---|---|---|---|
| 2 | 164 | ss | /* */
|
| 3 | 164 | ss | /* ftglyph.h */
|
| 4 | 164 | ss | /* */
|
| 5 | 164 | ss | /* FreeType convenience functions to handle glyphs (specification). */
|
| 6 | 164 | ss | /* */
|
| 7 | 164 | ss | /* Copyright 1996-2001, 2002, 2003, 2006 by */
|
| 8 | 164 | ss | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
| 9 | 164 | ss | /* */
|
| 10 | 164 | ss | /* This file is part of the FreeType project, and may only be used, */
|
| 11 | 164 | ss | /* modified, and distributed under the terms of the FreeType project */
|
| 12 | 164 | ss | /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
| 13 | 164 | ss | /* this file you indicate that you have read the license and */
|
| 14 | 164 | ss | /* understand and accept it fully. */
|
| 15 | 164 | ss | /* */
|
| 16 | 164 | ss | /***************************************************************************/
|
| 17 | 164 | ss | |
| 18 | 164 | ss | |
| 19 | 164 | ss | /*************************************************************************/
|
| 20 | 164 | ss | /* */
|
| 21 | 164 | ss | /* This file contains the definition of several convenience functions */
|
| 22 | 164 | ss | /* that can be used by client applications to easily retrieve glyph */
|
| 23 | 164 | ss | /* bitmaps and outlines from a given face. */
|
| 24 | 164 | ss | /* */
|
| 25 | 164 | ss | /* These functions should be optional if you are writing a font server */
|
| 26 | 164 | ss | /* or text layout engine on top of FreeType. However, they are pretty */
|
| 27 | 164 | ss | /* handy for many other simple uses of the library. */
|
| 28 | 164 | ss | /* */
|
| 29 | 164 | ss | /*************************************************************************/
|
| 30 | 164 | ss | |
| 31 | 164 | ss | |
| 32 | 164 | ss | #ifndef __FTGLYPH_H__
|
| 33 | 164 | ss | #define __FTGLYPH_H__
|
| 34 | 164 | ss | |
| 35 | 164 | ss | |
| 36 | 164 | ss | #include <ft2build.h> |
| 37 | 164 | ss | #include FT_FREETYPE_H |
| 38 | 164 | ss | |
| 39 | 164 | ss | #ifdef FREETYPE_H
|
| 40 | 164 | ss | #error "freetype.h of FreeType 1 has been loaded!" |
| 41 | 164 | ss | #error "Please fix the directory search order for header files" |
| 42 | 164 | ss | #error "so that freetype.h of FreeType 2 is found first." |
| 43 | 164 | ss | #endif
|
| 44 | 164 | ss | |
| 45 | 164 | ss | |
| 46 | 164 | ss | FT_BEGIN_HEADER |
| 47 | 164 | ss | |
| 48 | 164 | ss | |
| 49 | 164 | ss | /*************************************************************************/
|
| 50 | 164 | ss | /* */
|
| 51 | 164 | ss | /* <Section> */
|
| 52 | 164 | ss | /* glyph_management */
|
| 53 | 164 | ss | /* */
|
| 54 | 164 | ss | /* <Title> */
|
| 55 | 164 | ss | /* Glyph Management */
|
| 56 | 164 | ss | /* */
|
| 57 | 164 | ss | /* <Abstract> */
|
| 58 | 164 | ss | /* Generic interface to manage individual glyph data. */
|
| 59 | 164 | ss | /* */
|
| 60 | 164 | ss | /* <Description> */
|
| 61 | 164 | ss | /* This section contains definitions used to manage glyph data */
|
| 62 | 164 | ss | /* through generic FT_Glyph objects. Each of them can contain a */
|
| 63 | 164 | ss | /* bitmap, a vector outline, or even images in other formats. */
|
| 64 | 164 | ss | /* */
|
| 65 | 164 | ss | /*************************************************************************/
|
| 66 | 164 | ss | |
| 67 | 164 | ss | |
| 68 | 164 | ss | /* forward declaration to a private type */
|
| 69 | 164 | ss | typedef struct FT_Glyph_Class_ FT_Glyph_Class; |
| 70 | 164 | ss | |
| 71 | 164 | ss | |
| 72 | 164 | ss | /*************************************************************************/
|
| 73 | 164 | ss | /* */
|
| 74 | 164 | ss | /* <Type> */
|
| 75 | 164 | ss | /* FT_Glyph */
|
| 76 | 164 | ss | /* */
|
| 77 | 164 | ss | /* <Description> */
|
| 78 | 164 | ss | /* Handle to an object used to model generic glyph images. It is a */
|
| 79 | 164 | ss | /* pointer to the @FT_GlyphRec structure and can contain a glyph */
|
| 80 | 164 | ss | /* bitmap or pointer. */
|
| 81 | 164 | ss | /* */
|
| 82 | 164 | ss | /* <Note> */
|
| 83 | 164 | ss | /* Glyph objects are not owned by the library. You must thus release */
|
| 84 | 164 | ss | /* them manually (through @FT_Done_Glyph) _before_ calling */
|
| 85 | 164 | ss | /* @FT_Done_FreeType. */
|
| 86 | 164 | ss | /* */
|
| 87 | 164 | ss | typedef struct FT_GlyphRec_* FT_Glyph; |
| 88 | 164 | ss | |
| 89 | 164 | ss | |
| 90 | 164 | ss | /*************************************************************************/
|
| 91 | 164 | ss | /* */
|
| 92 | 164 | ss | /* <Struct> */
|
| 93 | 164 | ss | /* FT_GlyphRec */
|
| 94 | 164 | ss | /* */
|
| 95 | 164 | ss | /* <Description> */
|
| 96 | 164 | ss | /* The root glyph structure contains a given glyph image plus its */
|
| 97 | 164 | ss | /* advance width in 16.16 fixed float format. */
|
| 98 | 164 | ss | /* */
|
| 99 | 164 | ss | /* <Fields> */
|
| 100 | 164 | ss | /* library :: A handle to the FreeType library object. */
|
| 101 | 164 | ss | /* */
|
| 102 | 164 | ss | /* clazz :: A pointer to the glyph's class. Private. */
|
| 103 | 164 | ss | /* */
|
| 104 | 164 | ss | /* format :: The format of the glyph's image. */
|
| 105 | 164 | ss | /* */
|
| 106 | 164 | ss | /* advance :: A 16.16 vector that gives the glyph's advance width. */
|
| 107 | 164 | ss | /* */
|
| 108 | 164 | ss | typedef struct FT_GlyphRec_ |
| 109 | 164 | ss | {
|
| 110 | 164 | ss | FT_Library library; |
| 111 | 164 | ss | const FT_Glyph_Class* clazz;
|
| 112 | 164 | ss | FT_Glyph_Format format; |
| 113 | 164 | ss | FT_Vector advance; |
| 114 | 164 | ss | |
| 115 | 164 | ss | } FT_GlyphRec; |
| 116 | 164 | ss | |
| 117 | 164 | ss | |
| 118 | 164 | ss | /*************************************************************************/
|
| 119 | 164 | ss | /* */
|
| 120 | 164 | ss | /* <Type> */
|
| 121 | 164 | ss | /* FT_BitmapGlyph */
|
| 122 | 164 | ss | /* */
|
| 123 | 164 | ss | /* <Description> */
|
| 124 | 164 | ss | /* A handle to an object used to model a bitmap glyph image. This is */
|
| 125 | 164 | ss | /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
|
| 126 | 164 | ss | /* */
|
| 127 | 164 | ss | typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph; |
| 128 | 164 | ss | |
| 129 | 164 | ss | |
| 130 | 164 | ss | /*************************************************************************/
|
| 131 | 164 | ss | /* */
|
| 132 | 164 | ss | /* <Struct> */
|
| 133 | 164 | ss | /* FT_BitmapGlyphRec */
|
| 134 | 164 | ss | /* */
|
| 135 | 164 | ss | /* <Description> */
|
| 136 | 164 | ss | /* A structure used for bitmap glyph images. This really is a */
|
| 137 | 164 | ss | /* `sub-class' of @FT_GlyphRec. */
|
| 138 | 164 | ss | /* */
|
| 139 | 164 | ss | /* <Fields> */
|
| 140 | 164 | ss | /* root :: The root @FT_Glyph fields. */
|
| 141 | 164 | ss | /* */
|
| 142 | 164 | ss | /* left :: The left-side bearing, i.e., the horizontal distance */
|
| 143 | 164 | ss | /* from the current pen position to the left border of the */
|
| 144 | 164 | ss | /* glyph bitmap. */
|
| 145 | 164 | ss | /* */
|
| 146 | 164 | ss | /* top :: The top-side bearing, i.e., the vertical distance from */
|
| 147 | 164 | ss | /* the current pen position to the top border of the glyph */
|
| 148 | 164 | ss | /* bitmap. This distance is positive for upwards-y! */
|
| 149 | 164 | ss | /* */
|
| 150 | 164 | ss | /* bitmap :: A descriptor for the bitmap. */
|
| 151 | 164 | ss | /* */
|
| 152 | 164 | ss | /* <Note> */
|
| 153 | 164 | ss | /* You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have */
|
| 154 | 164 | ss | /* `glyph->format == FT_GLYPH_FORMAT_BITMAP'. This lets you access */
|
| 155 | 164 | ss | /* the bitmap's contents easily. */
|
| 156 | 164 | ss | /* */
|
| 157 | 164 | ss | /* The corresponding pixel buffer is always owned by @FT_BitmapGlyph */
|
| 158 | 164 | ss | /* and is thus created and destroyed with it. */
|
| 159 | 164 | ss | /* */
|
| 160 | 164 | ss | typedef struct FT_BitmapGlyphRec_ |
| 161 | 164 | ss | {
|
| 162 | 164 | ss | FT_GlyphRec root; |
| 163 | 164 | ss | FT_Int left; |
| 164 | 164 | ss | FT_Int top; |
| 165 | 164 | ss | FT_Bitmap bitmap; |
| 166 | 164 | ss | |
| 167 | 164 | ss | } FT_BitmapGlyphRec; |
| 168 | 164 | ss | |
| 169 | 164 | ss | |
| 170 | 164 | ss | /*************************************************************************/
|
| 171 | 164 | ss | /* */
|
| 172 | 164 | ss | /* <Type> */
|
| 173 | 164 | ss | /* FT_OutlineGlyph */
|
| 174 | 164 | ss | /* */
|
| 175 | 164 | ss | /* <Description> */
|
| 176 | 164 | ss | /* A handle to an object used to model an outline glyph image. This */
|
| 177 | 164 | ss | /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
|
| 178 | 164 | ss | /* */
|
| 179 | 164 | ss | typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph; |
| 180 | 164 | ss | |
| 181 | 164 | ss | |
| 182 | 164 | ss | /*************************************************************************/
|
| 183 | 164 | ss | /* */
|
| 184 | 164 | ss | /* <Struct> */
|
| 185 | 164 | ss | /* FT_OutlineGlyphRec */
|
| 186 | 164 | ss | /* */
|
| 187 | 164 | ss | /* <Description> */
|
| 188 | 164 | ss | /* A structure used for outline (vectorial) glyph images. This */
|
| 189 | 164 | ss | /* really is a `sub-class' of @FT_GlyphRec. */
|
| 190 | 164 | ss | /* */
|
| 191 | 164 | ss | /* <Fields> */
|
| 192 | 164 | ss | /* root :: The root @FT_Glyph fields. */
|
| 193 | 164 | ss | /* */
|
| 194 | 164 | ss | /* outline :: A descriptor for the outline. */
|
| 195 | 164 | ss | /* */
|
| 196 | 164 | ss | /* <Note> */
|
| 197 | 164 | ss | /* You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have */
|
| 198 | 164 | ss | /* `glyph->format == FT_GLYPH_FORMAT_OUTLINE'. This lets you access */
|
| 199 | 164 | ss | /* the outline's content easily. */
|
| 200 | 164 | ss | /* */
|
| 201 | 164 | ss | /* As the outline is extracted from a glyph slot, its coordinates are */
|
| 202 | 164 | ss | /* expressed normally in 26.6 pixels, unless the flag */
|
| 203 | 164 | ss | /* @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */
|
| 204 | 164 | ss | /* */
|
| 205 | 164 | ss | /* The outline's tables are always owned by the object and are */
|
| 206 | 164 | ss | /* destroyed with it. */
|
| 207 | 164 | ss | /* */
|
| 208 | 164 | ss | typedef struct FT_OutlineGlyphRec_ |
| 209 | 164 | ss | {
|
| 210 | 164 | ss | FT_GlyphRec root; |
| 211 | 164 | ss | FT_Outline outline; |
| 212 | 164 | ss | |
| 213 | 164 | ss | } FT_OutlineGlyphRec; |
| 214 | 164 | ss | |
| 215 | 164 | ss | |
| 216 | 164 | ss | /*************************************************************************/
|
| 217 | 164 | ss | /* */
|
| 218 | 164 | ss | /* <Function> */
|
| 219 | 164 | ss | /* FT_Get_Glyph */
|
| 220 | 164 | ss | /* */
|
| 221 | 164 | ss | /* <Description> */
|
| 222 | 164 | ss | /* A function used to extract a glyph image from a slot. */
|
| 223 | 164 | ss | /* */
|
| 224 | 164 | ss | /* <Input> */
|
| 225 | 164 | ss | /* slot :: A handle to the source glyph slot. */
|
| 226 | 164 | ss | /* */
|
| 227 | 164 | ss | /* <Output> */
|
| 228 | 164 | ss | /* aglyph :: A handle to the glyph object. */
|
| 229 | 164 | ss | /* */
|
| 230 | 164 | ss | /* <Return> */
|
| 231 | 164 | ss | /* FreeType error code. 0 means success. */
|
| 232 | 164 | ss | /* */
|
| 233 | 164 | ss | FT_EXPORT( FT_Error ) |
| 234 | 164 | ss | FT_Get_Glyph( FT_GlyphSlot slot, |
| 235 | 164 | ss | FT_Glyph *aglyph ); |
| 236 | 164 | ss | |
| 237 | 164 | ss | |
| 238 | 164 | ss | /*************************************************************************/
|
| 239 | 164 | ss | /* */
|
| 240 | 164 | ss | /* <Function> */
|
| 241 | 164 | ss | /* FT_Glyph_Copy */
|
| 242 | 164 | ss | /* */
|
| 243 | 164 | ss | /* <Description> */
|
| 244 | 164 | ss | /* A function used to copy a glyph image. Note that the created */
|
| 245 | 164 | ss | /* @FT_Glyph object must be released with @FT_Done_Glyph. */
|
| 246 | 164 | ss | /* */
|
| 247 | 164 | ss | /* <Input> */
|
| 248 | 164 | ss | /* source :: A handle to the source glyph object. */
|
| 249 | 164 | ss | /* */
|
| 250 | 164 | ss | /* <Output> */
|
| 251 | 164 | ss | /* target :: A handle to the target glyph object. 0 in case of */
|
| 252 | 164 | ss | /* error. */
|
| 253 | 164 | ss | /* */
|
| 254 | 164 | ss | /* <Return> */
|
| 255 | 164 | ss | /* FreeType error code. 0 means success. */
|
| 256 | 164 | ss | /* */
|
| 257 | 164 | ss | FT_EXPORT( FT_Error ) |
| 258 | 164 | ss | FT_Glyph_Copy( FT_Glyph source, |
| 259 | 164 | ss | FT_Glyph *target ); |
| 260 | 164 | ss | |
| 261 | 164 | ss | |
| 262 | 164 | ss | /*************************************************************************/
|
| 263 | 164 | ss | /* */
|
| 264 | 164 | ss | /* <Function> */
|
| 265 | 164 | ss | /* FT_Glyph_Transform */
|
| 266 | 164 | ss | /* */
|
| 267 | 164 | ss | /* <Description> */
|
| 268 | 164 | ss | /* Transforms a glyph image if its format is scalable. */
|
| 269 | 164 | ss | /* */
|
| 270 | 164 | ss | /* <InOut> */
|
| 271 | 164 | ss | /* glyph :: A handle to the target glyph object. */
|
| 272 | 164 | ss | /* */
|
| 273 | 164 | ss | /* <Input> */
|
| 274 | 164 | ss | /* matrix :: A pointer to a 2x2 matrix to apply. */
|
| 275 | 164 | ss | /* */
|
| 276 | 164 | ss | /* delta :: A pointer to a 2d vector to apply. Coordinates are */
|
| 277 | 164 | ss | /* expressed in 1/64th of a pixel. */
|
| 278 | 164 | ss | /* */
|
| 279 | 164 | ss | /* <Return> */
|
| 280 | 164 | ss | /* FreeType error code (if not 0, the glyph format is not scalable). */
|
| 281 | 164 | ss | /* */
|
| 282 | 164 | ss | /* <Note> */
|
| 283 | 164 | ss | /* The 2x2 transformation matrix is also applied to the glyph's */
|
| 284 | 164 | ss | /* advance vector. */
|
| 285 | 164 | ss | /* */
|
| 286 | 164 | ss | FT_EXPORT( FT_Error ) |
| 287 | 164 | ss | FT_Glyph_Transform( FT_Glyph glyph, |
| 288 | 164 | ss | FT_Matrix* matrix, |
| 289 | 164 | ss | FT_Vector* delta ); |
| 290 | 164 | ss | |
| 291 | 164 | ss | |
| 292 | 164 | ss | /*************************************************************************/
|
| 293 | 164 | ss | /* */
|
| 294 | 164 | ss | /* <Enum> */
|
| 295 | 164 | ss | /* FT_Glyph_BBox_Mode */
|
| 296 | 164 | ss | /* */
|
| 297 | 164 | ss | /* <Description> */
|
| 298 | 164 | ss | /* The mode how the values of @FT_Glyph_Get_CBox are returned. */
|
| 299 | 164 | ss | /* */
|
| 300 | 164 | ss | /* <Values> */
|
| 301 | 164 | ss | /* FT_GLYPH_BBOX_UNSCALED :: */
|
| 302 | 164 | ss | /* Return unscaled font units. */
|
| 303 | 164 | ss | /* */
|
| 304 | 164 | ss | /* FT_GLYPH_BBOX_SUBPIXELS :: */
|
| 305 | 164 | ss | /* Return unfitted 26.6 coordinates. */
|
| 306 | 164 | ss | /* */
|
| 307 | 164 | ss | /* FT_GLYPH_BBOX_GRIDFIT :: */
|
| 308 | 164 | ss | /* Return grid-fitted 26.6 coordinates. */
|
| 309 | 164 | ss | /* */
|
| 310 | 164 | ss | /* FT_GLYPH_BBOX_TRUNCATE :: */
|
| 311 | 164 | ss | /* Return coordinates in integer pixels. */
|
| 312 | 164 | ss | /* */
|
| 313 | 164 | ss | /* FT_GLYPH_BBOX_PIXELS :: */
|
| 314 | 164 | ss | /* Return grid-fitted pixel coordinates. */
|
| 315 | 164 | ss | /* */
|
| 316 | 164 | ss | typedef enum FT_Glyph_BBox_Mode_ |
| 317 | 164 | ss | {
|
| 318 | 164 | ss | FT_GLYPH_BBOX_UNSCALED = 0,
|
| 319 | 164 | ss | FT_GLYPH_BBOX_SUBPIXELS = 0,
|
| 320 | 164 | ss | FT_GLYPH_BBOX_GRIDFIT = 1,
|
| 321 | 164 | ss | FT_GLYPH_BBOX_TRUNCATE = 2,
|
| 322 | 164 | ss | FT_GLYPH_BBOX_PIXELS = 3
|
| 323 | 164 | ss | |
| 324 | 164 | ss | } FT_Glyph_BBox_Mode; |
| 325 | 164 | ss | |
| 326 | 164 | ss | |
| 327 | 164 | ss | /*************************************************************************/
|
| 328 | 164 | ss | /* */
|
| 329 | 164 | ss | /* <Enum> */
|
| 330 | 164 | ss | /* ft_glyph_bbox_xxx */
|
| 331 | 164 | ss | /* */
|
| 332 | 164 | ss | /* <Description> */
|
| 333 | 164 | ss | /* These constants are deprecated. Use the corresponding */
|
| 334 | 164 | ss | /* @FT_Glyph_BBox_Mode values instead. */
|
| 335 | 164 | ss | /* */
|
| 336 | 164 | ss | /* <Values> */
|
| 337 | 164 | ss | /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */
|
| 338 | 164 | ss | /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */
|
| 339 | 164 | ss | /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */
|
| 340 | 164 | ss | /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */
|
| 341 | 164 | ss | /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */
|
| 342 | 164 | ss | /* */
|
| 343 | 164 | ss | #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED
|
| 344 | 164 | ss | #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS
|
| 345 | 164 | ss | #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT
|
| 346 | 164 | ss | #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE
|
| 347 | 164 | ss | #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS
|
| 348 | 164 | ss | |
| 349 | 164 | ss | |
| 350 | 164 | ss | /*************************************************************************/
|
| 351 | 164 | ss | /* */
|
| 352 | 164 | ss | /* <Function> */
|
| 353 | 164 | ss | /* FT_Glyph_Get_CBox */
|
| 354 | 164 | ss | /* */
|
| 355 | 164 | ss | /* <Description> */
|
| 356 | 164 | ss | /* Return a glyph's `control box'. The control box encloses all the */
|
| 357 | 164 | ss | /* outline's points, including Bézier control points. Though it */
|
| 358 | 164 | ss | /* coincides with the exact bounding box for most glyphs, it can be */
|
| 359 | 164 | ss | /* slightly larger in some situations (like when rotating an outline */
|
| 360 | 164 | ss | /* which contains Bézier outside arcs). */
|
| 361 | 164 | ss | /* */
|
| 362 | 164 | ss | /* Computing the control box is very fast, while getting the bounding */
|
| 363 | 164 | ss | /* box can take much more time as it needs to walk over all segments */
|
| 364 | 164 | ss | /* and arcs in the outline. To get the latter, you can use the */
|
| 365 | 164 | ss | /* `ftbbox' component which is dedicated to this single task. */
|
| 366 | 164 | ss | /* */
|
| 367 | 164 | ss | /* <Input> */
|
| 368 | 164 | ss | /* glyph :: A handle to the source glyph object. */
|
| 369 | 164 | ss | /* */
|
| 370 | 164 | ss | /* mode :: The mode which indicates how to interpret the returned */
|
| 371 | 164 | ss | /* bounding box values. */
|
| 372 | 164 | ss | /* */
|
| 373 | 164 | ss | /* <Output> */
|
| 374 | 164 | ss | /* acbox :: The glyph coordinate bounding box. Coordinates are */
|
| 375 | 164 | ss | /* expressed in 1/64th of pixels if it is grid-fitted. */
|
| 376 | 164 | ss | /* */
|
| 377 | 164 | ss | /* <Note> */
|
| 378 | 164 | ss | /* Coordinates are relative to the glyph origin, using the Y-upwards */
|
| 379 | 164 | ss | /* convention. */
|
| 380 | 164 | ss | /* */
|
| 381 | 164 | ss | /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */
|
| 382 | 164 | ss | /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */
|
| 383 | 164 | ss | /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */
|
| 384 | 164 | ss | /* is another name for this constant. */
|
| 385 | 164 | ss | /* */
|
| 386 | 164 | ss | /* Note that the maximum coordinates are exclusive, which means that */
|
| 387 | 164 | ss | /* one can compute the width and height of the glyph image (be it in */
|
| 388 | 164 | ss | /* integer or 26.6 pixels) as: */
|
| 389 | 164 | ss | /* */
|
| 390 | 164 | ss | /* { */
|
| 391 | 164 | ss | /* width = bbox.xMax - bbox.xMin; */
|
| 392 | 164 | ss | /* height = bbox.yMax - bbox.yMin; */
|
| 393 | 164 | ss | /* } */
|
| 394 | 164 | ss | /* */
|
| 395 | 164 | ss | /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
|
| 396 | 164 | ss | /* @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted, */
|
| 397 | 164 | ss | /* which corresponds to: */
|
| 398 | 164 | ss | /* */
|
| 399 | 164 | ss | /* { */
|
| 400 | 164 | ss | /* bbox.xMin = FLOOR(bbox.xMin); */
|
| 401 | 164 | ss | /* bbox.yMin = FLOOR(bbox.yMin); */
|
| 402 | 164 | ss | /* bbox.xMax = CEILING(bbox.xMax); */
|
| 403 | 164 | ss | /* bbox.yMax = CEILING(bbox.yMax); */
|
| 404 | 164 | ss | /* } */
|
| 405 | 164 | ss | /* */
|
| 406 | 164 | ss | /* To get the bbox in pixel coordinates, set `bbox_mode' to */
|
| 407 | 164 | ss | /* @FT_GLYPH_BBOX_TRUNCATE. */
|
| 408 | 164 | ss | /* */
|
| 409 | 164 | ss | /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
|
| 410 | 164 | ss | /* to @FT_GLYPH_BBOX_PIXELS. */
|
| 411 | 164 | ss | /* */
|
| 412 | 164 | ss | FT_EXPORT( void )
|
| 413 | 164 | ss | FT_Glyph_Get_CBox( FT_Glyph glyph, |
| 414 | 164 | ss | FT_UInt bbox_mode, |
| 415 | 164 | ss | FT_BBox *acbox ); |
| 416 | 164 | ss | |
| 417 | 164 | ss | |
| 418 | 164 | ss | /*************************************************************************/
|
| 419 | 164 | ss | /* */
|
| 420 | 164 | ss | /* <Function> */
|
| 421 | 164 | ss | /* FT_Glyph_To_Bitmap */
|
| 422 | 164 | ss | /* */
|
| 423 | 164 | ss | /* <Description> */
|
| 424 | 164 | ss | /* Converts a given glyph object to a bitmap glyph object. */
|
| 425 | 164 | ss | /* */
|
| 426 | 164 | ss | /* <InOut> */
|
| 427 | 164 | ss | /* the_glyph :: A pointer to a handle to the target glyph. */
|
| 428 | 164 | ss | /* */
|
| 429 | 164 | ss | /* <Input> */
|
| 430 | 164 | ss | /* render_mode :: An enumeration that describe how the data is */
|
| 431 | 164 | ss | /* rendered. */
|
| 432 | 164 | ss | /* */
|
| 433 | 164 | ss | /* origin :: A pointer to a vector used to translate the glyph */
|
| 434 | 164 | ss | /* image before rendering. Can be 0 (if no */
|
| 435 | 164 | ss | /* translation). The origin is expressed in */
|
| 436 | 164 | ss | /* 26.6 pixels. */
|
| 437 | 164 | ss | /* */
|
| 438 | 164 | ss | /* destroy :: A boolean that indicates that the original glyph */
|
| 439 | 164 | ss | /* image should be destroyed by this function. It is */
|
| 440 | 164 | ss | /* never destroyed in case of error. */
|
| 441 | 164 | ss | /* */
|
| 442 | 164 | ss | /* <Return> */
|
| 443 | 164 | ss | /* FreeType error code. 0 means success. */
|
| 444 | 164 | ss | /* */
|
| 445 | 164 | ss | /* <Note> */
|
| 446 | 164 | ss | /* The glyph image is translated with the `origin' vector before */
|
| 447 | 164 | ss | /* rendering. */
|
| 448 | 164 | ss | /* */
|
| 449 | 164 | ss | /* The first parameter is a pointer to an @FT_Glyph handle, that will */
|
| 450 | 164 | ss | /* be replaced by this function. Typically, you would use (omitting */
|
| 451 | 164 | ss | /* error handling): */
|
| 452 | 164 | ss | /* */
|
| 453 | 164 | ss | /* */
|
| 454 | 164 | ss | /* { */
|
| 455 | 164 | ss | /* FT_Glyph glyph; */
|
| 456 | 164 | ss | /* FT_BitmapGlyph glyph_bitmap; */
|
| 457 | 164 | ss | /* */
|
| 458 | 164 | ss | /* */
|
| 459 | 164 | ss | /* // load glyph */
|
| 460 | 164 | ss | /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
|
| 461 | 164 | ss | /* */
|
| 462 | 164 | ss | /* // extract glyph image */
|
| 463 | 164 | ss | /* error = FT_Get_Glyph( face->glyph, &glyph ); */
|
| 464 | 164 | ss | /* */
|
| 465 | 164 | ss | /* // convert to a bitmap (default render mode + destroy old) */
|
| 466 | 164 | ss | /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
|
| 467 | 164 | ss | /* { */
|
| 468 | 164 | ss | /* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT, */
|
| 469 | 164 | ss | /* 0, 1 ); */
|
| 470 | 164 | ss | /* if ( error ) // glyph unchanged */
|
| 471 | 164 | ss | /* ... */
|
| 472 | 164 | ss | /* } */
|
| 473 | 164 | ss | /* */
|
| 474 | 164 | ss | /* // access bitmap content by typecasting */
|
| 475 | 164 | ss | /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
|
| 476 | 164 | ss | /* */
|
| 477 | 164 | ss | /* // do funny stuff with it, like blitting/drawing */
|
| 478 | 164 | ss | /* ... */
|
| 479 | 164 | ss | /* */
|
| 480 | 164 | ss | /* // discard glyph image (bitmap or not) */
|
| 481 | 164 | ss | /* FT_Done_Glyph( glyph ); */
|
| 482 | 164 | ss | /* } */
|
| 483 | 164 | ss | /* */
|
| 484 | 164 | ss | /* */
|
| 485 | 164 | ss | /* This function does nothing if the glyph format isn't scalable. */
|
| 486 | 164 | ss | /* */
|
| 487 | 164 | ss | FT_EXPORT( FT_Error ) |
| 488 | 164 | ss | FT_Glyph_To_Bitmap( FT_Glyph* the_glyph, |
| 489 | 164 | ss | FT_Render_Mode render_mode, |
| 490 | 164 | ss | FT_Vector* origin, |
| 491 | 164 | ss | FT_Bool destroy ); |
| 492 | 164 | ss | |
| 493 | 164 | ss | |
| 494 | 164 | ss | /*************************************************************************/
|
| 495 | 164 | ss | /* */
|
| 496 | 164 | ss | /* <Function> */
|
| 497 | 164 | ss | /* FT_Done_Glyph */
|
| 498 | 164 | ss | /* */
|
| 499 | 164 | ss | /* <Description> */
|
| 500 | 164 | ss | /* Destroys a given glyph. */
|
| 501 | 164 | ss | /* */
|
| 502 | 164 | ss | /* <Input> */
|
| 503 | 164 | ss | /* glyph :: A handle to the target glyph object. */
|
| 504 | 164 | ss | /* */
|
| 505 | 164 | ss | FT_EXPORT( void )
|
| 506 | 164 | ss | FT_Done_Glyph( FT_Glyph glyph ); |
| 507 | 164 | ss | |
| 508 | 164 | ss | /* */
|
| 509 | 164 | ss | |
| 510 | 164 | ss | |
| 511 | 164 | ss | /* other helpful functions */
|
| 512 | 164 | ss | |
| 513 | 164 | ss | /*************************************************************************/
|
| 514 | 164 | ss | /* */
|
| 515 | 164 | ss | /* <Section> */
|
| 516 | 164 | ss | /* computations */
|
| 517 | 164 | ss | /* */
|
| 518 | 164 | ss | /*************************************************************************/
|
| 519 | 164 | ss | |
| 520 | 164 | ss | |
| 521 | 164 | ss | /*************************************************************************/
|
| 522 | 164 | ss | /* */
|
| 523 | 164 | ss | /* <Function> */
|
| 524 | 164 | ss | /* FT_Matrix_Multiply */
|
| 525 | 164 | ss | /* */
|
| 526 | 164 | ss | /* <Description> */
|
| 527 | 164 | ss | /* Performs the matrix operation `b = a*b'. */
|
| 528 | 164 | ss | /* */
|
| 529 | 164 | ss | /* <Input> */
|
| 530 | 164 | ss | /* a :: A pointer to matrix `a'. */
|
| 531 | 164 | ss | /* */
|
| 532 | 164 | ss | /* <InOut> */
|
| 533 | 164 | ss | /* b :: A pointer to matrix `b'. */
|
| 534 | 164 | ss | /* */
|
| 535 | 164 | ss | /* <Note> */
|
| 536 | 164 | ss | /* The result is undefined if either `a' or `b' is zero. */
|
| 537 | 164 | ss | /* */
|
| 538 | 164 | ss | FT_EXPORT( void )
|
| 539 | 164 | ss | FT_Matrix_Multiply( const FT_Matrix* a,
|
| 540 | 164 | ss | FT_Matrix* b ); |
| 541 | 164 | ss | |
| 542 | 164 | ss | |
| 543 | 164 | ss | /*************************************************************************/
|
| 544 | 164 | ss | /* */
|
| 545 | 164 | ss | /* <Function> */
|
| 546 | 164 | ss | /* FT_Matrix_Invert */
|
| 547 | 164 | ss | /* */
|
| 548 | 164 | ss | /* <Description> */
|
| 549 | 164 | ss | /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
|
| 550 | 164 | ss | /* */
|
| 551 | 164 | ss | /* <InOut> */
|
| 552 | 164 | ss | /* matrix :: A pointer to the target matrix. Remains untouched in */
|
| 553 | 164 | ss | /* case of error. */
|
| 554 | 164 | ss | /* */
|
| 555 | 164 | ss | /* <Return> */
|
| 556 | 164 | ss | /* FreeType error code. 0 means success. */
|
| 557 | 164 | ss | /* */
|
| 558 | 164 | ss | FT_EXPORT( FT_Error ) |
| 559 | 164 | ss | FT_Matrix_Invert( FT_Matrix* matrix ); |
| 560 | 164 | ss | |
| 561 | 164 | ss | |
| 562 | 164 | ss | /* */
|
| 563 | 164 | ss | |
| 564 | 164 | ss | |
| 565 | 164 | ss | FT_END_HEADER |
| 566 | 164 | ss | |
| 567 | 164 | ss | #endif /* __FTGLYPH_H__ */ |
| 568 | 164 | ss | |
| 569 | 164 | ss | |
| 570 | 164 | ss | /* END */
|
| 571 | 164 | ss | |
| 572 | 164 | ss | |
| 573 | 164 | ss | /* Local Variables: */
|
| 574 | 164 | ss | /* coding: utf-8 */
|
| 575 | 164 | ss | /* End: */ |
