< prev index next >

src/java.desktop/share/native/libfreetype/src/base/ftpsprop.c

Print this page


   1 /****************************************************************************
   2  *
   3  * ftpsprop.c
   4  *
   5  *   Get and set properties of PostScript drivers (body).
   6  *   See `ftdriver.h' for available properties.
   7  *
   8  * Copyright (C) 2017-2019 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 #include <ft2build.h>
  21 #include FT_DRIVER_H
  22 #include FT_INTERNAL_DEBUG_H
  23 #include FT_INTERNAL_POSTSCRIPT_AUX_H
  24 #include FT_INTERNAL_OBJECTS_H
  25 #include FT_INTERNAL_POSTSCRIPT_PROPS_H
  26 
  27 
  28   /**************************************************************************


 148       else
 149 #endif /* FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES */
 150       {
 151         FT_UInt*  hinting_engine = (FT_UInt*)value;
 152 
 153 
 154         if ( *hinting_engine == FT_HINTING_ADOBE
 155 #ifdef CFF_CONFIG_OPTION_OLD_ENGINE
 156              || ( *hinting_engine == FT_HINTING_FREETYPE &&
 157                   !ft_strcmp( module_name, "cff" )       )
 158 #endif
 159 #ifdef T1_CONFIG_OPTION_OLD_ENGINE
 160              || ( *hinting_engine == FT_HINTING_FREETYPE &&
 161                   ( !ft_strcmp( module_name, "type1" ) ||
 162                     !ft_strcmp( module_name, "t1cid" ) ) )
 163 #endif
 164            )
 165           driver->hinting_engine = *hinting_engine;
 166         else
 167           error = FT_ERR( Unimplemented_Feature );

 168 
 169         return error;
 170       }
 171     }
 172 
 173     else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
 174     {
 175 #ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
 176       if ( value_is_string )
 177       {
 178         const char*  s   = (const char*)value;
 179         long         nsd = ft_strtol( s, NULL, 10 );
 180 
 181 
 182         if ( !nsd )
 183           driver->no_stem_darkening = FALSE;
 184         else
 185           driver->no_stem_darkening = TRUE;
 186       }
 187       else
 188 #endif
 189       {
 190         FT_Bool*  no_stem_darkening = (FT_Bool*)value;


   1 /****************************************************************************
   2  *
   3  * ftpsprop.c
   4  *
   5  *   Get and set properties of PostScript drivers (body).
   6  *   See `ftdriver.h' for available properties.
   7  *
   8  * Copyright (C) 2017-2020 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 #include <ft2build.h>
  21 #include FT_DRIVER_H
  22 #include FT_INTERNAL_DEBUG_H
  23 #include FT_INTERNAL_POSTSCRIPT_AUX_H
  24 #include FT_INTERNAL_OBJECTS_H
  25 #include FT_INTERNAL_POSTSCRIPT_PROPS_H
  26 
  27 
  28   /**************************************************************************


 148       else
 149 #endif /* FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES */
 150       {
 151         FT_UInt*  hinting_engine = (FT_UInt*)value;
 152 
 153 
 154         if ( *hinting_engine == FT_HINTING_ADOBE
 155 #ifdef CFF_CONFIG_OPTION_OLD_ENGINE
 156              || ( *hinting_engine == FT_HINTING_FREETYPE &&
 157                   !ft_strcmp( module_name, "cff" )       )
 158 #endif
 159 #ifdef T1_CONFIG_OPTION_OLD_ENGINE
 160              || ( *hinting_engine == FT_HINTING_FREETYPE &&
 161                   ( !ft_strcmp( module_name, "type1" ) ||
 162                     !ft_strcmp( module_name, "t1cid" ) ) )
 163 #endif
 164            )
 165           driver->hinting_engine = *hinting_engine;
 166         else
 167           error = FT_ERR( Unimplemented_Feature );
 168       }
 169 
 170       return error;

 171     }
 172 
 173     else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
 174     {
 175 #ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
 176       if ( value_is_string )
 177       {
 178         const char*  s   = (const char*)value;
 179         long         nsd = ft_strtol( s, NULL, 10 );
 180 
 181 
 182         if ( !nsd )
 183           driver->no_stem_darkening = FALSE;
 184         else
 185           driver->no_stem_darkening = TRUE;
 186       }
 187       else
 188 #endif
 189       {
 190         FT_Bool*  no_stem_darkening = (FT_Bool*)value;


< prev index next >