freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] new CFF engine


From: octoploid
Subject: Re: [ft-devel] new CFF engine
Date: Sun, 12 May 2013 16:34:01 +0200


12.05.2013, 15:52, "Vernon Adams" <address@hidden>:
> I have been testing the new adobe-Freetype CFF engine, and was wondering if 
> the default 'darkness' of stem darkening is a little too high?
> How does the width of stems in a font effect the amount of darkness rendered? 
> I think someone mentioned that thinner stems will render with relatively more 
> darkness than thicker stems? Is that correct? Or is the amount of darkness a 
> uniform value across all rendered fonts?

You should read src/cff/cf2font.c:
 95       /*
 96        * Total darkening amount is computed in 1000 unit character space
 97        * using the modified 5 part curve as Avalon rasterizer.
 98        * The darkening amount is smaller for thicker stems.
 99        * It becomes zero when the stem is thicker than 2.333 pixels.
100        *
101        * In Avalon rasterizer,
102        *
103        *   darkenAmount = 0.5 pixels   if scaledStem <= 0.5 pixels,
104        *   darkenAmount = 0.333 pixels if 1 <= scaledStem <= 1.667 pixels,
105        *   darkenAmount = 0 pixel      if scaledStem >= 2.333 pixels,
106        *
107        * and piecewise linear in-between.
108        *
109        */
110       if ( scaledStem < cf2_intToFixed( 500 ) )
111         *darkenAmount = FT_DivFix( cf2_intToFixed( 400 ), ppem );
112
113       else if ( scaledStem < cf2_intToFixed( 1000 ) )
114         *darkenAmount = FT_DivFix( cf2_intToFixed( 525 ), ppem ) -
115                           FT_MulFix( stemWidthPer1000,
116                                      cf2_floatToFixed( .25 ) );
117
118       else if ( scaledStem < cf2_intToFixed( 1667 ) )
119         *darkenAmount = FT_DivFix( cf2_intToFixed( 275 ), ppem );
120
121       else if ( scaledStem < cf2_intToFixed( 2333 ) )
122         *darkenAmount = FT_DivFix( cf2_intToFixed( 963 ), ppem ) -
123                           FT_MulFix( stemWidthPer1000,
124                                      cf2_floatToFixed( .413 ) );



reply via email to

[Prev in Thread] Current Thread [Next in Thread]