[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Auto Embolding of Lohit Devanagari
From: |
Alexei Podtelezhnikov |
Subject: |
Re: [ft-devel] Auto Embolding of Lohit Devanagari |
Date: |
Sun, 11 Mar 2012 21:22:03 -0400 |
On Wed, Feb 29, 2012 at 10:00 AM, Alexei Podtelezhnikov
<address@hidden> wrote:
> On Fri, Feb 24, 2012 at 9:54 PM, suzuki toshiya
> <address@hidden> wrote:
>> I think there are 2 issues in auto-embolden Lohit Devanagari;
>> a) disconnection of horizontal strokes (which should be connected with
>> previous/next glyph)
>
> On line 357 in ftview.c, I think it is incorrect to double the
> strength before it is added to the advance on line 376. To confirm
> this I looked at the lines 895 and 959 in ftoutln.c. Indeed, each
> outline point is moved by half the strength of emboldening resulting
> in a total increase of the width by the strength value. So it easy to
> fix in ftview.c on line 357, but much harder to propagate this sacred
> knowledge to the higher level libraries.
I also think that emboldening should not touch bearing values.
The screenshots from ftview are attached. Here is the proposed patch.
diff --git a/src/ftview.c b/src/ftview.c
index 2cca5b0..ea4b4ca 100644
--- a/src/ftview.c
+++ b/src/ftview.c
@@ -354,7 +354,6 @@
error = FT_Outline_Embolden( &slot->outline, xstr );
/* ignore error */
- xstr = xstr * 2;
ystr = xstr;
}
else if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
@@ -380,10 +379,7 @@
slot->metrics.width += xstr;
slot->metrics.height += ystr;
- slot->metrics.horiBearingY += ystr;
slot->metrics.horiAdvance += xstr;
- slot->metrics.vertBearingX -= xstr / 2;
- slot->metrics.vertBearingY += ystr;
slot->metrics.vertAdvance += ystr;
if ( slot->format == FT_GLYPH_FORMAT_BITMAP )
emboldened.png
Description: PNG image
emboldened1.png
Description: PNG image
- Re: [ft-devel] Auto Embolding of Lohit Devanagari,
Alexei Podtelezhnikov <=