Pango fractional positioning results in "off" proportional fonts

21 views
Skip to first unread message

Mitchell

unread,
Jul 25, 2022, 11:29:48 AM7/25/22
to scintilla...@googlegroups.com
Hi Neil,

Sorry for the really late report. I had initially blamed my experience on a series of Ubuntu updates, but I have gone back with `hg bisect` and discovered that this change introduced in 5.2.0:

https://sourceforge.net/p/scintilla/code/ci/c692633b18bff53ea43e0f0a81cf56b6ebc83836

causes proportional (not monospaced) fonts to be "off". Line width increases as the number of characters increases compared to prior behavior.

See attached image. The top line is prior to 5.2.0 and the bottom line is starting at 5.2.0 after the change was introduced. When comparing with other Gtk applications using the same proportional font and size, Scintilla is the only one with slightly longer lines.

Cheers,
Mitchell
proportional.png

Neil Hodgson

unread,
Jul 26, 2022, 7:34:55 PM7/26/22
to Scintilla mailing list
Hi Mitchell,

> causes proportional (not monospaced) fonts to be "off". Line width increases as the number of characters increases compared to prior behavior.
>
> See attached image. The top line is prior to 5.2.0 and the bottom line is starting at 5.2.0 after the change was introduced. When comparing with other Gtk applications using the same proportional font and size, Scintilla is the only one with slightly longer lines.

While this is different, it doesn't mean it is wrong. Pango tried to move to subpixel positioning globally then retreated when it caused problems with older Cairo. That reversion may still be in effect but I'd expect the stack to move towards subpixel positioning.

https://blogs.gnome.org/mclasen/2019/08/07/pango-1-44-wrap-up/

Subpixel positioning is better as it more accurately follows the font design and can produce more consistent results when text is sliced into runs in different ways.

There are accuracy issues in some conversions mentioned on the bug report and Scintilla moved to using the Pango conversion functions instead of its own.

https://sourceforge.net/p/scintilla/bugs/2310/
https://sourceforge.net/p/csscintilla/csscintilla/ci/47d2b7b015ff595facac79c64c07d4daa5070560/

Check that your issue is from pango_context_set_round_glyph_positions and not from the change to pango_units_from_double.

Neil

Mitchell

unread,
Jul 27, 2022, 11:05:56 AM7/27/22
to scintilla...@googlegroups.com
Hi Neil,

On Wed, 27 Jul 2022 09:34:49 +1000
"'Neil Hodgson' via scintilla-interest" <scintilla...@googlegroups.com> wrote:

> Hi Mitchell,
>
> > causes proportional (not monospaced) fonts to be "off". Line width increases as the number of characters increases compared to prior behavior.
> >
> > See attached image. The top line is prior to 5.2.0 and the bottom line is starting at 5.2.0 after the change was introduced. When comparing with other Gtk applications using the same proportional font and size, Scintilla is the only one with slightly longer lines.
>
> While this is different, it doesn't mean it is wrong. Pango tried to move to subpixel positioning globally then retreated when it caused problems with older Cairo. That reversion may still be in effect but I'd expect the stack to move towards subpixel positioning.

I had not thought of this. Thanks for your input. It sounds like this is a non-issue then.

Cheers,
Mitchell
Reply all
Reply to author
Forward
0 new messages