Any recommendations for text in SVGs

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
sizbut
Posts: 72
Joined: Fri Feb 02, 2007 11:58 pm

Any recommendations for text in SVGs

Unread post by sizbut »

Been playing with H&M7 features in preparation for moving our existing projects over to it. Our translators will love SVGs as they have the tools to apply translation to text in those files.

However, my tests so far so a lot of variety in the text display result for the same SVG between PDF, CHM and HTML output. Do you have any recommendations for text settings (fonts, size specification, etc) that would provide the most reliable rendering in different formats?
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Any recommendations for text in SVGs

Unread post by Alexander Halser »

Use web safe fonts and specify font sizes in pixels.
http://www.w3schools.com/cssref/css_websafe_fonts.asp

An SVG is rendered on the fly, so it's rendered like a web page. If a particular font is not installed on the target device, the SVG will be rendered with a different font, same as with web sites. So you cannot rely on pixel-perfect text placement in SVG images. Leaving room for text adjustment is a good idea.

Font sizes specified in point behave differently when viewed in HTML Help (CHM format, that is an embedded MSIE) or with regular browsers. This affects the display of texts by a great deal. You might not see a problem in Webhelp and regular browsers, but in compiled HTML Help on Windows systems with high resolution monitors (or with system fonts larger than "normal"). I have explained this in an in-depth article "Zooming in on HTML Help":
http://www.helpandmanual.com/downloads_ ... html#chm4k

When H&M creates a CHM file, it makes sure that it is encoded in a way that is compatible with high-resolution monitors. However, it does not modify SVG images but uses them as they are (if possible, PDF is different). So when creating SVGs with texts that you plan to use in HTML Help, you should be aware of these issues.
Alexander Halser
Senior Software Architect, EC Software GmbH
sizbut
Posts: 72
Joined: Fri Feb 02, 2007 11:58 pm

Re: Any recommendations for text in SVGs

Unread post by sizbut »

Many thanks Alexander, that makes sense. Will test that. Suspect my biggest problem now will just be improving my Inkscape skills.
User avatar
jeffbronks
Posts: 214
Joined: Fri Mar 04, 2005 12:39 pm
Location: Cambridgeshire, UK

Re: Any recommendations for text in SVGs

Unread post by jeffbronks »

We have a similar problem but in our case the image source is Adobe Illustrator CC and the publishing format is PDF. Text in the SVGs is rendered in the PDF with random kerning. I don't believe that the advice to use system fonts is relevant in this case, as we've tried it with Verdana (a system font) and Roboto (not a system font but embedded in the PDF) with the same results. I've tried tinkering with the SVG export options in Illustrator, some of which claim to be related to kerning, but they don't help.

Our workaround is to create two versions of every SVG: one with embedded text suitable for translation, and another with text converted to outlines suitable for H&M. Obviously this is not ideal and I would love to have better SVG rendering in H&M.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Any recommendations for text in SVGs

Unread post by Tim Green »

Hi Jeff,

I've asked Alexander to have a look at this as he's our expert for PDF and SVG. My first instinct would be to make sure that the fonts are embedded in the PDF. You already appear to be doing this, but I wanted to mention it anyway. The next point is that there are now a range of different font embedding options in PDF, which may or may not be compatible with the fonts being used in the SVGs inside the PDFs. For example, you can solve a lot of font problems in PDF by choosing the new Type 3 embedding option, at the cost of slightly less sharp text. However, it is unlikely that the SVG would then be very happy with the Type 3 fonts in the PDF.

Anyway, Alexander will probably be commenting on this shortly. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Any recommendations for text in SVGs

Unread post by Tim Green »

Hi Jeff,

Update: Actually, my assumption on font embedding was incorrect. SVG files inside a PDF do automatically use all the same font facilities available to the normal text in the PDF. For example, if you are having problems with fonts in SVGs, switching to Type 3 font embedding can often also solve the problems there.

There is also an additional potential option that is there in the new version but not yet activated: We could offer an option to render the SVG as a PNG in PDF in order to solve possible problems. We may provide this as a configurable option in future versions.

It would be really helpful if you could send us a couple of affected SVGs so that our developers can experiment with them. Among other things, it would be important for us to be able to find out whether the issue is caused by something in the SVG itself or by specific fonts. You can mail them to me directly at support AT ec-software.com (replace the AT with @).
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
jeffbronks
Posts: 214
Joined: Fri Mar 04, 2005 12:39 pm
Location: Cambridgeshire, UK

Re: Any recommendations for text in SVGs

Unread post by jeffbronks »

Tim Green wrote:It would be really helpful if you could send us a couple of affected SVGs so that our developers can experiment with them. Among other things, it would be important for us to be able to find out whether the issue is caused by something in the SVG itself or by specific fonts. You can mail them to me directly at support AT ec-software.com (replace the AT with @).
SVGs in the post. I tried the Type 3 Font option but it didn't seem to make any difference. And I checked that the Roboto font was embedded in the resulting PDF.
Post Reply