Home | History | Annotate | Download | only in freetype
      1 /***************************************************************************/
      2 /*                                                                         */
      3 /*  ftcffdrv.h                                                             */
      4 /*                                                                         */
      5 /*    FreeType API for controlling the CFF driver (specification only).    */
      6 /*                                                                         */
      7 /*  Copyright 2013 by                                                      */
      8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
      9 /*                                                                         */
     10 /*  This file is part of the FreeType project, and may only be used,       */
     11 /*  modified, and distributed under the terms of the FreeType project      */
     12 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
     13 /*  this file you indicate that you have read the license and              */
     14 /*  understand and accept it fully.                                        */
     15 /*                                                                         */
     16 /***************************************************************************/
     17 
     18 
     19 #ifndef __FTCFFDRV_H__
     20 #define __FTCFFDRV_H__
     21 
     22 #include "../ft2build.h"
     23 #include "freetype.h"
     24 
     25 #ifdef FREETYPE_H
     26 #error "freetype.h of FreeType 1 has been loaded!"
     27 #error "Please fix the directory search order for header files"
     28 #error "so that freetype.h of FreeType 2 is found first."
     29 #endif
     30 
     31 
     32 FT_BEGIN_HEADER
     33 
     34 
     35   /**************************************************************************
     36    *
     37    * @section:
     38    *   cff_driver
     39    *
     40    * @title:
     41    *   The CFF driver
     42    *
     43    * @abstract:
     44    *   Controlling the CFF driver module.
     45    *
     46    * @description:
     47    *   While FreeType's CFF driver doesn't expose API functions by itself,
     48    *   it is possible to control its behaviour with @FT_Property_Set and
     49    *   @FT_Property_Get.  The following lists the available properties
     50    *   together with the necessary macros and structures.
     51    *
     52    *   The CFF driver's module name is `cff'.
     53    *
     54    */
     55 
     56 
     57   /**************************************************************************
     58    *
     59    * @property:
     60    *   hinting-engine
     61    *
     62    * @description:
     63    *   Thanks to Adobe, which contributed a new hinting (and parsing)
     64    *   engine, an application can select between `freetype' and `adobe' if
     65    *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration
     66    *   macro isn't defined, `hinting-engine' does nothing.
     67    *
     68    *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is
     69    *   defined, and `adobe' otherwise.
     70    *
     71    *   The following example code demonstrates how to select Adobe's hinting
     72    *   engine (omitting the error handling).
     73    *
     74    *   {
     75    *     FT_Library  library;
     76    *     FT_Face     face;
     77    *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;
     78    *
     79    *
     80    *     FT_Init_FreeType( &library );
     81    *
     82    *     FT_Property_Set( library, "cff",
     83    *                               "hinting-engine", &hinting_engine );
     84    *   }
     85    *
     86    * @note:
     87    *   This property can be used with @FT_Property_Get also.
     88    *
     89    */
     90 
     91 
     92   /**************************************************************************
     93    *
     94    * @enum:
     95    *   FT_CFF_HINTING_XXX
     96    *
     97    * @description:
     98    *   A list of constants used for the @hinting-engine property to select
     99    *   the hinting engine for CFF fonts.
    100    *
    101    * @values:
    102    *   FT_CFF_HINTING_FREETYPE ::
    103    *     Use the old FreeType hinting engine.
    104    *
    105    *   FT_CFF_HINTING_ADOBE ::
    106    *     Use the hinting engine contributed by Adobe.
    107    *
    108    */
    109 #define FT_CFF_HINTING_FREETYPE  0
    110 #define FT_CFF_HINTING_ADOBE     1
    111 
    112 
    113   /**************************************************************************
    114    *
    115    * @property:
    116    *   no-stem-darkening
    117    *
    118    * @description:
    119    *   By default, the Adobe CFF engine darkens stems at smaller sizes,
    120    *   regardless of hinting, to enhance contrast.  Setting this property,
    121    *   stem darkening gets switched off.
    122    *
    123    *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.
    124    *
    125    *   {
    126    *     FT_Library  library;
    127    *     FT_Face     face;
    128    *     FT_Bool     no_stem_darkening = TRUE;
    129    *
    130    *
    131    *     FT_Init_FreeType( &library );
    132    *
    133    *     FT_Property_Set( library, "cff",
    134    *                               "no-stem-darkening", &no_stem_darkening );
    135    *   }
    136    *
    137    * @note:
    138    *   This property can be used with @FT_Property_Get also.
    139    *
    140    */
    141 
    142 
    143  /* */
    144 
    145 FT_END_HEADER
    146 
    147 
    148 #endif /* __FTCFFDRV_H__ */
    149 
    150 
    151 /* END */
    152