vrshoot
diff libs/ft2static/freetype/ftadvanc.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/ft2static/freetype/ftadvanc.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,179 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftadvanc.h */ 1.7 +/* */ 1.8 +/* Quick computation of advance widths (specification only). */ 1.9 +/* */ 1.10 +/* Copyright 2008 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FTADVANC_H__ 1.23 +#define __FTADVANC_H__ 1.24 + 1.25 + 1.26 +#include <ft2build.h> 1.27 +#include FT_FREETYPE_H 1.28 + 1.29 +#ifdef FREETYPE_H 1.30 +#error "freetype.h of FreeType 1 has been loaded!" 1.31 +#error "Please fix the directory search order for header files" 1.32 +#error "so that freetype.h of FreeType 2 is found first." 1.33 +#endif 1.34 + 1.35 + 1.36 +FT_BEGIN_HEADER 1.37 + 1.38 + 1.39 + /************************************************************************** 1.40 + * 1.41 + * @section: 1.42 + * quick_advance 1.43 + * 1.44 + * @title: 1.45 + * Quick retrieval of advance values 1.46 + * 1.47 + * @abstract: 1.48 + * Retrieve horizontal and vertical advance values without processing 1.49 + * glyph outlines, if possible. 1.50 + * 1.51 + * @description: 1.52 + * This section contains functions to quickly extract advance values 1.53 + * without handling glyph outlines, if possible. 1.54 + */ 1.55 + 1.56 + 1.57 + /*************************************************************************/ 1.58 + /* */ 1.59 + /* <Const> */ 1.60 + /* FT_ADVANCE_FLAG_FAST_ONLY */ 1.61 + /* */ 1.62 + /* <Description> */ 1.63 + /* A bit-flag to be OR-ed with the `flags' parameter of the */ 1.64 + /* @FT_Get_Advance and @FT_Get_Advances functions. */ 1.65 + /* */ 1.66 + /* If set, it indicates that you want these functions to fail if the */ 1.67 + /* corresponding hinting mode or font driver doesn't allow for very */ 1.68 + /* quick advance computation. */ 1.69 + /* */ 1.70 + /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ 1.71 + /* or light-hinted can have their advance width computed very */ 1.72 + /* quickly. */ 1.73 + /* */ 1.74 + /* Normal and bytecode hinted modes, which require loading, scaling, */ 1.75 + /* and hinting of the glyph outline, are extremely slow by */ 1.76 + /* comparison. */ 1.77 + /* */ 1.78 +#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL 1.79 + 1.80 + 1.81 + /*************************************************************************/ 1.82 + /* */ 1.83 + /* <Function> */ 1.84 + /* FT_Get_Advance */ 1.85 + /* */ 1.86 + /* <Description> */ 1.87 + /* Retrieve the advance value of a given glyph outline in an */ 1.88 + /* @FT_Face. By default, the unhinted advance is returned in font */ 1.89 + /* units. */ 1.90 + /* */ 1.91 + /* <Input> */ 1.92 + /* face :: The source @FT_Face handle. */ 1.93 + /* */ 1.94 + /* gindex :: The glyph index. */ 1.95 + /* */ 1.96 + /* load_flags :: A set of bit flags similar to those used when */ 1.97 + /* calling @FT_Load_Glyph, used to determine what kind */ 1.98 + /* of advances you need. */ 1.99 + /* <Output> */ 1.100 + /* padvance :: The advance value, in either font units or 16.16 */ 1.101 + /* format. */ 1.102 + /* */ 1.103 + /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ 1.104 + /* vertical advance corresponding to a vertical layout. */ 1.105 + /* Otherwise, it is the horizontal advance in a */ 1.106 + /* horizontal layout. */ 1.107 + /* */ 1.108 + /* <Return> */ 1.109 + /* FreeType error code. 0 means success. */ 1.110 + /* */ 1.111 + /* <Note> */ 1.112 + /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ 1.113 + /* if the corresponding font backend doesn't have a quick way to */ 1.114 + /* retrieve the advances. */ 1.115 + /* */ 1.116 + /* A scaled advance is returned in 16.16 format but isn't transformed */ 1.117 + /* by the affine transformation specified by @FT_Set_Transform. */ 1.118 + /* */ 1.119 + FT_EXPORT( FT_Error ) 1.120 + FT_Get_Advance( FT_Face face, 1.121 + FT_UInt gindex, 1.122 + FT_Int32 load_flags, 1.123 + FT_Fixed *padvance ); 1.124 + 1.125 + 1.126 + /*************************************************************************/ 1.127 + /* */ 1.128 + /* <Function> */ 1.129 + /* FT_Get_Advances */ 1.130 + /* */ 1.131 + /* <Description> */ 1.132 + /* Retrieve the advance values of several glyph outlines in an */ 1.133 + /* @FT_Face. By default, the unhinted advances are returned in font */ 1.134 + /* units. */ 1.135 + /* */ 1.136 + /* <Input> */ 1.137 + /* face :: The source @FT_Face handle. */ 1.138 + /* */ 1.139 + /* start :: The first glyph index. */ 1.140 + /* */ 1.141 + /* count :: The number of advance values you want to retrieve. */ 1.142 + /* */ 1.143 + /* load_flags :: A set of bit flags similar to those used when */ 1.144 + /* calling @FT_Load_Glyph. */ 1.145 + /* */ 1.146 + /* <Output> */ 1.147 + /* padvance :: The advances, in either font units or 16.16 format. */ 1.148 + /* This array must contain at least `count' elements. */ 1.149 + /* */ 1.150 + /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ 1.151 + /* vertical advances corresponding to a vertical layout. */ 1.152 + /* Otherwise, they are the horizontal advances in a */ 1.153 + /* horizontal layout. */ 1.154 + /* */ 1.155 + /* <Return> */ 1.156 + /* FreeType error code. 0 means success. */ 1.157 + /* */ 1.158 + /* <Note> */ 1.159 + /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ 1.160 + /* if the corresponding font backend doesn't have a quick way to */ 1.161 + /* retrieve the advances. */ 1.162 + /* */ 1.163 + /* Scaled advances are returned in 16.16 format but aren't */ 1.164 + /* transformed by the affine transformation specified by */ 1.165 + /* @FT_Set_Transform. */ 1.166 + /* */ 1.167 + FT_EXPORT( FT_Error ) 1.168 + FT_Get_Advances( FT_Face face, 1.169 + FT_UInt start, 1.170 + FT_UInt count, 1.171 + FT_Int32 load_flags, 1.172 + FT_Fixed *padvances ); 1.173 + 1.174 +/* */ 1.175 + 1.176 + 1.177 +FT_END_HEADER 1.178 + 1.179 +#endif /* __FTADVANC_H__ */ 1.180 + 1.181 + 1.182 +/* END */