flathub / org.libreoffice.LibreOffice

https://flathub.org/apps/details/org.libreoffice.LibreOffice
29 stars 18 forks source link

Font hinting ON is not respected when anti-aliasing is turned OFF #275

Open Sunspark-007 opened 5 months ago

Sunspark-007 commented 5 months ago

Related to issue https://github.com/flathub/org.libreoffice.LibreOffice/issues/274, when anti-aliasing is turned off in the .fonts.conf file, LO does not parse the following hinting instructions:

 <match target="font">
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintfull</const>
  </edit>
 </match>

The outcome is that the font rendering is awful!

LibreOffice Font Rendering

Expected behaviour: That the fonts be hinted properly when AA is turned off and not have weird blockiness, etc. These truetype fonts were selected specifically for this example because they have a lot of internal bytecode hinting to make sure that they render properly when anti-aliasing is turned off. Even unhinted fonts look pretty bad too because no attempt is made at hinting because the way freetype functions is that if it is configured to use hints, it does not use the old autohinter. So LO is parsing as AA false, hinting false, when it should be AA false, hinting true.

Version: 7.6.4.1 (X86_64) / LibreOffice Community Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1 CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3 Locale: en-CA (en_CA.UTF-8); UI: en-US Flatpak Calc: threaded

Sunspark-007 commented 5 months ago

The image below from Windows is how the rendering is supposed to look:

Windows rendering