freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] another face->postscript.isFixedPitch :-(


From: Werner LEMBERG
Subject: Re: [Devel] another face->postscript.isFixedPitch :-(
Date: Wed, 04 Jun 2003 18:51:07 +0200 (CEST)

Anthony,


a longer time ago you've suggested the following:

> Please let me know what you think of the attached patch to deal with
> the halfwidth CJK fixedPitch font issue.  [...]
>
> Note that I have made some minor change to the patch, namely
> increasing the threshold from 50% (">> 1") to 52% (* 0.52) because I
> encountered a DynaComWare (DynaLab) Chinese font in which the global
> advance width is 1000, but the ASCII characters have widths of 512.
> Probably these glyphs were copied from another font with global
> advance width of 1024, but DynaComWare forgot to change their widths
> to 500 to fit the new font?  Dunno.  :-) But yes, this will solve
> the
>
>   s p a c e d - o u t   c h a r a c t e r   p r o b l e m .   : - )
>
> Please let me know whether this patch is good for going into CVS.  :-)
>
> [...]
>
> --- freetype-2.1.3~/src/truetype/ttgload.c    Mon Sep 16 17:22:03 2002
> +++ freetype-2.1.3/src/truetype/ttgload.c     Thu Nov 21 00:17:02 2002
> @@ -129,7 +129,12 @@
>      TT_Get_Metrics( &face->horizontal, idx, lsb, aw );
>
>      if ( check && face->postscript.isFixedPitch )
> -      *aw = face->horizontal.advance_Width_Max;
> +    {
> +      if ( *aw > face->horizontal.advance_Width_Max * 0.52 || *aw == 0 )
> +     *aw = face->horizontal.advance_Width_Max;
> +      else
> +     *aw = face->horizontal.advance_Width_Max >> 1;
> +    }
>    }

Jungshik made a different proposal (which you've certainly read on
this list), namely to do some heuristic guesses whether the
isFixedPitch flag is correctly set.  I really don't know which
solution should be favoured.  It seems to me that the problem occurs
with TrueType fonts only, but of course Jungshik's algorithm is
universal and can be used with any font format.

Another possibility is to add a new API function which simply changes
the isFixedPitch flag to a user-defined value so that an application
can take care of it.


    Werner



reply via email to

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