michael@0: /***************************************************************************/ michael@0: /* */ michael@0: /* ftadvanc.h */ michael@0: /* */ michael@0: /* Quick computation of advance widths (specification only). */ michael@0: /* */ michael@0: /* Copyright 2008, 2013 by */ michael@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ michael@0: /* */ michael@0: /* This file is part of the FreeType project, and may only be used, */ michael@0: /* modified, and distributed under the terms of the FreeType project */ michael@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ michael@0: /* this file you indicate that you have read the license and */ michael@0: /* understand and accept it fully. */ michael@0: /* */ michael@0: /***************************************************************************/ michael@0: michael@0: michael@0: #ifndef __FTADVANC_H__ michael@0: #define __FTADVANC_H__ michael@0: michael@0: michael@0: #include michael@0: #include FT_FREETYPE_H michael@0: michael@0: #ifdef FREETYPE_H michael@0: #error "freetype.h of FreeType 1 has been loaded!" michael@0: #error "Please fix the directory search order for header files" michael@0: #error "so that freetype.h of FreeType 2 is found first." michael@0: #endif michael@0: michael@0: michael@0: FT_BEGIN_HEADER michael@0: michael@0: michael@0: /************************************************************************** michael@0: * michael@0: * @section: michael@0: * quick_advance michael@0: * michael@0: * @title: michael@0: * Quick retrieval of advance values michael@0: * michael@0: * @abstract: michael@0: * Retrieve horizontal and vertical advance values without processing michael@0: * glyph outlines, if possible. michael@0: * michael@0: * @description: michael@0: * This section contains functions to quickly extract advance values michael@0: * without handling glyph outlines, if possible. michael@0: */ michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* */ michael@0: /* FT_ADVANCE_FLAG_FAST_ONLY */ michael@0: /* */ michael@0: /* */ michael@0: /* A bit-flag to be OR-ed with the `flags' parameter of the */ michael@0: /* @FT_Get_Advance and @FT_Get_Advances functions. */ michael@0: /* */ michael@0: /* If set, it indicates that you want these functions to fail if the */ michael@0: /* corresponding hinting mode or font driver doesn't allow for very */ michael@0: /* quick advance computation. */ michael@0: /* */ michael@0: /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */ michael@0: /* or light-hinted can have their advance width computed very */ michael@0: /* quickly. */ michael@0: /* */ michael@0: /* Normal and bytecode hinted modes that require loading, scaling, */ michael@0: /* and hinting of the glyph outline, are extremely slow by */ michael@0: /* comparison. */ michael@0: /* */ michael@0: #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* */ michael@0: /* FT_Get_Advance */ michael@0: /* */ michael@0: /* */ michael@0: /* Retrieve the advance value of a given glyph outline in an */ michael@0: /* @FT_Face. */ michael@0: /* */ michael@0: /* */ michael@0: /* face :: The source @FT_Face handle. */ michael@0: /* */ michael@0: /* gindex :: The glyph index. */ michael@0: /* */ michael@0: /* load_flags :: A set of bit flags similar to those used when */ michael@0: /* calling @FT_Load_Glyph, used to determine what kind */ michael@0: /* of advances you need. */ michael@0: /* */ michael@0: /* padvance :: The advance value. If scaling is performed (based on */ michael@0: /* the value of `load_flags'), the advance value is in */ michael@0: /* 16.16 format. Otherwise, it is in font units. */ michael@0: /* */ michael@0: /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ michael@0: /* vertical advance corresponding to a vertical layout. */ michael@0: /* Otherwise, it is the horizontal advance in a */ michael@0: /* horizontal layout. */ michael@0: /* */ michael@0: /* */ michael@0: /* FreeType error code. 0 means success. */ michael@0: /* */ michael@0: /* */ michael@0: /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ michael@0: /* if the corresponding font backend doesn't have a quick way to */ michael@0: /* retrieve the advances. */ michael@0: /* */ michael@0: /* A scaled advance is returned in 16.16 format but isn't transformed */ michael@0: /* by the affine transformation specified by @FT_Set_Transform. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Advance( FT_Face face, michael@0: FT_UInt gindex, michael@0: FT_Int32 load_flags, michael@0: FT_Fixed *padvance ); michael@0: michael@0: michael@0: /*************************************************************************/ michael@0: /* */ michael@0: /* */ michael@0: /* FT_Get_Advances */ michael@0: /* */ michael@0: /* */ michael@0: /* Retrieve the advance values of several glyph outlines in an */ michael@0: /* @FT_Face. */ michael@0: /* */ michael@0: /* */ michael@0: /* face :: The source @FT_Face handle. */ michael@0: /* */ michael@0: /* start :: The first glyph index. */ michael@0: /* */ michael@0: /* count :: The number of advance values you want to retrieve. */ michael@0: /* */ michael@0: /* load_flags :: A set of bit flags similar to those used when */ michael@0: /* calling @FT_Load_Glyph. */ michael@0: /* */ michael@0: /* */ michael@0: /* padvance :: The advance values. This array, to be provided by the */ michael@0: /* caller, must contain at least `count' elements. */ michael@0: /* */ michael@0: /* If scaling is performed (based on the value of */ michael@0: /* `load_flags'), the advance values are in 16.16 format. */ michael@0: /* Otherwise, they are in font units. */ michael@0: /* */ michael@0: /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ michael@0: /* vertical advances corresponding to a vertical layout. */ michael@0: /* Otherwise, they are the horizontal advances in a */ michael@0: /* horizontal layout. */ michael@0: /* */ michael@0: /* */ michael@0: /* FreeType error code. 0 means success. */ michael@0: /* */ michael@0: /* */ michael@0: /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ michael@0: /* if the corresponding font backend doesn't have a quick way to */ michael@0: /* retrieve the advances. */ michael@0: /* */ michael@0: /* Scaled advances are returned in 16.16 format but aren't */ michael@0: /* transformed by the affine transformation specified by */ michael@0: /* @FT_Set_Transform. */ michael@0: /* */ michael@0: FT_EXPORT( FT_Error ) michael@0: FT_Get_Advances( FT_Face face, michael@0: FT_UInt start, michael@0: FT_UInt count, michael@0: FT_Int32 load_flags, michael@0: FT_Fixed *padvances ); michael@0: michael@0: /* */ michael@0: michael@0: michael@0: FT_END_HEADER michael@0: michael@0: #endif /* __FTADVANC_H__ */ michael@0: michael@0: michael@0: /* END */