Rotated text in SVGs have incorrect font in Draw and exported PDFs

Version of LibreOffice used is 25.8.1.1 (I recently updated to see if this bug got fixed)

I added an SVG of a map which I created myself in Inkscape to a LibreOffice Draw document and the font of some text is incorrect both in Draw itself and in PDFs exported with it.

This issue only occurs with text which is rotated for whatever reason. Non-rotated text in an SVG displays with the correct font.

I’ve prepared some image references to showcase the issue, as I believe this is something that is easier to explain with visuals.

As I’m limited to only a single image as a first time forum user (I only just found this out and had to rewrite my message) I had to make a mashup of all the images I want to show into a single image. Sorry that it’s so messy looking.

Here you can hopefully see that while non-rotated text appears correctly in all versions, rotated text randomly becomes a broken or given an incorrect font.

This is a big problem for me as this map is very important to how people are going to be using this document, and the weird font unexpectedly applied to this text is less readable when zoomed out then my intended font choice is.

I would love some help with this issue.

Thank you LibreOffice team for all the work you do!

Do you have the original font on the computer with LibreOffice?

If you do then it might have acquired a slightly different name in Inkscape/SVG. If the name appears in italics in the font selection box in Properties then the font is not found and a substitute is being used.

You can use the font substitution table to replace the slightly renamed font with the correct font.

  1. Click Tools > Options > LibreOffice > Fonts
  2. Tick the box Apply replacement table
  3. In the Font field, enter the name of the font as it appears in the font box when you click on it, e.g. CandaraLt, then in the Replace with field, select a font from your installed fonts, e.g. Candara Light. Click the green tick to add the substitution.
  4. In the panel tick the box in the Always column. OK

The font being used in the SVG is Liberation Sans which came installed with my Linux distro. I made the SVG and the Draw document with the same computer, and I am using this same font Liberation Sans for all of the text of the LibreOffice Draw document with no issues.

In fact, even in the SVG the only text with issues is specifically rotated text in the SVG. Non-rotated text in the SVG is unaltered.

I couldn’t find any evidence that the font got a different name in LibreOffice than in Inkscape using that Fonts menu in options, but then again maybe I misunderstood how to use it.

Given you mentioned an example where there would be different font names due to font weight, I feel I should mention this font has only Regular and Bold weights. I can confirm weights both work non-rotated (you can see both in the “Legend” example in my original post), and the rotated text is the default “Regular”.

I should also note that it is not possible (at least with this SVG, maybe one without a background or something might be different) to select text within the SVG using LibreOffice Draw for me to be able to see if the text would be in italics in the font selection box. I assumed this is standard for all SVGs in LibreOffice (or at least Draw), and while that is not a problem for use it does make that first troubleshooting step you suggested impossible for me to perform.

Thank you for trying to help. I do appreciate it.

Mary

I did an experiment creating a document in Inkscape with different angled text. It is zipped to comply with site requirements for non-odf types
TestAngledTextCreatedInkscape.zip (1.3 KB)

I opened the file in Draw and then selected the shape and clicked Shape > Break. Clicking on one of the text objects then showed it was using a substitute font.
SubstituteFontInSVG

The fix is then to copy the the font name (for me it was ‘Liberation Sans’ shown in italics in the font box) into the font replacement table. In the Replace with field select Liberation Sans, click the green tick, select Always and OK.
Close the file without saving or undo the Break.

If you exported the svg from Inkscape, then it seems that horizontal text is converted to curves so will always look correct.
TestAngledPlainExportedSVG.zip (973 Bytes)

I struggle to describe the confusing results I have gotten from attempting to follow your instructions.

I broke the original SVG I was using with the Shapes menu and replaced the italicized Liberation Sans (it had no quotes, but I think had a space before it) with normal Liberation Sans using the font replacement table menu in Options, and it did not effect the selected rotated text at all. It did cause issues a lot of other (mostly non-rotated) text in the SVG (and only the SVG), especially if I undid breaking the SVG. I’ll get back to that in a moment.

