embedding fonts for web publishing

Post questions on how to use or achieve an effect in Inkscape.
User avatar
Marcelo
Posts: 35
Joined: Thu Jul 09, 2009 12:18 pm
Location: Buenos Aires, Argentina
Contact:

embedding fonts for web publishing

Postby Marcelo » Thu Jan 27, 2011 11:28 pm

I intended to publish my SVG graphics as web pages and found that text didn't appear in the browser. Then I dived a little into SVG documentation and learnt fonts must be converted and embeded. (If there was any clue on how to have this done, I didn't get it). Then I read in Batik webpage that a feature concerning this point was included.

So does Inkscape? What's the path to it?

Thanks so much.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: embedding fonts for web publishing

Postby ~suv » Fri Jan 28, 2011 12:07 am

Marcelo wrote:I intended to publish my SVG graphics as web pages and found that text didn't appear in the browser.
Did you use Flowed Text instead of Regular Text? See Inkscape Faq: What about flowed text?.

Marcelo wrote:Then I dived a little into SVG documentation and learnt fonts must be converted and embeded. (If there was any clue on how to have this done, I didn't get it). Then I read in Batik webpage that a feature concerning this point was included.

So does Inkscape? What's the path to it?
Inkscape does not yet support creating and rendering text with embedded SVG fonts [1]. Alternatively - to make sure the text looks precisely the same in all browsers across platforms - you can convert the text to paths (using 'Path > Object to Path'), but this will increase the file size a lot.

See also the comments about the current status and roadmap of SVG fonts in "SVG WorkingGroup > SVG Fonts".

[1] Inkscape does have a built-in SVG Font Editor to create such fonts, but it can't use them as font-family for text objects.

User avatar
Marcelo
Posts: 35
Joined: Thu Jul 09, 2009 12:18 pm
Location: Buenos Aires, Argentina
Contact:

Re: embedding fonts for web publishing

Postby Marcelo » Fri Jan 28, 2011 6:10 am

Yup, that solved my problem, much easier than I expected. No need to embed specific fonts, at the moment.
Thanks so much again, -suv

Hideto
Posts: 3
Joined: Thu Oct 22, 2015 4:35 pm

Re: embedding fonts for web publishing

Postby Hideto » Fri Dec 18, 2015 9:51 pm

I don't know if it's appropriate to revive a question that I seem to be having the same trouble for. I don't want to add "yet another..." of this question when this question works fine. Please tell me a better approach if this wasn't it. Anyway, on to my question.

I dug around on the web for a long time and here as well, and can't find a solution that works for me. I'm making a graphic I want to be able to use on my website in SVG so that I can dynamically change its size with clarity. It has included text in a script/handwriting-type font. It looks great in Inkscape but when loading in my browser, the text uses a default font instead. I tried selecting the text and going to the Text menu > Convert to Text but when I save and reload my graphic, it's still the default font. I understand that SVG and fonts are still iffy in the specs, so was wondering if there's a workaround to this besides outright converting the text to an object?

Thanks for any teaching and information you can provide.

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: embedding fonts for web publishing

Postby brynn » Sat Dec 19, 2015 1:12 pm

I never have quite understood the difference between Text menu > Unflow and Text menu > Convert to Text. The manual says this:

Flowed text can be converted back to a regular text object with the Text → icon Unflow (Shift+Alt+W). The resulting text will be on a single line.

The Text → icon Convert to Text command converts link-flowed text to a regular text object while preserving the appearance of the text. The text is still editable but will no longer reflow inside the shape or path frame. This is necessary for display of the drawing in another SVG renderer.


But I'm not sure what "link-flowed text" is.

I do know that if you use Text menu > Unflow, it will put your text all in 1 long line. This has been a couple of years ago, but I tried Convert to Text, and it didn't make the font show up on a webpage. Unflow made it work, but then it was 1 long line. So I had to go through and "manually" insert Returns (Return key used to be the carriage Return on typewriters, but on computer keyboards is called the Enter key), where I wanted each line to end.

That could become tedious, if there is a lot of text. I saw an extension for hyphenated text, the other day. But I haven't tried it yet. Maybe it only works on flowed text....but maybe chooses and inserts the "returns", I'm not sure. But I'll test, and post what I find out.

Edit
Oh, I see, now that I read about it http://thottingal.in/blog/2009/10/03/in ... extension/

It works on text that's justified, and fwict, only flowed text has the option to be justified.

But when I test just now, Convert to text did change the flowed text to regular text. I haven't tested with a webpage, but I'll try that next.

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: embedding fonts for web publishing

Postby brynn » Sat Dec 19, 2015 1:24 pm

Btw, did you say which version of Inkscape you're using? There have been many new versions since the last time I tried this. I'll be using 0.91 this time.

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: embedding fonts for web publishing

Postby brynn » Sat Dec 19, 2015 2:02 pm

Hhmm... Ok, let's see if I can insert SVG image into this message.

Image

Well, I can't see it at all. Added purple blob, to make sure image is there. Text should be some lorem ipsum with a font called Sprint. I thought I'd be able to see it. But apparently this forum can't display flowed text at all.

Actually, I didn't think flowed text could be displayed on the internet at all, now that I think about it. But you seem to indicate that it's being displayed, except with wrong font.

I'll test other forum.... Nope, can't be seen there either.

Now using Convert to Text:

Image

Well, it seems to work here!

Maybe you're having some kind of confusion. Because I didn't think flowed text could be shown on the internet with any kind of viewer. Are you using flowed text at all???

If your issue has nothing to do with flowed text, then the answer is that you either need to embed the font or convert to paths.

Hideto
Posts: 3
Joined: Thu Oct 22, 2015 4:35 pm

Re: embedding fonts for web publishing

Postby Hideto » Sat Dec 19, 2015 8:07 pm

I'm using Inkscape Portable version 0.48.4. Sorry for not mentioning that earlier. The text I want is on a path. Is there a way to embed the font and have it work on the pathed text? I'm ok with doing that if I have to.

Moini
Posts: 3291
Joined: Mon Oct 05, 2015 10:44 am

Re: embedding fonts for web publishing

Postby Moini » Sun Dec 20, 2015 8:02 am

Font embedding into Inkscape's SVGs doesn't work, but you could add the font file to your website and link to it from the CSS you are using - or even directly from inside the SVG...
Didn't try it, but there should be a way of using CSS and the SVG file and the font files.

Ah - here's an article: http://www.andrejkoelewijn.com/blog/201 ... -inkscape/

(just search for "CSS Inkscape SVG font" with google to find more)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10308
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: embedding fonts for web publishing

Postby brynn » Sun Dec 20, 2015 9:51 pm

If you embed the font in the code, it will work on any text on that page which has that font name. It doesn't matter whether it's on a path or not.

If you don't want to embed fonts in the code, the only option is to convert the text to path. It doesn't matter whether you convert it to paths before or after you put on path.


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 14 guests