I'm trying to convert a PDF file with Computer Modern fonts for formulas (generated by Asymptote), but Inkscape is not able to recognize it and automatically replaces them with some sans-serif font that looks ugly in math.
The import option under "Text handling" is only "import text as text", so is there a way to convert those fonts to path while importing?
How to vectorize fonts when importing PDF?
-
- Posts: 10
- Joined: Sun Oct 03, 2010 4:12 am
Re: How to vectorize fonts when importing PDF?
Hi netheril96,
Try unchecking "Replace PDF fonts with closest-named installed fonts". I'm not clear if that imports the text as paths, but it would be worth trying anyway, I think.
I'm not familiar with the program Asymptote, but I assume the text can't be converted to paths before saving or exporting? The Inkscape dialog for saving as PDF includes the option to convert the text to paths. But apparently not this program?
Try unchecking "Replace PDF fonts with closest-named installed fonts". I'm not clear if that imports the text as paths, but it would be worth trying anyway, I think.
I'm not familiar with the program Asymptote, but I assume the text can't be converted to paths before saving or exporting? The Inkscape dialog for saving as PDF includes the option to convert the text to paths. But apparently not this program?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
- flamingolady
- Posts: 687
- Joined: Wed Jun 10, 2009 1:40 pm
Re: How to vectorize fonts when importing PDF?
I just tried something else that may or may not work for you. Type your text (always duplicate it), then click on Object, then Pattern, then Objects to Pattern. Make a rectangle box exactly the same size as your text, convert it to a path, then fill it with the new 'pattern' of text (which is using the Fill and Sroke menu, click on the checkerboard looking box, then use the drop down menu and select your text.
That might work, or possibly you could then at least export it as a png which would keep it intact.
dee
That might work, or possibly you could then at least export it as a png which would keep it intact.
dee
-
- Posts: 10
- Joined: Sun Oct 03, 2010 4:12 am
Re: How to vectorize fonts when importing PDF?
flamingolady wrote:I just tried something else that may or may not work for you. Type your text (always duplicate it), then click on Object, then Pattern, then Objects to Pattern. Make a rectangle box exactly the same size as your text, convert it to a path, then fill it with the new 'pattern' of text (which is using the Fill and Sroke menu, click on the checkerboard looking box, then use the drop down menu and select your text.
That might work, or possibly you could then at least export it as a png which would keep it intact.
dee
I know how to do that, but I don't want to do it by hand; I need Inkscape to automatically vectorize all text upon importing.
Re: How to vectorize fonts when importing PDF?
This is not yet supported by the current stable release (but a known feature request).netheril96 wrote:I need Inkscape to automatically vectorize all text upon importing.
If you can install a recent development snapshot (0.48+devel), test opening the PDF file from within Inkscape as "Adobe PDF via cairo-poppler (*.pdf)" (Note: experimental, work-in-progress, might not be included in the next stable release) - it will not convert text to paths based on embedded fonts of the PDF file AFAICT, but does use installed fonts if available: the imported text is created as paths (clones linked to glyph paths as <symbol>'s in the <defs> section).
Alternatively write a script to use ghostscript for converting texts into outlines of PDF files, before opening the PDF file in Inkscape (a sample command line is here, a quick google search will return many other examples). Such a command could be daisy-chained as external script in an Inkscape input extension.
-
- Posts: 10
- Joined: Sun Oct 03, 2010 4:12 am
Re: How to vectorize fonts when importing PDF?
~suv wrote:This is not yet supported by the current stable release (but a known feature request).netheril96 wrote:I need Inkscape to automatically vectorize all text upon importing.
If you can install a recent development snapshot (0.48+devel), test opening the PDF file from within Inkscape as "Adobe PDF via cairo-poppler (*.pdf)" (Note: experimental, work-in-progress, might not be included in the next stable release) - it will not convert text to paths based on embedded fonts of the PDF file AFAICT, but does use installed fonts if available: the imported text is created as paths (clones linked to glyph paths as <symbol>'s in the <defs> section).
Alternatively write a script to use ghostscript for converting texts into outlines of PDF files, before opening the PDF file in Inkscape (a sample command line is here, a quick google search will return many other examples). Such a command could be daisy-chained as external script in an Inkscape input extension.
Sadly what I want is exactly to convert text to paths based on embedded fonts of the PDF file. There is in fact a tiny program pdf2svg (http://www.cityinthesky.co.uk/opensource/pdf2svg) based on Cairo and Poppler able to do this, but it is restricted to Linux and I don't want switch to Linux every time I convert PDF to SVG. Maybe developers can just incorporate the code of pdf2svg into Inkscape.
Re: How to vectorize fonts when importing PDF?
netheril96 wrote:but it is restricted to Linux and I don't want switch to Linux every time I convert PDF to SVG.
AFAICS you never told what OS/platform you are working on (and need a solution for) …
-
- Posts: 10
- Joined: Sun Oct 03, 2010 4:12 am
Re: How to vectorize fonts when importing PDF?
~suv wrote:netheril96 wrote:but it is restricted to Linux and I don't want switch to Linux every time I convert PDF to SVG.
AFAICS you never told what OS/platform you are working on (and need a solution for) …
I was talking about Inkscape, which is multi-platform.
Re: How to vectorize fonts when importing PDF?
netheril96 wrote:~suv wrote:netheril96 wrote:but it is restricted to Linux and I don't want switch to Linux every time I convert PDF to SVG.
AFAICS you never told what OS/platform you are working on (and need a solution for) …
I was talking about Inkscape, which is multi-platform.
Sorry for thinking you might be interested in interim solutions.
[1] edited later: Apologies again - I know this phrase is not helpful to users looking for a cross-platform solution. At the moment, I am not aware of an internal command/function available in the latest stable release (0.48.1) to achieve your request (vectorize (embedded) fonts when importing PDF). Maybe the next stable version (0.49) will include such an option (which certainly was planned to be added - based on the dropdown list in the PDF import dialog), maybe you'll need to wait for a later release.