[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] helvetica narrow metrics
From: |
Werner LEMBERG |
Subject: |
Re: [Devel] helvetica narrow metrics |
Date: |
Tue, 05 Aug 2003 15:30:56 +0200 (CEST) |
> I have a strange problem with the helvetica narrow font
> (HVN_____.PFB). When a find the character widths for this font, the
> values I get back are too large ... in fact they are identical to
> normal helvetica (HV______.PFB). This is quite a serious issue
> because this means my wordwrap and right-justification calculations
> are all wrong (postscript calculates the widths correctly ...
> i.e. differently than freetype).
It seems that the advance width isn't scaled at all. Please test the
patch below whether there are unwanted side effects.
Similar code should go to the CID and CFF drivers.
Werner
======================================================================
--- t1gload.c.old Wed Jun 4 21:39:53 2003
+++ t1gload.c Tue Aug 5 15:18:55 2003
@@ -304,6 +304,7 @@
{
FT_BBox cbox;
FT_Glyph_Metrics* metrics = &glyph->root.metrics;
+ FT_Vector advance;
/* copy the _unscaled_ advance width */
@@ -330,6 +331,14 @@
FT_Outline_Translate( &glyph->root.outline,
font_offset.x,
font_offset.y );
+
+ advance.x = metrics->horiAdvance;
+ advance.y = metrics->vertAdvance;
+ FT_Vector_Transform( &advance, &font_matrix );
+ advance.x += font_offset.x;
+ advance.y += font_offset.y;
+ metrics->horiAdvance = advance.x;
+ metrics->vertAdvance = advance.y;
#endif
if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
- Re: [Devel] helvetica narrow metrics,
Werner LEMBERG <=