OLD | NEW |
1 /***************************************************************************/ | 1 /***************************************************************************/ |
2 /* */ | 2 /* */ |
3 /* cf2blues.c */ | 3 /* cf2blues.c */ |
4 /* */ | 4 /* */ |
5 /* Adobe's code for handling Blue Zones (body). */ | 5 /* Adobe's code for handling Blue Zones (body). */ |
6 /* */ | 6 /* */ |
7 /* Copyright 2009-2013 Adobe Systems Incorporated. */ | 7 /* Copyright 2009-2014 Adobe Systems Incorporated. */ |
8 /* */ | 8 /* */ |
9 /* This software, and all works of authorship, whether in source or */ | 9 /* This software, and all works of authorship, whether in source or */ |
10 /* object code form as indicated by the copyright notice(s) included */ | 10 /* object code form as indicated by the copyright notice(s) included */ |
11 /* herein (collectively, the "Work") is made available, and may only be */ | 11 /* herein (collectively, the "Work") is made available, and may only be */ |
12 /* used, modified, and distributed under the FreeType Project License, */ | 12 /* used, modified, and distributed under the FreeType Project License, */ |
13 /* LICENSE.TXT. Additionally, subject to the terms and conditions of the */ | 13 /* LICENSE.TXT. Additionally, subject to the terms and conditions of the */ |
14 /* FreeType Project License, each contributor to the Work hereby grants */ | 14 /* FreeType Project License, each contributor to the Work hereby grants */ |
15 /* to any individual or legal entity exercising permissions granted by */ | 15 /* to any individual or legal entity exercising permissions granted by */ |
16 /* the FreeType Project License and this section (hereafter, "You" or */ | 16 /* the FreeType Project License and this section (hereafter, "You" or */ |
17 /* "Your") a perpetual, worldwide, non-exclusive, no-charge, */ | 17 /* "Your") a perpetual, worldwide, non-exclusive, no-charge, */ |
(...skipping 12 matching lines...) Expand all Loading... |
30 /* */ | 30 /* */ |
31 /* By using, modifying, or distributing the Work you indicate that you */ | 31 /* By using, modifying, or distributing the Work you indicate that you */ |
32 /* have read and understood the terms and conditions of the */ | 32 /* have read and understood the terms and conditions of the */ |
33 /* FreeType Project License as well as those provided in this section, */ | 33 /* FreeType Project License as well as those provided in this section, */ |
34 /* and you accept them fully. */ | 34 /* and you accept them fully. */ |
35 /* */ | 35 /* */ |
36 /***************************************************************************/ | 36 /***************************************************************************/ |
37 | 37 |
38 | 38 |
39 #include "cf2ft.h" | 39 #include "cf2ft.h" |
40 #include "../../include/freetype/internal/ftdebug.h" | 40 #include FT_INTERNAL_DEBUG_H |
41 | 41 |
42 #include "cf2blues.h" | 42 #include "cf2blues.h" |
43 #include "cf2hints.h" | 43 #include "cf2hints.h" |
44 #include "cf2font.h" | 44 #include "cf2font.h" |
45 | 45 |
46 | 46 |
47 /*************************************************************************/ | 47 /*************************************************************************/ |
48 /* */ | 48 /* */ |
49 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ | 49 /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ |
50 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ | 50 /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ |
(...skipping 28 matching lines...) Expand all Loading... |
79 size_t numFamilyOtherBlues; | 79 size_t numFamilyOtherBlues; |
80 | 80 |
81 FT_Pos* blueValues; | 81 FT_Pos* blueValues; |
82 FT_Pos* otherBlues; | 82 FT_Pos* otherBlues; |
83 FT_Pos* familyBlues; | 83 FT_Pos* familyBlues; |
84 FT_Pos* familyOtherBlues; | 84 FT_Pos* familyOtherBlues; |
85 | 85 |
86 size_t i; | 86 size_t i; |
87 CF2_Fixed emBoxBottom, emBoxTop; | 87 CF2_Fixed emBoxBottom, emBoxTop; |
88 | 88 |
| 89 #if 0 |
89 CF2_Int unitsPerEm = font->unitsPerEm; | 90 CF2_Int unitsPerEm = font->unitsPerEm; |
90 | 91 |
91 | 92 |
92 if ( unitsPerEm == 0 ) | 93 if ( unitsPerEm == 0 ) |
93 unitsPerEm = 1000; | 94 unitsPerEm = 1000; |
| 95 #endif |
94 | 96 |
95 FT_ZERO( blues ); | 97 FT_ZERO( blues ); |
96 blues->scale = font->innerTransform.d; | 98 blues->scale = font->innerTransform.d; |
97 | 99 |
98 cf2_getBlueMetrics( decoder, | 100 cf2_getBlueMetrics( decoder, |
99 &blues->blueScale, | 101 &blues->blueScale, |
100 &blues->blueShift, | 102 &blues->blueShift, |
101 &blues->blueFuzz ); | 103 &blues->blueFuzz ); |
102 | 104 |
103 cf2_getBlueValues( decoder, &numBlueValues, &blueValues ); | 105 cf2_getBlueValues( decoder, &numBlueValues, &blueValues ); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 */ | 401 */ |
400 | 402 |
401 if ( blues->scale < blues->blueScale ) | 403 if ( blues->scale < blues->blueScale ) |
402 { | 404 { |
403 blues->suppressOvershoot = TRUE; | 405 blues->suppressOvershoot = TRUE; |
404 | 406 |
405 /* Change rounding threshold for `dsFlatEdge'. */ | 407 /* Change rounding threshold for `dsFlatEdge'. */ |
406 /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */ | 408 /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */ |
407 /* 10ppem Arial */ | 409 /* 10ppem Arial */ |
408 | 410 |
409 blues->boost = FT_MulFix( | 411 blues->boost = cf2_floatToFixed( .6 ) - |
410 cf2_floatToFixed( .6 ), | 412 FT_MulDiv( cf2_floatToFixed ( .6 ), |
411 ( cf2_intToFixed( 1 ) - | 413 blues->scale, |
412 FT_DivFix( blues->scale, | 414 blues->blueScale ); |
413 blues->blueScale ) ) ); | |
414 if ( blues->boost > 0x7FFF ) | 415 if ( blues->boost > 0x7FFF ) |
415 { | 416 { |
416 /* boost must remain less than 0.5, or baseline could go negative */ | 417 /* boost must remain less than 0.5, or baseline could go negative */ |
417 blues->boost = 0x7FFF; | 418 blues->boost = 0x7FFF; |
418 } | 419 } |
419 } | 420 } |
420 | 421 |
421 /* boost and darkening have similar effects; don't do both */ | 422 /* boost and darkening have similar effects; don't do both */ |
422 if ( font->stemDarkened ) | 423 if ( font->stemDarkened ) |
423 blues->boost = 0; | 424 blues->boost = 0; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 topHintEdge->dsCoord += dsMove; | 570 topHintEdge->dsCoord += dsMove; |
570 cf2_hint_lock( topHintEdge ); | 571 cf2_hint_lock( topHintEdge ); |
571 } | 572 } |
572 } | 573 } |
573 | 574 |
574 return captured; | 575 return captured; |
575 } | 576 } |
576 | 577 |
577 | 578 |
578 /* END */ | 579 /* END */ |
OLD | NEW |