Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /***************************************************************************/ |
michael@0 | 2 | /* */ |
michael@0 | 3 | /* ftpfr.h */ |
michael@0 | 4 | /* */ |
michael@0 | 5 | /* FreeType API for accessing PFR-specific data (specification only). */ |
michael@0 | 6 | /* */ |
michael@0 | 7 | /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 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 | #ifndef __FTPFR_H__ |
michael@0 | 20 | #define __FTPFR_H__ |
michael@0 | 21 | |
michael@0 | 22 | #include <ft2build.h> |
michael@0 | 23 | #include FT_FREETYPE_H |
michael@0 | 24 | |
michael@0 | 25 | #ifdef FREETYPE_H |
michael@0 | 26 | #error "freetype.h of FreeType 1 has been loaded!" |
michael@0 | 27 | #error "Please fix the directory search order for header files" |
michael@0 | 28 | #error "so that freetype.h of FreeType 2 is found first." |
michael@0 | 29 | #endif |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | FT_BEGIN_HEADER |
michael@0 | 33 | |
michael@0 | 34 | |
michael@0 | 35 | /*************************************************************************/ |
michael@0 | 36 | /* */ |
michael@0 | 37 | /* <Section> */ |
michael@0 | 38 | /* pfr_fonts */ |
michael@0 | 39 | /* */ |
michael@0 | 40 | /* <Title> */ |
michael@0 | 41 | /* PFR Fonts */ |
michael@0 | 42 | /* */ |
michael@0 | 43 | /* <Abstract> */ |
michael@0 | 44 | /* PFR/TrueDoc specific API. */ |
michael@0 | 45 | /* */ |
michael@0 | 46 | /* <Description> */ |
michael@0 | 47 | /* This section contains the declaration of PFR-specific functions. */ |
michael@0 | 48 | /* */ |
michael@0 | 49 | /*************************************************************************/ |
michael@0 | 50 | |
michael@0 | 51 | |
michael@0 | 52 | /********************************************************************** |
michael@0 | 53 | * |
michael@0 | 54 | * @function: |
michael@0 | 55 | * FT_Get_PFR_Metrics |
michael@0 | 56 | * |
michael@0 | 57 | * @description: |
michael@0 | 58 | * Return the outline and metrics resolutions of a given PFR face. |
michael@0 | 59 | * |
michael@0 | 60 | * @input: |
michael@0 | 61 | * face :: Handle to the input face. It can be a non-PFR face. |
michael@0 | 62 | * |
michael@0 | 63 | * @output: |
michael@0 | 64 | * aoutline_resolution :: |
michael@0 | 65 | * Outline resolution. This is equivalent to `face->units_per_EM' |
michael@0 | 66 | * for non-PFR fonts. Optional (parameter can be NULL). |
michael@0 | 67 | * |
michael@0 | 68 | * ametrics_resolution :: |
michael@0 | 69 | * Metrics resolution. This is equivalent to `outline_resolution' |
michael@0 | 70 | * for non-PFR fonts. Optional (parameter can be NULL). |
michael@0 | 71 | * |
michael@0 | 72 | * ametrics_x_scale :: |
michael@0 | 73 | * A 16.16 fixed-point number used to scale distance expressed |
michael@0 | 74 | * in metrics units to device sub-pixels. This is equivalent to |
michael@0 | 75 | * `face->size->x_scale', but for metrics only. Optional (parameter |
michael@0 | 76 | * can be NULL). |
michael@0 | 77 | * |
michael@0 | 78 | * ametrics_y_scale :: |
michael@0 | 79 | * Same as `ametrics_x_scale' but for the vertical direction. |
michael@0 | 80 | * optional (parameter can be NULL). |
michael@0 | 81 | * |
michael@0 | 82 | * @return: |
michael@0 | 83 | * FreeType error code. 0~means success. |
michael@0 | 84 | * |
michael@0 | 85 | * @note: |
michael@0 | 86 | * If the input face is not a PFR, this function will return an error. |
michael@0 | 87 | * However, in all cases, it will return valid values. |
michael@0 | 88 | */ |
michael@0 | 89 | FT_EXPORT( FT_Error ) |
michael@0 | 90 | FT_Get_PFR_Metrics( FT_Face face, |
michael@0 | 91 | FT_UInt *aoutline_resolution, |
michael@0 | 92 | FT_UInt *ametrics_resolution, |
michael@0 | 93 | FT_Fixed *ametrics_x_scale, |
michael@0 | 94 | FT_Fixed *ametrics_y_scale ); |
michael@0 | 95 | |
michael@0 | 96 | |
michael@0 | 97 | /********************************************************************** |
michael@0 | 98 | * |
michael@0 | 99 | * @function: |
michael@0 | 100 | * FT_Get_PFR_Kerning |
michael@0 | 101 | * |
michael@0 | 102 | * @description: |
michael@0 | 103 | * Return the kerning pair corresponding to two glyphs in a PFR face. |
michael@0 | 104 | * The distance is expressed in metrics units, unlike the result of |
michael@0 | 105 | * @FT_Get_Kerning. |
michael@0 | 106 | * |
michael@0 | 107 | * @input: |
michael@0 | 108 | * face :: A handle to the input face. |
michael@0 | 109 | * |
michael@0 | 110 | * left :: Index of the left glyph. |
michael@0 | 111 | * |
michael@0 | 112 | * right :: Index of the right glyph. |
michael@0 | 113 | * |
michael@0 | 114 | * @output: |
michael@0 | 115 | * avector :: A kerning vector. |
michael@0 | 116 | * |
michael@0 | 117 | * @return: |
michael@0 | 118 | * FreeType error code. 0~means success. |
michael@0 | 119 | * |
michael@0 | 120 | * @note: |
michael@0 | 121 | * This function always return distances in original PFR metrics |
michael@0 | 122 | * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED |
michael@0 | 123 | * mode, which always returns distances converted to outline units. |
michael@0 | 124 | * |
michael@0 | 125 | * You can use the value of the `x_scale' and `y_scale' parameters |
michael@0 | 126 | * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. |
michael@0 | 127 | */ |
michael@0 | 128 | FT_EXPORT( FT_Error ) |
michael@0 | 129 | FT_Get_PFR_Kerning( FT_Face face, |
michael@0 | 130 | FT_UInt left, |
michael@0 | 131 | FT_UInt right, |
michael@0 | 132 | FT_Vector *avector ); |
michael@0 | 133 | |
michael@0 | 134 | |
michael@0 | 135 | /********************************************************************** |
michael@0 | 136 | * |
michael@0 | 137 | * @function: |
michael@0 | 138 | * FT_Get_PFR_Advance |
michael@0 | 139 | * |
michael@0 | 140 | * @description: |
michael@0 | 141 | * Return a given glyph advance, expressed in original metrics units, |
michael@0 | 142 | * from a PFR font. |
michael@0 | 143 | * |
michael@0 | 144 | * @input: |
michael@0 | 145 | * face :: A handle to the input face. |
michael@0 | 146 | * |
michael@0 | 147 | * gindex :: The glyph index. |
michael@0 | 148 | * |
michael@0 | 149 | * @output: |
michael@0 | 150 | * aadvance :: The glyph advance in metrics units. |
michael@0 | 151 | * |
michael@0 | 152 | * @return: |
michael@0 | 153 | * FreeType error code. 0~means success. |
michael@0 | 154 | * |
michael@0 | 155 | * @note: |
michael@0 | 156 | * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics |
michael@0 | 157 | * to convert the advance to device sub-pixels (i.e., 1/64th of pixels). |
michael@0 | 158 | */ |
michael@0 | 159 | FT_EXPORT( FT_Error ) |
michael@0 | 160 | FT_Get_PFR_Advance( FT_Face face, |
michael@0 | 161 | FT_UInt gindex, |
michael@0 | 162 | FT_Pos *aadvance ); |
michael@0 | 163 | |
michael@0 | 164 | /* */ |
michael@0 | 165 | |
michael@0 | 166 | |
michael@0 | 167 | FT_END_HEADER |
michael@0 | 168 | |
michael@0 | 169 | #endif /* __FTPFR_H__ */ |
michael@0 | 170 | |
michael@0 | 171 | |
michael@0 | 172 | /* END */ |