freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] heads-up: TrueType height computation has been fixed


From: David Turner
Subject: Re: [ft-devel] heads-up: TrueType height computation has been fixed
Date: Wed, 23 Jan 2013 17:10:20 +0100



2013/1/23 Werner LEMBERG <address@hidden>

Folks,


just a heads-up which might influence applications: I've just fixed a
bug in the TrueType handler to correctly compute the `height' value of
the `FT_Face' structure.  Up to now, the following was done:

  ascender_int = round(ascender_26.6);
  descender_int = round(descender_26.6);
  height_int = round(height_26.6);

This has been replaced with

  ascender_int = round(ascender_26.6);
  descender_int = round(descender_26.6);
  height_int = ascender_int - descender_int;


This seems to assume that height_26.6 was always ascender_26.6 + - descender_26.6. I'm not sure this is always true. IIRC, there are fonts where the line height is actually different from ascender - descender, they would be affected by this patch in surprising ways.

Unless I'm missing something (which is entirely possible, and I've not looked at the patch details yet).

If that so, maybe add some code to deal with this, e.g.:

  if (height_26.6 == ascender_26.6 - descender_26.6) {
    height_int = ascender_int - descender_int;
  } else {
    // something else, to be defined :-)
  }

 
to be in sync with Windows.

I wonder whether we should do the same for non-TrueType fonts.  I think
yes, but please comment!


    Werner

_______________________________________________
Freetype-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/freetype-devel


reply via email to

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