ftbbox.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /***************************************************************************/
  2. /* */
  3. /* ftbbox.h */
  4. /* */
  5. /* FreeType exact bbox computation (specification). */
  6. /* */
  7. /* Copyright 1996-2001, 2003, 2007, 2011, 2013 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  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 */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. /*************************************************************************/
  18. /* */
  19. /* This component has a _single_ role: to compute exact outline bounding */
  20. /* boxes. */
  21. /* */
  22. /* It is separated from the rest of the engine for various technical */
  23. /* reasons. It may well be integrated in `ftoutln' later. */
  24. /* */
  25. /*************************************************************************/
  26. #ifndef __FTBBOX_H__
  27. #define __FTBBOX_H__
  28. #include <ft2build.h>
  29. #include FT_FREETYPE_H
  30. #ifdef FREETYPE_H
  31. #error "freetype.h of FreeType 1 has been loaded!"
  32. #error "Please fix the directory search order for header files"
  33. #error "so that freetype.h of FreeType 2 is found first."
  34. #endif
  35. FT_BEGIN_HEADER
  36. /*************************************************************************/
  37. /* */
  38. /* <Section> */
  39. /* outline_processing */
  40. /* */
  41. /*************************************************************************/
  42. /*************************************************************************/
  43. /* */
  44. /* <Function> */
  45. /* FT_Outline_Get_BBox */
  46. /* */
  47. /* <Description> */
  48. /* Compute the exact bounding box of an outline. This is slower */
  49. /* than computing the control box. However, it uses an advanced */
  50. /* algorithm that returns _very_ quickly when the two boxes */
  51. /* coincide. Otherwise, the outline Bézier arcs are traversed to */
  52. /* extract their extrema. */
  53. /* */
  54. /* <Input> */
  55. /* outline :: A pointer to the source outline. */
  56. /* */
  57. /* <Output> */
  58. /* abbox :: The outline's exact bounding box. */
  59. /* */
  60. /* <Return> */
  61. /* FreeType error code. 0~means success. */
  62. /* */
  63. /* <Note> */
  64. /* If the font is tricky and the glyph has been loaded with */
  65. /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
  66. /* reasonable values for the BBox it is necessary to load the glyph */
  67. /* at a large ppem value (so that the hinting instructions can */
  68. /* properly shift and scale the subglyphs), then extracting the BBox, */
  69. /* which can be eventually converted back to font units. */
  70. /* */
  71. FT_EXPORT( FT_Error )
  72. FT_Outline_Get_BBox( FT_Outline* outline,
  73. FT_BBox *abbox );
  74. /* */
  75. FT_END_HEADER
  76. #endif /* __FTBBOX_H__ */
  77. /* END */
  78. /* Local Variables: */
  79. /* coding: utf-8 */
  80. /* End: */