| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* ftglyph.h */ | 3 /* ftglyph.h */ |
| 4 /* */ | 4 /* */ |
| 5 /* FreeType convenience functions to handle glyphs (specification). */ | 5 /* FreeType convenience functions to handle glyphs (specification). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */ | 7 /* Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013, 2014 by */ |
| 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 /* */ | 9 /* */ |
| 10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
| 11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| 18 | 18 |
| 19 /*************************************************************************/ | 19 /*************************************************************************/ |
| 20 /* */ | 20 /* */ |
| 21 /* This file contains the definition of several convenience functions */ | 21 /* This file contains the definition of several convenience functions */ |
| 22 /* that can be used by client applications to easily retrieve glyph */ | 22 /* that can be used by client applications to easily retrieve glyph */ |
| 23 /* bitmaps and outlines from a given face. */ | 23 /* bitmaps and outlines from a given face. */ |
| 24 /* */ | 24 /* */ |
| 25 /* These functions should be optional if you are writing a font server */ | 25 /* These functions should be optional if you are writing a font server */ |
| 26 /* or text layout engine on top of FreeType. However, they are pretty */ | 26 /* or text layout engine on top of FreeType. However, they are pretty */ |
| 27 /* handy for many other simple uses of the library. */ | 27 /* handy for many other simple uses of the library. */ |
| 28 /* */ | 28 /* */ |
| 29 /*************************************************************************/ | 29 /*************************************************************************/ |
| 30 | 30 |
| 31 | 31 |
| 32 #ifndef __FTGLYPH_H__ | 32 #ifndef __FTGLYPH_H__ |
| 33 #define __FTGLYPH_H__ | 33 #define __FTGLYPH_H__ |
| 34 | 34 |
| 35 | 35 |
| 36 #include "../ft2build.h" | 36 #include <ft2build.h> |
| 37 #include "freetype.h" | 37 #include FT_FREETYPE_H |
| 38 | 38 |
| 39 #ifdef FREETYPE_H | 39 #ifdef FREETYPE_H |
| 40 #error "freetype.h of FreeType 1 has been loaded!" | 40 #error "freetype.h of FreeType 1 has been loaded!" |
| 41 #error "Please fix the directory search order for header files" | 41 #error "Please fix the directory search order for header files" |
| 42 #error "so that freetype.h of FreeType 2 is found first." | 42 #error "so that freetype.h of FreeType 2 is found first." |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 | 45 |
| 46 FT_BEGIN_HEADER | 46 FT_BEGIN_HEADER |
| 47 | 47 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 { | 318 { |
| 319 FT_GLYPH_BBOX_UNSCALED = 0, | 319 FT_GLYPH_BBOX_UNSCALED = 0, |
| 320 FT_GLYPH_BBOX_SUBPIXELS = 0, | 320 FT_GLYPH_BBOX_SUBPIXELS = 0, |
| 321 FT_GLYPH_BBOX_GRIDFIT = 1, | 321 FT_GLYPH_BBOX_GRIDFIT = 1, |
| 322 FT_GLYPH_BBOX_TRUNCATE = 2, | 322 FT_GLYPH_BBOX_TRUNCATE = 2, |
| 323 FT_GLYPH_BBOX_PIXELS = 3 | 323 FT_GLYPH_BBOX_PIXELS = 3 |
| 324 | 324 |
| 325 } FT_Glyph_BBox_Mode; | 325 } FT_Glyph_BBox_Mode; |
| 326 | 326 |
| 327 | 327 |
| 328 /*************************************************************************/ | 328 /* these constants are deprecated; use the corresponding */ |
| 329 /* */ | 329 /* `FT_Glyph_BBox_Mode' values instead */ |
| 330 /* <Enum> */ | |
| 331 /* ft_glyph_bbox_xxx */ | |
| 332 /* */ | |
| 333 /* <Description> */ | |
| 334 /* These constants are deprecated. Use the corresponding */ | |
| 335 /* @FT_Glyph_BBox_Mode values instead. */ | |
| 336 /* */ | |
| 337 /* <Values> */ | |
| 338 /* ft_glyph_bbox_unscaled :: See @FT_GLYPH_BBOX_UNSCALED. */ | |
| 339 /* ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS. */ | |
| 340 /* ft_glyph_bbox_gridfit :: See @FT_GLYPH_BBOX_GRIDFIT. */ | |
| 341 /* ft_glyph_bbox_truncate :: See @FT_GLYPH_BBOX_TRUNCATE. */ | |
| 342 /* ft_glyph_bbox_pixels :: See @FT_GLYPH_BBOX_PIXELS. */ | |
| 343 /* */ | |
| 344 #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED | 330 #define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED |
| 345 #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS | 331 #define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS |
| 346 #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT | 332 #define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT |
| 347 #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE | 333 #define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE |
| 348 #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS | 334 #define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS |
| 349 | 335 |
| 350 | 336 |
| 351 /*************************************************************************/ | 337 /*************************************************************************/ |
| 352 /* */ | 338 /* */ |
| 353 /* <Function> */ | 339 /* <Function> */ |
| 354 /* FT_Glyph_Get_CBox */ | 340 /* FT_Glyph_Get_CBox */ |
| 355 /* */ | 341 /* */ |
| 356 /* <Description> */ | 342 /* <Description> */ |
| 357 /* Return a glyph's `control box'. The control box encloses all the */ | 343 /* Return a glyph's `control box'. The control box encloses all the */ |
| 358 /* outline's points, including Bézier control points. Though it */ | 344 /* outline's points, including Bézier control points. Though it */ |
| 359 /* coincides with the exact bounding box for most glyphs, it can be */ | 345 /* coincides with the exact bounding box for most glyphs, it can be */ |
| 360 /* slightly larger in some situations (like when rotating an outline */ | 346 /* slightly larger in some situations (like when rotating an outline */ |
| 361 /* which contains Bézier outside arcs). */ | 347 /* that contains Bézier outside arcs). */ |
| 362 /* */ | 348 /* */ |
| 363 /* Computing the control box is very fast, while getting the bounding */ | 349 /* Computing the control box is very fast, while getting the bounding */ |
| 364 /* box can take much more time as it needs to walk over all segments */ | 350 /* box can take much more time as it needs to walk over all segments */ |
| 365 /* and arcs in the outline. To get the latter, you can use the */ | 351 /* and arcs in the outline. To get the latter, you can use the */ |
| 366 /* `ftbbox' component which is dedicated to this single task. */ | 352 /* `ftbbox' component, which is dedicated to this single task. */ |
| 367 /* */ | 353 /* */ |
| 368 /* <Input> */ | 354 /* <Input> */ |
| 369 /* glyph :: A handle to the source glyph object. */ | 355 /* glyph :: A handle to the source glyph object. */ |
| 370 /* */ | 356 /* */ |
| 371 /* mode :: The mode which indicates how to interpret the returned */ | 357 /* mode :: The mode that indicates how to interpret the returned */ |
| 372 /* bounding box values. */ | 358 /* bounding box values. */ |
| 373 /* */ | 359 /* */ |
| 374 /* <Output> */ | 360 /* <Output> */ |
| 375 /* acbox :: The glyph coordinate bounding box. Coordinates are */ | 361 /* acbox :: The glyph coordinate bounding box. Coordinates are */ |
| 376 /* expressed in 1/64th of pixels if it is grid-fitted. */ | 362 /* expressed in 1/64th of pixels if it is grid-fitted. */ |
| 377 /* */ | 363 /* */ |
| 378 /* <Note> */ | 364 /* <Note> */ |
| 379 /* Coordinates are relative to the glyph origin, using the y~upwards */ | 365 /* Coordinates are relative to the glyph origin, using the y~upwards */ |
| 380 /* convention. */ | 366 /* convention. */ |
| 381 /* */ | 367 /* */ |
| 382 /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ | 368 /* If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode' */ |
| 383 /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ | 369 /* must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font */ |
| 384 /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ | 370 /* units in 26.6 pixel format. The value @FT_GLYPH_BBOX_SUBPIXELS */ |
| 385 /* is another name for this constant. */ | 371 /* is another name for this constant. */ |
| 386 /* */ | 372 /* */ |
| 387 /* If the font is tricky and the glyph has been loaded with */ | 373 /* If the font is tricky and the glyph has been loaded with */ |
| 388 /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ | 374 /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ |
| 389 /* reasonable values for the CBox it is necessary to load the glyph */ | 375 /* reasonable values for the CBox it is necessary to load the glyph */ |
| 390 /* at a large ppem value (so that the hinting instructions can */ | 376 /* at a large ppem value (so that the hinting instructions can */ |
| 391 /* properly shift and scale the subglyphs), then extracting the CBox */ | 377 /* properly shift and scale the subglyphs), then extracting the CBox, */ |
| 392 /* which can be eventually converted back to font units. */ | 378 /* which can be eventually converted back to font units. */ |
| 393 /* */ | 379 /* */ |
| 394 /* Note that the maximum coordinates are exclusive, which means that */ | 380 /* Note that the maximum coordinates are exclusive, which means that */ |
| 395 /* one can compute the width and height of the glyph image (be it in */ | 381 /* one can compute the width and height of the glyph image (be it in */ |
| 396 /* integer or 26.6 pixels) as: */ | 382 /* integer or 26.6 pixels) as: */ |
| 397 /* */ | 383 /* */ |
| 398 /* { */ | 384 /* { */ |
| 399 /* width = bbox.xMax - bbox.xMin; */ | 385 /* width = bbox.xMax - bbox.xMin; */ |
| 400 /* height = bbox.yMax - bbox.yMin; */ | 386 /* height = bbox.yMax - bbox.yMin; */ |
| 401 /* } */ | 387 /* } */ |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 /* <InOut> */ | 582 /* <InOut> */ |
| 597 /* matrix :: A pointer to the target matrix. Remains untouched in */ | 583 /* matrix :: A pointer to the target matrix. Remains untouched in */ |
| 598 /* case of error. */ | 584 /* case of error. */ |
| 599 /* */ | 585 /* */ |
| 600 /* <Return> */ | 586 /* <Return> */ |
| 601 /* FreeType error code. 0~means success. */ | 587 /* FreeType error code. 0~means success. */ |
| 602 /* */ | 588 /* */ |
| 603 FT_EXPORT( FT_Error ) | 589 FT_EXPORT( FT_Error ) |
| 604 FT_Matrix_Invert( FT_Matrix* matrix ); | 590 FT_Matrix_Invert( FT_Matrix* matrix ); |
| 605 | 591 |
| 606 | |
| 607 /* */ | 592 /* */ |
| 608 | 593 |
| 609 | 594 |
| 610 FT_END_HEADER | 595 FT_END_HEADER |
| 611 | 596 |
| 612 #endif /* __FTGLYPH_H__ */ | 597 #endif /* __FTGLYPH_H__ */ |
| 613 | 598 |
| 614 | 599 |
| 615 /* END */ | 600 /* END */ |
| 616 | 601 |
| 617 | 602 |
| 618 /* Local Variables: */ | 603 /* Local Variables: */ |
| 619 /* coding: utf-8 */ | 604 /* coding: utf-8 */ |
| 620 /* End: */ | 605 /* End: */ |
| OLD | NEW |