diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 22:20:25 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-18 22:20:25 -0700 |
commit | 0a9d06e2b5cf75c3d6ba958026bfdf4745f576d6 (patch) | |
tree | bda73f0de3896a97ff4231e4600fccd89a3f9118 /src/autofit | |
parent | 049d6fea481044fcc000e7782e5bc7046fc70844 (diff) | |
download | android_external_freetype-0a9d06e2b5cf75c3d6ba958026bfdf4745f576d6.tar.gz android_external_freetype-0a9d06e2b5cf75c3d6ba958026bfdf4745f576d6.tar.bz2 android_external_freetype-0a9d06e2b5cf75c3d6ba958026bfdf4745f576d6.zip |
auto import //branches/master/...@140412
Diffstat (limited to 'src/autofit')
-rw-r--r-- | src/autofit/afcjk.c | 59 | ||||
-rw-r--r-- | src/autofit/afhints.c | 8 | ||||
-rw-r--r-- | src/autofit/aflatin.c | 55 | ||||
-rw-r--r-- | src/autofit/aflatin2.c | 10 | ||||
-rw-r--r-- | src/autofit/aftypes.h | 7 |
5 files changed, 80 insertions, 59 deletions
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c index 7e9438b..de3ce11 100644 --- a/src/autofit/afcjk.c +++ b/src/autofit/afcjk.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (body). */ /* */ -/* Copyright 2006, 2007 by */ +/* Copyright 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1253,10 +1253,15 @@ else if ( after >= edge_limit ) af_cjk_align_serif_edge( hints, before, edge ); else - edge->pos = before->pos + - FT_MulDiv( edge->fpos - before->fpos, - after->pos - before->pos, - after->fpos - before->fpos ); + { + if ( after->fpos == before->fpos ) + edge->pos = before->pos; + else + edge->pos = before->pos + + FT_MulDiv( edge->fpos - before->fpos, + after->pos - before->pos, + after->fpos - before->fpos ); + } } } } @@ -1436,29 +1441,29 @@ static const AF_Script_UniRangeRec af_cjk_uniranges[] = { #if 0 - { 0x0100, 0xFFFF }, /* why this? */ + { 0x0100UL, 0xFFFFUL }, /* why this? */ #endif - { 0x2E80, 0x2EFF }, /* CJK Radicals Supplement */ - { 0x2F00, 0x2FDF }, /* Kangxi Radicals */ - { 0x3000, 0x303F }, /* CJK Symbols and Punctuation */ - { 0x3040, 0x309F }, /* Hiragana */ - { 0x30A0, 0x30FF }, /* Katakana */ - { 0x3100, 0x312F }, /* Bopomofo */ - { 0x3130, 0x318F }, /* Hangul Compatibility Jamo */ - { 0x31A0, 0x31BF }, /* Bopomofo Extended */ - { 0x31C0, 0x31EF }, /* CJK Strokes */ - { 0x31F0, 0x31FF }, /* Katakana Phonetic Extensions */ - { 0x3200, 0x32FF }, /* Enclosed CJK Letters and Months */ - { 0x3300, 0x33FF }, /* CJK Compatibility */ - { 0x3400, 0x4DBF }, /* CJK Unified Ideographs Extension A */ - { 0x4DC0, 0x4DFF }, /* Yijing Hexagram Symbols */ - { 0x4E00, 0x9FFF }, /* CJK Unified Ideographs */ - { 0xF900, 0xFAFF }, /* CJK Compatibility Ideographs */ - { 0xFE30, 0xFE4F }, /* CJK Compatibility Forms */ - { 0xFF00, 0xFFEF }, /* Halfwidth and Fullwidth Forms */ - { 0x20000, 0x2A6DF }, /* CJK Unified Ideographs Extension B */ - { 0x2F800, 0x2FA1F }, /* CJK Compatibility Ideographs Supplement */ - { 0, 0 } + { 0x2E80UL, 0x2EFFUL }, /* CJK Radicals Supplement */ + { 0x2F00UL, 0x2FDFUL }, /* Kangxi Radicals */ + { 0x3000UL, 0x303FUL }, /* CJK Symbols and Punctuation */ + { 0x3040UL, 0x309FUL }, /* Hiragana */ + { 0x30A0UL, 0x30FFUL }, /* Katakana */ + { 0x3100UL, 0x312FUL }, /* Bopomofo */ + { 0x3130UL, 0x318FUL }, /* Hangul Compatibility Jamo */ + { 0x31A0UL, 0x31BFUL }, /* Bopomofo Extended */ + { 0x31C0UL, 0x31EFUL }, /* CJK Strokes */ + { 0x31F0UL, 0x31FFUL }, /* Katakana Phonetic Extensions */ + { 0x3200UL, 0x32FFUL }, /* Enclosed CJK Letters and Months */ + { 0x3300UL, 0x33FFUL }, /* CJK Compatibility */ + { 0x3400UL, 0x4DBFUL }, /* CJK Unified Ideographs Extension A */ + { 0x4DC0UL, 0x4DFFUL }, /* Yijing Hexagram Symbols */ + { 0x4E00UL, 0x9FFFUL }, /* CJK Unified Ideographs */ + { 0xF900UL, 0xFAFFUL }, /* CJK Compatibility Ideographs */ + { 0xFE30UL, 0xFE4FUL }, /* CJK Compatibility Forms */ + { 0xFF00UL, 0xFFEFUL }, /* Halfwidth and Fullwidth Forms */ + { 0x20000UL, 0x2A6DFUL }, /* CJK Unified Ideographs Extension B */ + { 0x2F800UL, 0x2FA1FUL }, /* CJK Compatibility Ideographs Supplement */ + { 0UL, 0UL } }; diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c index 4828706..8ab1761 100644 --- a/src/autofit/afhints.c +++ b/src/autofit/afhints.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -127,7 +127,7 @@ #ifdef AF_DEBUG -#include <stdio.h> +#include FT_CONFIG_STANDARD_LIBRARY_H static const char* af_dir_str( AF_Direction dir ) @@ -203,14 +203,14 @@ if ( flags & AF_EDGE_ROUND ) { - memcpy( temp + pos, "round", 5 ); + ft_memcpy( temp + pos, "round", 5 ); pos += 5; } if ( flags & AF_EDGE_SERIF ) { if ( pos > 0 ) temp[pos++] = ' '; - memcpy( temp + pos, "serif", 5 ); + ft_memcpy( temp + pos, "serif", 5 ); pos += 5; } if ( pos == 0 ) diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c index b70da06..ba59e5b 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, 2004, 2005, 2006, 2007 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -2008,7 +2008,10 @@ if ( before >= edges && before < edge && after < edge_limit && after > edge ) { - edge->pos = before->pos + + if ( after->opos == before->opos ) + edge->pos = before->pos; + else + edge->pos = before->pos + FT_MulDiv( edge->opos - before->opos, after->pos - before->pos, after->opos - before->opos ); @@ -2124,27 +2127,33 @@ static const AF_Script_UniRangeRec af_latin_uniranges[] = { - { 0x0020, 0x007F }, /* Basic Latin (no control characters) */ - { 0x00A0, 0x00FF }, /* Latin-1 Supplement (no control characters) */ - { 0x0100, 0x017F }, /* Latin Extended-A */ - { 0x0180, 0x024F }, /* Latin Extended-B */ - { 0x0250, 0x02AF }, /* IPA Extensions */ - { 0x02B0, 0x02FF }, /* Spacing Modifier Letters */ - { 0x0300, 0x036F }, /* Combining Diacritical Marks */ - { 0x0370, 0x03FF }, /* Greek and Coptic */ - { 0x0400, 0x04FF }, /* Cyrillic */ - { 0x0500, 0x052F }, /* Cyrillic Supplement */ - { 0x1D00, 0x1D7F }, /* Phonetic Extensions */ - { 0x1D80, 0x1DBF }, /* Phonetic Extensions Supplement */ - { 0x1DC0, 0x1DFF }, /* Combining Diacritical Marks Supplement */ - { 0x1E00, 0x1EFF }, /* Latin Extended Additional */ - { 0x1F00, 0x1FFF }, /* Greek Extended */ - { 0x2000, 0x206F }, /* General Punctuation */ - { 0x2070, 0x209F }, /* Superscripts and Subscripts */ - { 0x20A0, 0x20CF }, /* Currency Symbols */ - { 0x2150, 0x218F }, /* Number Forms */ - { 0x2460, 0x24FF }, /* Enclosed Alphanumerics */ - { 0 , 0 } + { 0x0020 , 0x007F }, /* Basic Latin (no control chars) */ + { 0x00A0 , 0x00FF }, /* Latin-1 Supplement (no control chars) */ + { 0x0100 , 0x017F }, /* Latin Extended-A */ + { 0x0180 , 0x024F }, /* Latin Extended-B */ + { 0x0250 , 0x02AF }, /* IPA Extensions */ + { 0x02B0 , 0x02FF }, /* Spacing Modifier Letters */ + { 0x0300 , 0x036F }, /* Combining Diacritical Marks */ + { 0x0370 , 0x03FF }, /* Greek and Coptic */ + { 0x0400 , 0x04FF }, /* Cyrillic */ + { 0x0500 , 0x052F }, /* Cyrillic Supplement */ + { 0x1D00 , 0x1D7F }, /* Phonetic Extensions */ + { 0x1D80 , 0x1DBF }, /* Phonetic Extensions Supplement */ + { 0x1DC0 , 0x1DFF }, /* Combining Diacritical Marks Supplement */ + { 0x1E00 , 0x1EFF }, /* Latin Extended Additional */ + { 0x1F00 , 0x1FFF }, /* Greek Extended */ + { 0x2000 , 0x206F }, /* General Punctuation */ + { 0x2070 , 0x209F }, /* Superscripts and Subscripts */ + { 0x20A0 , 0x20CF }, /* Currency Symbols */ + { 0x2150 , 0x218F }, /* Number Forms */ + { 0x2460 , 0x24FF }, /* Enclosed Alphanumerics */ + { 0x2C60 , 0x2C7F }, /* Latin Extended-C */ + { 0x2DE0 , 0x2DFF }, /* Cyrillic Extended-A */ + { 0xA640U , 0xA69FU }, /* Cyrillic Extended-B */ + { 0xA720U , 0xA7FFU }, /* Latin Extended-D */ + { 0xFB00U , 0xFB06U }, /* Alphab. Present. Forms (Latin Ligs) */ + { 0x1D400UL, 0x1D7FFUL }, /* Mathematical Alphanumeric Symbols */ + { 0 , 0 } }; diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c index 0b41774..14327b1 100644 --- a/src/autofit/aflatin2.c +++ b/src/autofit/aflatin2.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (body). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -944,6 +944,9 @@ } } } +#if 0 + } +#endif /* now, compute the `serif' segments */ for ( seg1 = segments; seg1 < segment_limit; seg1++ ) @@ -2150,7 +2153,10 @@ if ( before >= edges && before < edge && after < edge_limit && after > edge ) { - edge->pos = before->pos + + if ( after->opos == before->opos ) + edge->pos = before->pos; + else + edge->pos = before->pos + FT_MulDiv( edge->opos - before->opos, after->pos - before->pos, after->opos - before->opos ); diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h index 56811f0..626a388 100644 --- a/src/autofit/aftypes.h +++ b/src/autofit/aftypes.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter types (specification only). */ /* */ -/* Copyright 2003, 2004, 2005, 2006, 2007, 2008 by */ +/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,7 +58,8 @@ FT_BEGIN_HEADER #ifdef AF_DEBUG -#include <stdio.h> +#include FT_CONFIG_STANDARD_LIBRARY_H + #define AF_LOG( x ) do { if ( _af_debug ) printf x; } while ( 0 ) extern int _af_debug; @@ -69,7 +70,7 @@ extern void* _af_debug_hints; #else /* !AF_DEBUG */ -#define AF_LOG( x ) do ; while ( 0 ) /* nothing */ +#define AF_LOG( x ) do { } while ( 0 ) /* nothing */ #endif /* !AF_DEBUG */ |