libertinus
libertinus copied to clipboard
Keyboard font cut off when exporting to PDF from LibreOffice
Describe the bug When using the Keyboard font (v7.0.20) in LibreOffice (v6.0.7.3), everything looks okay when I use the ligatures to create keys like "Windows", "Enter" and so forth.
For some reason, these display cut off at the right when exporting to PDF. See screenshot.
Steps to reproduce
Install LibertinusKeyboard-Regular.otf
(I used Linux Mint 19.3/Cinnamon), open a new document in LibreOffice Writer and type some of the keys that are done with ligatures (Windows, GNU, Pagedown, Enter, etc.). Change the font to Libertinus Keyboard. The keys now display properly in LibreOffice.
Export the document to PDF (I tried several variants). The PDF now contains the correct spacing but some keyboard keys requiring ligatures are cut off at the right.
Expected vs. actual behavior Expected the keyboard ligature keys to show up fully in generated PDF. Instead they are cut off at the right—looks like some width problem.
Screenshots / logs
Additional context
I'm not 100% convinced this is a bug in the font, but it's a bug somewhere. Fiddling with this i LibreOffice myself I notice quite a few weird things going on with the ligatures, notably how it handles drawing the glyphs vs. how it places the cursor after the ligatures kick in. I suspect there are probably bugs in both this font and LO's shaping going on here.
I'm not 100% convinced this is a bug in the font, but it's a bug somewhere. Fiddling with this i LibreOffice myself I notice quite a few weird things going on with the ligatures, notably how it handles drawing the glyphs vs. how it places the cursor after the ligatures kick in. I suspect there are probably bugs in both this font and LO's shaping going on here.
Cursor position with ligatures in LibreOffice is an old bug (I reported it 10 years ago for graphite fonts, but it's the same with OpenType): https://bugs.documentfoundation.org/show_bug.cgi?id=30731
On the other hand I cannot reproduce the problem with export to PDF. I'm using LibO 6.4.5.2 and the resulting PDF is just fine.
I ran into so many little display artifact bugs I never ever bothered to move on to PDF export. I just went back and tried my tests and I'm getting clean PDF output as well. I'm on LO 7.0.4 though, not the 6.x series.
@Moonbase59 can you confirm this is still an issue in LO 7 and not something that was fixed already?
@RGB-es, @alerque: Seems you have a point there. I did a short test using "Linux Biolinum Keyboard" instead which shows exactly the same behaviour. So either both fonts have the same problem (maybe forked?) or it’s really a bug in LO. Btw, exporting from LO to (X)HTML works fine.
Should I dare updating to the latest LO 7 and try again? My (Linux Mint 19) repos don’t offer it (yet).
If I have the time, I’ll later on give it a shot using LaTeX (TeX Live).
Here is a sample I made using "Linux Biolinum Keyboard"—it shows the same symptoms:
This time, I used no ligatures but only the Unicode code points.
All this playing and testing around makes me think the keyboard font would benefit from some updates, i.e., missing characters, some glyphs only reachable as ligatures, not via code point, etc. I’ll address this in a new issue (https://github.com/alerque/libertinus/issues/416).