Home | History | Annotate | Download | only in autofit
      1 /***************************************************************************/
      2 /*                                                                         */
      3 /*  afglobal.h                                                             */
      4 /*                                                                         */
      5 /*    Auto-fitter routines to compute global hinting values                */
      6 /*    (specification).                                                     */
      7 /*                                                                         */
      8 /*  Copyright 2003-2005, 2007, 2009, 2011-2012 by                          */
      9 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
     10 /*                                                                         */
     11 /*  This file is part of the FreeType project, and may only be used,       */
     12 /*  modified, and distributed under the terms of the FreeType project      */
     13 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
     14 /*  this file you indicate that you have read the license and              */
     15 /*  understand and accept it fully.                                        */
     16 /*                                                                         */
     17 /***************************************************************************/
     18 
     19 
     20 #ifndef __AFGLOBAL_H__
     21 #define __AFGLOBAL_H__
     22 
     23 
     24 #include "aftypes.h"
     25 #include "afmodule.h"
     26 
     27 
     28 FT_BEGIN_HEADER
     29 
     30 
     31   /*
     32    *  Default values and flags for both autofitter globals (found in
     33    *  AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
     34    */
     35 
     36   /* index of fallback script in `af_script_classes' */
     37 #define AF_SCRIPT_FALLBACK  2
     38   /* a bit mask indicating an uncovered glyph        */
     39 #define AF_SCRIPT_NONE      0x7F
     40   /* if this flag is set, we have an ASCII digit     */
     41 #define AF_DIGIT            0x80
     42 
     43   /* `increase-x-height' property */
     44 #define AF_PROP_INCREASE_X_HEIGHT_MIN  6
     45 #define AF_PROP_INCREASE_X_HEIGHT_MAX  0
     46 
     47 
     48   /************************************************************************/
     49   /************************************************************************/
     50   /*****                                                              *****/
     51   /*****                  F A C E   G L O B A L S                     *****/
     52   /*****                                                              *****/
     53   /************************************************************************/
     54   /************************************************************************/
     55 
     56 
     57   /*
     58    *  Note that glyph_scripts[] is used to map each glyph into
     59    *  an index into the `af_script_classes' array.
     60    *
     61    */
     62   typedef struct  AF_FaceGlobalsRec_
     63   {
     64     FT_Face           face;
     65     FT_Long           glyph_count;    /* same as face->num_glyphs */
     66     FT_Byte*          glyph_scripts;
     67 
     68     /* per-face auto-hinter properties */
     69     FT_UInt           increase_x_height;
     70 
     71     AF_ScriptMetrics  metrics[AF_SCRIPT_MAX];
     72 
     73     AF_Module         module;         /* to access global properties */
     74 
     75   } AF_FaceGlobalsRec;
     76 
     77 
     78   /*
     79    *  model the global hints data for a given face, decomposed into
     80    *  script-specific items
     81    */
     82 
     83   FT_LOCAL( FT_Error )
     84   af_face_globals_new( FT_Face          face,
     85                        AF_FaceGlobals  *aglobals,
     86                        AF_Module        module );
     87 
     88   FT_LOCAL( FT_Error )
     89   af_face_globals_get_metrics( AF_FaceGlobals     globals,
     90                                FT_UInt            gindex,
     91                                FT_UInt            options,
     92                                AF_ScriptMetrics  *ametrics );
     93 
     94   FT_LOCAL( void )
     95   af_face_globals_free( AF_FaceGlobals  globals );
     96 
     97   FT_LOCAL_DEF( FT_Bool )
     98   af_face_globals_is_digit( AF_FaceGlobals  globals,
     99                             FT_UInt         gindex );
    100 
    101   /* */
    102 
    103 
    104 FT_END_HEADER
    105 
    106 #endif /* __AFGLOBAL_H__ */
    107 
    108 
    109 /* END */
    110