Description: The problem may be also font related: it seems that the problem shows for Graphite enabled fonts (Linux Libertine G, L L Display G, from https://numbertext.org/linux/), though I cannot say "only". On special occasions justification is breaking internal position calculations, which puts the cursor at the wrong position and sometimes breaking the end position of the line as well. I attach a document and a screenshot, which shows broken cursor (right position would be before the marked character), broken ending and also a suggestively wrong space marker. (This is the Debian released version from sid.) Steps to Reproduce: 1.turn on justification (may be font dependant, I am using now Linux Libertine G) 2.set justification in style 3.find lines with broken ending Actual Results: Wrong cursor position, wrong ending position Expected Results: Good ones. Reproducible: Always User Profile Reset: No Additional Info: Linux Libertine G, Linux Biolinum G fonts
Created attachment 187294 [details] odt sample
Created attachment 187295 [details] screenshot of the problem
Linux Libertine G seems to be doing something fishy with tt followed by space: First check stand alone tt: $ hb-shape LinLibertine_R_G.ttf "tt" [t_t+1257] Then standalone space: $ hb-shape LinLibertine_R_G.ttf "tt t tt" [space+512] Then tt followed by space: $ hb-shape LinLibertine_R_G.ttf "tt t tt" [t_t+1769|space@-512,0+0] Notice how when followed by space the advance width of the t_t glyph gets the advance width of the space glyph add to it, then space gets a negative advance width to compensate for this. This seems like a font bug. I don’t think there is a good reason to do this. But we also probably have a bug caused by this resulting in calculating the spacing between glyphs differently for cursor position and for actual drawing resulting in this discrepancy. In general, Linux Libertine G is rather have some issues and is not maintained. We probably are better off not distributing it any more.
(In reply to خالد حسني from comment #3) > First check stand alone tt: > > $ hb-shape LinLibertine_R_G.ttf "tt" > [t_t+1257] > > Then standalone space: > > $ hb-shape LinLibertine_R_G.ttf "tt t tt" > [space+512] This should be: $ hb-shape LinLibertine_R_G.ttf " " [space+512] > Then tt followed by space: > > $ hb-shape LinLibertine_R_G.ttf "tt t tt" > [t_t+1769|space@-512,0+0] And this should be: $ hb-shape LinLibertine_R_G.ttf "tt " [t_t+1769|space@-512,0+0] (copied the wrong lines)
This is a bug in HarfBuzz graphite2 shaper.
I’m working on a HarfBuzz fix.
(In reply to خالد حسني from comment #6) > I’m working on a HarfBuzz fix. HarfBuzz fix didn’t help with this one, it needs to be fixed in th efont.
@Khaled: many thanks for analyzing the problem and fixing Harfbuzz! Linux Libertine G contains solutions for several LibreOffice problems (see https://numbertext.org/linux/fontfeatures.pdf), that is why for example it is the font set of two academic journals in Hungary (one of them is "Neveléstudomány" https://nevtud.ppk.elte.hu/content/nevelestudomany.t.6308?m=2818, and font of other scientific books. I will work on to fix these problems in Writer, so we won't need to the special Graphite solutions any more.
It seems that Libertinus fonts (in LO) support a lot of features now (c2sc, case, dlig, frac, hlig, liga, onum, pnum, salt, smcp, ss01-07, calt) but of course none of the special L L G features.