On 13-01-10 03:03 PM, Alexei Podtelezhnikov wrote:
> On Thu, Jan 10, 2013 at 1:38 PM, Behdad Esfahbod <beh...@behdad.org> wrote:
>> Hi,
>>
>> There's a bug against Webkit:
>>
>>   https://bugs.webkit.org/show_bug.cgi?id=102374
>>
>> that I think points to a problem in FreeType.  Simply put: for fonts that 
>> have
>> ascent+descent=line-height, this property may not hold anymore after hinting.
>>  ascent+descent may be off by one pixel compared to line-height, which is not
>> quite desirable.
> 
> If I understand correctly that equality is broken only in the broken
> fonts.

Really?  I thought it happens because FreeType separately rounds ascent,
descent, and line_height.  From the bug:

#ifdef GRID_FIT_METRICS
    metrics->ascender    = FT_PIX_CEIL( FT_MulFix( face->ascender,
                                                   metrics->y_scale ) );

    metrics->descender   = FT_PIX_FLOOR( FT_MulFix( face->descender,
                                                    metrics->y_scale ) );

    metrics->height      = FT_PIX_ROUND( FT_MulFix( face->height,
                                                    metrics->y_scale ) );

    metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width,
                                                    metrics->x_scale ) );
#else /* !GRID_FIT_METRICS */


> So have you tried just forcing it?
> 
> metrics->height      = metrics->ascender + metrics->descender;
> 
> If the height is more trustworthy, force the ascender:
> 
> metrics->ascender  = metrics->height + metrics->descender;

Webkit did end up working around it.  I was being a good citizen and bringing
up the issue upstream.

-- 
behdad
http://behdad.org/

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

Reply via email to