Description: After upgrading to LibreOffice 7.4, font rendering inside the document view no longer obeys system-wide font hinting settings. The problem exists only in the document view, and does *not* affect the preview inside the Font properties window or the Font Features window. I noticed the problem after an upgrade from Fedora 35 to Fedora 37, using the distribution LibreOffice packages. But then I was able to reproduce both the old (good) and new (bad) behavior on Fedora 37 by using several different versions of binary RPM packages from libreoffice.org. Unaffected versions: 7.2.7.2 7.3.7.2 Affected versions: 7.4.0.0.alpha1 7.4.3.2 To enable full hinting, I am using the truetype:interpreter-version=35 option for FreeType. Rendering options are configured through fontconfig like so: antialias: true hinting: true hintstyle: full rgba: none autohint: false lcdfilter: lcdnone Steps to Reproduce: 1. Configure the system to enable full hinting, as per the description. 2. Open a blank document, type something, and change the font to "DejaVu Sans". Actual Results: Font is only partially hinted in the document rendering. Expected Results: Font should be fully hinted. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.4.0.0.alpha1 / LibreOffice Community Build ID: b871abad383583f02eb49c7e49aeae01f6941072 CPU threads: 2; OS: Linux 6.0; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Created attachment 183817 [details] DejaVu Sans font rendering in LibreOffice 7.3
Created attachment 183818 [details] DejaVu Sans font rendering in LibreOffice 7.4
Created attachment 183819 [details] Screenshot including both the document rendering and the preview in font properties
I believe this is intentional because strong hinting modes change glyph advances and we use unhinted glyph advances in text layout so that document does not re-flow due changes in hinting mode, so both are incompatible. CC’ing Caolán McNamara for a definitive answer.
I agree, you definitely do not want the document to re-flow due to changes in hinting mode. However, hinting should only affect kerning, not glyph advances. In other words, it should not cause the document to re-flow. As always with full hinting, I am willing to sacrifice kerning for glyph aspect. I totally understand you cannot have both. In the meantime, I tried to start LibreOffice with the SAL_USE_VCLPLUGIN environment variable set to "gen", as suggested here: https://wiki.documentfoundation.org/QA/FirstSteps#Rendering_issues_specific_to_Linux. The UI is messed up (which is expected), but font hinting inside the document view works as expected. I'm not sure if it's relevant, but my desktop environment is MATE.
Created attachment 183828 [details] sample ~/.config/fontconfig/fonts.conf
Created attachment 183829 [details] zoomed in DejaVu Sans gen above gtk below Yeah, we're explicitly forcing just slight hinting if hinting is enabled. The positions for determining line breaks aren't affected by whatever hinting mode is done, layout is done at printer resolutions where hinting doesn't matter anyway. But with full hinting we can't guarantee that the smaller font used on the lower resolution screen will fit into the space the text in the larger print resolution font occupied when scaled down to the screen resolution. Or at least that's the working assumption. So light/slight/vertical-hinting-only is deliberate. In LibreOffice 7.4 the various stuff described in this presentation: https://events.documentfoundation.org/media/libreoffice-conference-2022/submissions/B87ZBP/resources/LibreOfficeCon-2022-ResolutionI_2TieDK1.odp is only applied for the main writer window so there indeed is a discrepancy with the preview in the dialog. In 7.5 the preview matches. I'm surprised to hear that gen vs gtk makes a difference. We render with the same code by default and with the same settings. Locally here, as seen in this screenshot, I get the same pixels for gtk and gen. A difference there in 7.4.3.2 is surprising? Was there a difference with gen in 7.4.3.2 or was it an earlier 7.4 version where there might have been a discrepancy in settings?
Created attachment 183830 [details] better zoom
So, by design and => NAB
Thanks for the detailed input! You are right, in 7.4.3.2 there is no discrepancy between gtk and gen. I was testing 7.4.0.0.alpha1 when I noticed the discrepancy. Is there an option (setting?) to revert to the old behavior *locally?* I understand why the change was done, but only slight hinting (or no hinting) makes my eyes bleed, and I'm probably not alone. I am ready to accept whatever would presumably break because of full hinting. To be honest, I have lived with full hinting since before LibreOffice was forked from OpenOffice, and haven't had any issues. So, from my perspective, this is a regression that was introduced to fix a problem that didn't exist. And again, I totally understand this is just *my own* perspective, and what works for me doesn't necessarily work for everybody else. I really wish there was a way to tweak it. Thanks!