Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wider/wrong? font rendering since v2.0 #3750

Open
r2rien opened this issue Jan 24, 2024 · 4 comments
Open

Wider/wrong? font rendering since v2.0 #3750

r2rien opened this issue Jan 24, 2024 · 4 comments

Comments

@r2rien
Copy link

r2rien commented Jan 24, 2024

Thanks a lot for this great piece of software I've been with for so long now :)

Since upgrade from 1.38 to 2.0, font rendering seems to have changed,
precisely horizontal spacing?/ligatures? between letters has increased,
and seem to be unpar with other gtk app using same font+size
(first noticed as when activating document wrapping, document displaying less lines within viewport)

checked gtk/pango/fontconfig stack against both debian stable/bookworm + unstable/sid,
and without any relevant clue I could report from dbg logs

geany_2 0_font_issue
geany_2 0_font_issue_transp

-- System Information:

Debian Release: trixie/sid
Architecture: amd64 (x86_64)
Kernel: Linux 6.6.11-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en.UTF-8

Versions of packages geany depends on:
ii  libatk1.0-0          2.50.0-1+b1
ii  libc6                2.37-13
ii  libcairo2            1.18.0-1+b1
ii  libgcc-s1            13.2.0-10
ii  libgdk-pixbuf-2.0-0  2.42.10+dfsg-3
ii  libglib2.0-0         2.78.3-1
ii  libgtk-3-0           3.24.40-1
ii  libpango-1.0-0       1.51.0+ds-4
ii  libpangocairo-1.0-0  1.51.0+ds-4
ii  libstdc++6           13.2.0-10
@elextr
Copy link
Member

elextr commented Jan 25, 2024

Looks like Scintilla rounding of fractional positions to integer pixels has changed for your system with [unspecified] font and [unspecified] size on a monitor with [unspecified] DPI with [unspecified] display server and [unspecified] GFX driver.

See also #3738 where that causes extra gaps and misalignment between 1.38 and 2.0, with the fix there (setting pango_context_set_round_glyph_positions to TRUE) both 1.38 and 2.0 produce exactly the same width text for me. But as @nyamatongwe pointed out setting that has other negative effects, YMMV.

The problem in #3738 is reported (by a bleeding edge Suse Tumbleweed user ;-) to go away with Pango 1.51.1, so maybe when that is in Debian you could re-check to see if it fixes this as well.

@r2rien
Copy link
Author

r2rien commented Jan 25, 2024

Thanks and thanks for pointing me to #3738
Hack regular font 13 at 96 dpi with xorg and i915 here
will try pango_context_set_round_glyph_positions(pcontext, TRUE)
as I should not be affected by #3111 as I don't use chinese
while waiting (or maybe reporting it in debian to push it) for Pango 1.51.1 then recheck

@elextr
Copy link
Member

elextr commented Jan 25, 2024

then recheck

Don't forget to take the TRUE out first, at first I didn't ;-P

@r2rien
Copy link
Author

r2rien commented Jan 25, 2024

just to confirm setting it to TRUE fixed it for me too
hereafter my 99_pango_context_set_round_glyph_positions_true.patch added to debian series

diff -Naur a/scintilla/gtk/PlatGTK.cxx b/scintilla/gtk/PlatGTK.cxx
--- a/scintilla/gtk/PlatGTK.cxx	2023-10-19 18:09:27.000000000 +0200
+++ b/scintilla/gtk/PlatGTK.cxx	2024-01-25 07:08:24.603457827 +0100
@@ -76,7 +76,7 @@
 
 void SetFractionalPositions([[maybe_unused]] PangoContext *pcontext) noexcept {
 #if PANGO_VERSION_CHECK(1,44,3)
-	pango_context_set_round_glyph_positions(pcontext, FALSE);
+	pango_context_set_round_glyph_positions(pcontext, TRUE);
 #endif
 }

thanks again, I will no forget to revert it (re-installing vanilla debian package one) when pango 1.51.1 in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants