Non-breaking hyphen too wide in italic

The hyphen-minus (U+002D) looks OK, but the non-breaking hyphen (U+2011) in italic and bold italic takes more width than it should, which makes it look like there is some space between it and the following character. Also in PDFs created by LO Writer. Version 7.3.2.2 on Windows 10 Home.
s3

Hi Piotrek. As a quick fix, have you tried removing Italics from just the offending hyphen?
In order to go into the problem deeper, can you specify the font (family) you are using? Liberation Sans seems to be a bad offender, for example, while others are much better. Also, have you gone so far as to print? I’m noticing better results on the print preview than in normal text editing.
Ultimately, not to belittle Writer, there are reasons for Affinity, QuarkXPress, or Adobe at the professional level of typesetting.

Yes, removing italics from the hyphen reduces the after-space back to normal, of course.

The problem is seen with all fonts that are available to LO Writer, sometimes more, sometimes less visible, which I believe depends on the design of the font and how strongly slanted the italic is. Calibri, Cambria, Charis SIL (in the GIF), Gentium Plus, Georgia, Segoe UI, Sitka Text and Times New Roman are among those, where the problem is clearly visible.

I can’t print a physical copy, because I don’t have a printer around me, but the print preview makes no difference to me.

Interestingly, I do not see this problem on my Windows 11 computer. Maybe the font versions are more recent, Font List Windows 11 - Typography | Microsoft Docs

Some of the problem fonts listed, Liberation Sans, Liberation Serif, Calibri, do not include character U+2011 so it must be substituted from a system symbol font (oddly, the OpenSymbol font I have does not include this character either). For Windows 11, I would expect SegoeUISymbol to be used. SegoeUISymbol non-breaking hyphen moves about 30% of its length towards the right when italicised and I don’t see this so it must be a different font used.

Times New Roman on my pc includes but it maintains the same distance between it and the nearest part of the d when italicised
TimesNewRomanNon-BreakingHyphen

I see that Linux Libertine G font includes a non-breaking hyphen that moves a lot to the right when italicised.
LinuxLibertineGNon-BreakingHyphen

Checked on both version of LO:
Version: 7.2.6.2 (x64) / LibreOffice Community &
Version: 7.3.2.2 (x64) / LibreOffice Community
Build ID: b0ec3a565991f7569a5a7f5d24fed7f52653d754
CPU threads: 8; OS: Windows 10.0 Build 22000; UI render: Skia/Raster; VCL: win
Locale: en-NZ (en_NZ); UI: en-GB
Calc: CL

1 Like

Thanks to everyone for your replies. I checked some fonts that do have U+2011:

  • Andika
  • Cambria
  • Charis SIL
  • Doulos SIL
  • Fira GO
  • Gentium Plus
  • Lucida Sans Unicode
  • Noto Sans
  • Noto Serif
  • Palatino Linotype
  • Segoe UI
  • Tahoma
  • Times New Roman
  • Vollkorn

I also tried to see what that the text looks like in LO Writer, Windows Notepad and in HTML files in Firefox. Noto Sans and Noto Serif are the only ones that had no problems with U+2011 anywhere. The rest of the fonts looked good in Notepad and HTML, but not in LO Writer.

Some fonts has big right margin for the character U+2011.


I tried to solve it with sub-zero spacing.

But it seems like a bug. There isn’t chance to set sub-zero spacing for the character U+2011. Maybe the reason is this character is special character and it is possible to highlight it by View/ Field Shadings. And LibreOffice probably take this character like the character with different character style, so some settings are ignored.


Probably it is solvable by Ctrl+H and remove italic for this character.



You can also test this macro to get fonts that include this character. Because if the character isn’t in the font, then OS makes automatic substitution for the character and it could be also problematic.

Sub isCharInFont 'test in which fonts the charater is
	dim oDoc as object, oWindow as object, oFont as object, oFonts(), i&, sChar$, col as new collection
	oDoc=ThisComponent
	oWindow=oDoc.CurrentController.Frame.ContainerWindow
	oFonts=oWindow.FontDescriptors
	sChar=chr(&H2011) 'U+2011 'tested character
	on local error resume next 'need for the method col.add
	for i=lbound(oFonts) to ubound(oFonts)
		oFont=oWindow.getFont(oFonts(i))
		if oFont.hasGlyphs(sChar) then
			col.add(oFont.FontDescriptor.Name, oFont.FontDescriptor.Name) 'get unique names of fonts, so it ignores the regular/italic/bold etc.
		end if
	next i
	dim p(col.Count-1)
	for i=1 to col.Count
		p(i-1)=col(i)
	next i
	GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
	msgbox(join(SF_Array.sort(p), chr(13)), 0, sChar & " is in fonts") 'show sorted names of fonts
End Sub
1 Like

Definitely. If that works for normal hyphen/minus, it should also work for all other variants of hyphens and dashes.