Tested with Junicode Two Beta VF variable font https://github.com/psb1558/Junicode-font on Version: 7.5.0.0.alpha1 (X86_64) / LibreOffice Community Build ID: 2b4d136b65bc79a1248876160e85fab79d52d5d6 CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb) Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded With Junicode Two Beta VF, a variable font, LibreOffice offers 34 different styles, but many of them fall back into a few ones that are not necessarily the correct ones. For example: regular, expanded, semicondensed, semicondensed light, semiexpanded all fall back to "condensed" when reopening the style/direct formatting; expanded medium and others go to condensed medium; etc. Also, comparing the variable font with the static version, the font names used by LibreOffice are wrong: what in the VF is called "condensed" in reality correspond with "semiexpanded" for the static font. Note: I tested with Junicode Two Beta because it offers both, the variable and the static version of the font so it's easy to compare. Also, despite being in beta state, I tested the font with https://bulletproof.italic.space/ and it works as intended.
Created attachment 184021 [details] PDF output of a sample documnet using both, the variable and the standard version of Junicode Two Beta In the attached PDF you can see the behavior described in the report. The first three lines show the static versions of Junicode Two Beta in its Condensed, Regular and SemiExpanded variants. The following line show the variable version which LibreOffice label as condensed, independently of which style you select from those indicated between parenthesis. As you can see, the "condensed" from the variable font matches with the SemiExpanded static variant, not with the condensed. The embedded variable font don't show its name in the exported PDF.
I'm sure خالد will comment, but I think https://gerrit.libreoffice.org/c/core/+/142028 was an incremental handling of variable fonts until (or even if) more work on HB based instantiation in PDF provides better glyph stamping. The mangled PS font names are there in the PDF, but I don't think we can expect the bitmap glyps to match appearance on VCL canvas yet.
It does not seem to be a variable font issue, rather it seems that LibreOffice is failing to use the width variants at all, i.e. the width is always ignored. If you install the static fonts you get the same issue.
I tried to debug this and now I’m very skeptical that font width ever worked, it seems to be ignored left and right.
*** Bug 127377 has been marked as a duplicate of this bug. ***
*** Bug 79726 has been marked as a duplicate of this bug. ***
I did some debugging and it seems one layer of LibreOffice knows about font width (vcl fonts) and another layer does not (svx stuff) and at some point the fonts are serialized between the two layers and this is when font width gets lost. Probably require quite a bit of work to get it working.
*** Bug 87288 has been marked as a duplicate of this bug. ***
This issue does not show up on Windows because Windows GDI supports only R/I/B/BI styles and will split large families into multiple subfamilies (so instead of Foo font with style Condensed, you get Foo Condensed with style Regular), but the buggy code is in the platform-independent parts of LibreOffice.
*** Bug 98596 has been marked as a duplicate of this bug. ***
So you have to write additional source codes for this, or alternatively, integrate FreeType.
Also, you may consider to implement additional interface for various subfamilies, see this screenshot by Steve Matteson: https://img1.wsimg.com/isteam/ip/d627c7cf-7c1f-470d-ad76-dda84041d982/AptosFontMenuImage.png
*** Bug 163904 has been marked as a duplicate of this bug. ***