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

Bug#880407: #880407 xterm: font issue with FreeType 2.8; should not use the rounded ascender and descender



On Fri, Jan 05, 2018 at 10:26:11AM +0100, Vincent Lefevre wrote:
> On 2018-01-05 04:13:56 -0500, Thomas Dickey wrote:
> > ----- Original Message -----
> > | On 2018-01-05 03:59:42 -0500, Thomas Dickey wrote:
> > | > Then you should provide more information allowing this to be
> > | > reproduced.
> > | 
> > | I can reproduce this with the default config and:
> > | 
> > |   xterm -fa Monospace -fs 10 -xrm "Xft.dpi: 132"
> > | 
> > | (the "Xft.dpi: 132" is important).
> > 
> > I did that (and other values of ".dpi") without seeing any other effect than
> > the one for which I made a workaround: detecting the improper rounding and
> > forcing xterm's internal line-drawing in that case.  The line-drawing glyphs
> > were effectively shorter than some of the other characters.
> 
> Sorry, I don't understand what you mean. Can you reproduce the problem
> with that?

only for the case that I made xterm detect/workaround.

I added debug-tracing in fontutils.c to show the actual data for the
FT_Size_Metrics, as well as loading the glyph to see the pixels.
It wasn't a "black" line but rather two raster lines with low values.

The rounding change altered the weights from about 12/16 down to 8/16
or 9/16.

I added logic to add the weights and turn on xterm's line-drawing when
it fell below the threshold.

(The trace adds a lot of data; I'd turn it on by the configure with
--enable-trace, as well as editing fontutil.c to define OPT_TRACE as 2, and
defining DEBUG_XFT).

I ran that against all of the fonts from fc-list (several hundred...), found
some unrelated issues (lack of error-checking in FT_Load_Char, requiring yet
another workaround), but no more than that.

In tracing the FT_Size_Metrics, I found no font metrics which Xft could have
repaired:  all of the damage was done by the change to FreeType2.

In particular, tracing the sizes as floating point, none of the values
had nonzero fractional parts.  As far as I can see, Xft simply gets
the result from FreeType2, which has already been rounded.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


Reply to: