[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] discrepancy in underline offset
From: |
Werner LEMBERG |
Subject: |
Re: [ft-devel] discrepancy in underline offset |
Date: |
Fri, 22 Jun 2007 22:55:18 +0200 (CEST) |
> So, to sum up: the first definition refers to the centre of the
> stroke; the second to the top edge.
Thanks for your analysis.
> Thus (depending on whether there are other discrepancies that I have
> not had time to search for) we ought to either change the definition
> of FT_FaceRec_::underline_position, or change the code in sfobjs.c.
>
> I would favour the first course of action; it is easier (for me, in
> my code - this is a personal view) to draw the rectangle for an
> underline using its top edge as a reference point, and feels more
> natural. But that may contradict long-standing policy, depending on
> what users have done with this code. It changes the API, but only if
> that API has been read, understood and acted upon correctly. That
> cannot be the case for TrueType fonts because it produces incorrect
> results: the underline is too far up and touches the baseline at
> small sizes.
>
> But if we choose the second course of action the patch is this:
> change line 890 of sfobjs.c to:
>
> root->underline_position =
> (FT_Short)(face->postscript.underlinePosition -
> (face->postscript.underlineThickness / 2));
>
> I have tested it and it does the job.
I have no opinion here. Both changes are fine for me (however, we
would need some documentation patches for the first case). David?
Werner