Exporting a “Plain SVG” in Inkscape does seem to convert rotated text into shapes, but the shapes as seen in LibreOffice Draw continue to be incorrect… despite appearing correctly when viewing the SVG with all the other software I have. The Plain SVG has all the broken text issues introduced by the font replacement table that the Inkscape SVG now has.

Breaking the SVG and applying the replacements table has made the non-rotated SVG text become unreadable when the SVG is not broken. Much of it repairs itself if I unbreak the SVG afterwords, but nevertheless I am somehow in a worse position than before.

I can’t seem to undo the replacements table changes as the table in the replacements table menu is empty, as it always has been when trying to interact with that UI. I have no idea what the issue is there.

Deleting and replacing the SVG with either the old version or the new exported plain one does nothing for repairing either the rotated text issue or the now borked non-rotated text.

I have no idea why any of this has happened or what to do next.

I’ve attached an image showing off some of the confusing issues I am now facing.

I recommend you download the image so you can zoom in and pan around. Sorry for the messy image again, as I made it quickly.

All of the above is on an Inkscape exported “Plain SVG”.

I didn’t notice any differences between the old Inkscape SVG and the exported Plain one besides that the Plain SVG when imported into LibreOffice breaks rotated text into shapes …which are still incorrect somehow.

I’ve also noticed while looking over the confusing issues that have occurred while from this troubleshooting we’ve been doing that it’s only some rotated text that has the original issue this post is created after. It appears certain angles are fine while others fundamentally cause issues that it is beginning to feel like cannot be worked around.

At this point even getting the document back to the state it was when we started would be an improvement, because this is an unworkable mess.

Sorry for the troubling developments.

Mary

If the order of steps here doesn’t work…


…then try in Safe Mode (Help > Restart in safe mode > Continue in Safe Mode). If it works in safe mode then the problem might have been a corrupted user profile

Or use a copy of the svg file if it is something you are unfamiliar with.

Why? It is a jpeg, not the svg, I won’t see anything helpful. Why not zip the svg so you can upload it to the site here?

So you can see the issues clearer… I was worried that the screenshots being so small would make it harder to tell which images were ones of problems and which images showed things working correctly. I hope I didn’t cause any confusion or offense.

I can’t send you the SVG because it’s a map to help patients of a medical clinic get around. It contains private information. The same thing applies to the Draw document I’m including the SVG map in.

I can make a new SVG that doesn’t contain any private information from parts taken out of the map for you to inspect, if you really want me to. I’m sorry for the trouble.

Thank you for the step by step as I had a lot of trouble with that menu. Even so, while I have now gotten the menu to work it hasn’t fixed anything in the SVG from as it was in the screenshots in my last message. Rotated text has the same issue as before, non-rotated text with the new problems don’t get fixed by it, etc. I don’t know why. Though text which was italicized before is now not italicized anymore, so I can confirm the menu did work.

I’m very confused why doing all of those steps except for clicking the tick that puts items in the table before applying caused all these new issues, as everything was (mostly) fine before doing that. (Mostly because of the rotated text issue that started all this.)

Opening the file again in safe mode didn’t change anything.

I don’t understand what you are asking me to do here.

When I noticed the new issues caused I presume by the font replacement table the first thing I tried was undoing as far as I could, which did nothing. I also closed the document without saving and reopened it which didn’t resolve the new issues either, which made me think that it must of been a hidden setting somewhere that got stuck.

Given that safe mode hasn’t resolved the new issues I have no idea what to do.

I think I may have saved by habit since causing this issue so I cannot confirm the copy of the file I have now is from before whatever happened. That is my fault. I’m sorry.

In case it’s relevant to what you were trying to say, I’ll point out this text from my last message.

Sorry for the bother or any confusion.

Mary

For displacement of text objects in Inkscape SVGs, there has been a new bug report posted from question SVG elements get displaced after importing applying to Inkscape svg imported, Bug 168378 - SVG text elements get displaced after importing . You could add yourself to the CC list to be advised of any updates.

A sample was provided there. The workaround suggested was to convert text to curves in Inkscape.

For your project, can you export everything else, except the Inkscape svg, from Draw to SVG and combine both in Inkscape?