[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Stem darkening of new CFF engine
From: |
octoploid |
Subject: |
[ft-devel] Stem darkening of new CFF engine |
Date: |
Thu, 20 Jun 2013 17:50:26 +0200 |
On my system the stem darkening of the new CFF engine
is too aggressive. Normal weight fonts look almost bold
when it is enabled.
Currently I use the following hack:
diff --git a/src/cff/cf2font.c b/src/cff/cf2font.c
index 479d912..f2157a7 100644
--- a/src/cff/cf2font.c
+++ b/src/cff/cf2font.c
@@ -108,18 +108,18 @@
*
*/
if ( scaledStem < cf2_intToFixed( 500 ) )
- *darkenAmount = FT_DivFix( cf2_intToFixed( 400 ), ppem );
+ *darkenAmount = FT_DivFix( cf2_intToFixed( 300 ), ppem );
else if ( scaledStem < cf2_intToFixed( 1000 ) )
- *darkenAmount = FT_DivFix( cf2_intToFixed( 525 ), ppem ) -
+ *darkenAmount = FT_DivFix( cf2_intToFixed( 425 ), ppem ) -
FT_MulFix( stemWidthPer1000,
cf2_floatToFixed( .25 ) );
else if ( scaledStem < cf2_intToFixed( 1667 ) )
- *darkenAmount = FT_DivFix( cf2_intToFixed( 275 ), ppem );
+ *darkenAmount = FT_DivFix( cf2_intToFixed( 175 ), ppem );
else if ( scaledStem < cf2_intToFixed( 2333 ) )
- *darkenAmount = FT_DivFix( cf2_intToFixed( 963 ), ppem ) -
+ *darkenAmount = FT_DivFix( cf2_intToFixed( 863 ), ppem ) -
FT_MulFix( stemWidthPer1000,
cf2_floatToFixed( .413 ) );
and the results look much more pleasing.
Wouldn't it be a good idea to make the amount of darkening user
configurable? (Maybe by specifying a number from 0..10 at compile
time (0=no darkening ... 10=full darkening))
- [ft-devel] Stem darkening of new CFF engine,
octoploid <=