• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  *
3  * ftbbox.h
4  *
5  *   FreeType exact bbox computation (specification).
6  *
7  * Copyright (C) 1996-2020 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   /**************************************************************************
20    *
21    * This component has a _single_ role: to compute exact outline bounding
22    * boxes.
23    *
24    * It is separated from the rest of the engine for various technical
25    * reasons.  It may well be integrated in 'ftoutln' later.
26    *
27    */
28 
29 
30 #ifndef FTBBOX_H_
31 #define FTBBOX_H_
32 
33 
34 #include <freetype/freetype.h>
35 
36 #ifdef FREETYPE_H
37 #error "freetype.h of FreeType 1 has been loaded!"
38 #error "Please fix the directory search order for header files"
39 #error "so that freetype.h of FreeType 2 is found first."
40 #endif
41 
42 
43 FT_BEGIN_HEADER
44 
45 
46   /**************************************************************************
47    *
48    * @section:
49    *   outline_processing
50    *
51    */
52 
53 
54   /**************************************************************************
55    *
56    * @function:
57    *   FT_Outline_Get_BBox
58    *
59    * @description:
60    *   Compute the exact bounding box of an outline.  This is slower than
61    *   computing the control box.  However, it uses an advanced algorithm
62    *   that returns _very_ quickly when the two boxes coincide.  Otherwise,
63    *   the outline Bezier arcs are traversed to extract their extrema.
64    *
65    * @input:
66    *   outline ::
67    *     A pointer to the source outline.
68    *
69    * @output:
70    *   abbox ::
71    *     The outline's exact bounding box.
72    *
73    * @return:
74    *   FreeType error code.  0~means success.
75    *
76    * @note:
77    *   If the font is tricky and the glyph has been loaded with
78    *   @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get
79    *   reasonable values for the BBox it is necessary to load the glyph at a
80    *   large ppem value (so that the hinting instructions can properly shift
81    *   and scale the subglyphs), then extracting the BBox, which can be
82    *   eventually converted back to font units.
83    */
84   FT_EXPORT( FT_Error )
85   FT_Outline_Get_BBox( FT_Outline*  outline,
86                        FT_BBox     *abbox );
87 
88   /* */
89 
90 
91 FT_END_HEADER
92 
93 #endif /* FTBBOX_H_ */
94 
95 
96 /* END */
97 
98 
99 /* Local Variables: */
100 /* coding: utf-8    */
101 /* End:             */
102