8

How can I get the Latex fonts to work from other programmes (e.g. Inkscape)?

I have created some graphics as pdf files with Tikz/PGF/PGFPlot (using miktex/TexnicCentre) using the standard latex fonts (e.g. CMMI10). These fonts seem to be embedded. The original results have the standard beautiful latex fonts.

I would now like to use vector programmes like (preferably) Inkscape or (preferably not) Adobe Illustrator to work with these images (importing them from pdf) but Inscape does not know the latex fonts and replaces them by other uglier fonts.

I am using Windows 7. I have installed Computer Modern in C:Windows/Fonts from CTAN. But this makes no difference to Inkscape.

How can I get the tex fonts to work on Inkscape?

Of course if you find that my whole process to get svg from tikz is wrong/convoluted and there is an easier way, that may also be a way to solve this issue.

(I hope this will be accepted as a Tex question rather than an Superuser Inkscape question because I think it is the Latex font installation, not the Inkscape usage seems to me to be the problem).

5
  • You say you've already installed Computer Modern. Did you install an Opentype version of it, or did you use the actual TeX fonts (e.g., CMR10) in TeX's encoding?
    – Chel
    Jun 13, 2012 at 3:30
  • I dunno anything about windows, but you might start downloading Computer Modern Unicode and Latin Modern. Both are Opentype descendants of Knuth’s original font and should work smoothly with GUI programs. Jun 13, 2012 at 5:15
  • 1
    @phg That's exactly what OP shouldn't do. If a PDF file comes straight from TeX, Inkscape et al. will be looking for fonts in TeX encoding named, e.g., CMR10. Computer Modern Unicode doesn't provide those fonts; it provides fonts with different encodings and different names. The actual TeX fonts that OP must install are about a dozen pfb and pfm files. See tex.stackexchange.com/q/45256/9092 for details.
    – Chel
    Jun 13, 2012 at 5:25
  • @rdhs Right. I thought op’s ctan link would be pointing to the Type 1 fonts and his vector programs won’t read those. Now I see that E was talking about the Truetype version. Anyways, shouldn’t CMU/OTF at least have comparable metrics to CM/Type 1 for the glyphs they have in common? Jun 13, 2012 at 6:10
  • I installed the otf (open type) fonts. I tried to install ttf (true font) but that did not seem to work. Strangely they are named BKM-cmbsy9 (BKM presumably for Bakoma) in the Windows Fonts folder, but just cmbsy9 if I copy them to anywhere else. Not sure whether that can be source of problems. Regarding the solution in the article rdhs is referring to - I have already tried copying the files from the tex section to system fonts, and to the Inkscape fonts. I have also tried the solution of adjusting your latex code to incorporate fontspec but apparently fontspec does not work in miktex.
    – toksing
    Jun 13, 2012 at 6:59

1 Answer 1

3

I had a similar problem, and I solved it as follows. Note that I use a Mac, so the directories and commands are appropriate for Unix-like machines.

Suppose that the document you wish to use in a vector graphics program is called test.pdf and located in /Users/me/Desktop/. Enter the following commands into the terminal:

cd /Users/me/Desktop
gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=test-out.ps -q -dbatch -dNOPAUSE test.pdf -c quit

You will get a file called test-out.ps on the Desktop that has all the letters and symbols in test.pdf traced out with vectors. This approach uses ghostscript, a nice little tool on Unix and Unix-like machines. I found this script somewhere on the internet, and I wish I could give credit for it, but I can't remember which forum I found it on.

This works fine if you want to use a few symbols and words to manipulate, but (I think) definitely not if you want to use the fonts to type text.

Here's an example of the input pdf and the result viewed in Illustrator. You can see that we've got nice vector paths.

enter image description here

And zoomed in on one part of the vectorized file:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .