diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/autofit/aflatin.c | 19 | ||||
-rw-r--r-- | src/base/ftautoh.c | 84 | ||||
-rw-r--r-- | src/base/ftobjs.c | 4 |
3 files changed, 103 insertions, 4 deletions
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index 30145a2b7..5853d9ec4 100644 --- a/src/autofit/aflatin.c +++ b/src/autofit/aflatin.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003-2011 by */ +/* Copyright 2003-2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,6 +18,7 @@ #include <ft2build.h> #include FT_ADVANCES_H +#include FT_AUTOHINTER_H #include FT_INTERNAL_DEBUG_H #include "aflatin.h" @@ -569,10 +570,22 @@ if ( blue ) { - FT_Pos scaled = FT_MulFix( blue->shoot.org, scaler->y_scale ); - FT_Pos fitted = ( scaled + 40 ) & ~63; + FT_Pos scaled; + FT_Pos threshold; + FT_Pos fitted; + scaled = FT_MulFix( blue->shoot.org, scaler->y_scale ); + + threshold = 40; + if ( ( metrics->root.scaler.face->internal->auto_hinter_flags & + FT_AUTOHINTER_INCREASE_GLYPH_HEIGHTS ) && + metrics->root.scaler.face->size->metrics.x_ppem < 15 && + metrics->root.scaler.face->size->metrics.x_ppem > 5 ) + threshold = 52; + + fitted = ( scaled + threshold ) & ~63; + if ( scaled != fitted ) { #if 0 diff --git a/src/base/ftautoh.c b/src/base/ftautoh.c new file mode 100644 index 000000000..b704abefa --- /dev/null +++ b/src/base/ftautoh.c @@ -0,0 +1,84 @@ +/***************************************************************************/ +/* */ +/* ftautoh.c */ +/* */ +/* FreeType API for setting and accessing auto-hinter properties */ +/* (body). */ +/* */ +/* Copyright 2012 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H + + + /* documentation is in ftautoh.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Library_GetAutohinterProperties( FT_Library library, + FT_Int32 *properties ) + { + if ( !library || !properties ) + return FT_Err_Invalid_Argument; + + *properties = library->auto_hinter_flags; + + return FT_Err_Ok; + } + + + /* documentation is in ftautoh.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Library_SetAutohinterProperties( FT_Library face, + FT_Int32 properties ) + { + if ( !library ) + return FT_Err_Invalid_Argument; + + library->auto_hinter_flags = properties; + + return FT_Err_Ok; + } + + + /* documentation is in ftautoh.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Face_GetAutohinterProperties( FT_Face face, + FT_Int32 *properties ) + { + if ( !face || !properties ) + return FT_Err_Invalid_Argument; + + *properties = face->internal->auto_hinter_flags; + + return FT_Err_Ok; + } + + + /* documentation is in ftautoh.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Face_SetAutohinterProperties( FT_Face face, + FT_Int32 properties ) + { + if ( !face ) + return FT_Err_Invalid_Argument; + + face->internal->auto_hinter_flags = properties; + + return FT_Err_Ok; + } + + +/* END */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index b776a951b..00c945551 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (body). */ /* */ -/* Copyright 1996-2011 by */ +/* Copyright 1996-2012 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -2222,6 +2222,8 @@ internal->transform_delta.x = 0; internal->transform_delta.y = 0; + internal->auto_hinter_flags = library->auto_hinter_flags; + internal->refcount = 1; } |