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