Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a whole word as *.svg #79

Closed
pwichmann opened this issue Apr 5, 2017 · 4 comments
Closed

Get a whole word as *.svg #79

pwichmann opened this issue Apr 5, 2017 · 4 comments

Comments

@pwichmann
Copy link

Is it possible to get a whole word as an *.svg and not only a single letter?

So if we take the example...

var fontkit = require('fontkit');

var font = fontkit.openSync('font.ttf');

var run = font.layout('hello!');

// get an SVG path for a glyph
var svg = run.glyphs[0].path.toSVG();

...would it be possible to get the whole word 'hello!' as one SVG?

I don't want to iterate over the glyphs array since it would become impossible for me to correctly align each individual letter of a word once they have been separated.

Do I make sense at all?
Many thanks for any help!

@Pomax
Copy link
Contributor

Pomax commented Apr 5, 2017

This sounds like a duplicate of #24

@pwichmann
Copy link
Author

Thank you, Pomax.

I am not sure I could see any solution offered in #24.

I might be stupid again (as in my last issue), but:
Would exporting each glyph into individual paths not result in losing the property of having all letters correctly scaled and positioned/aligned? I would not know how to align letters the way the font designer intended to align the letters.

@Pomax
Copy link
Contributor

Pomax commented Apr 5, 2017

There is no solution as of yet, but all solutions start with an issue filed to ask for that solution to be implemented.

What I requested in #24 is literally what you're asking too: SVG code for the typeset string sequence, with all kerning, ligatures, etc. applied; so, not a concatenation of individual glyphs, that would indeed be rather useless. We can technically already do that right now, and it's not really good enough =)

It might be worth commenting in #24 for you, to explain what you needed it for, and perhaps some work on it can be done as a result of seeing renewed interest.

@pwichmann
Copy link
Author

I commented on #24 and expressed my support as well as explained my needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants