Code covered by the BSD License  

Highlights from
printeps

4.83333

4.8 | 12 ratings Rate this file 44 Downloads (last 30 days) File Size: 2.02 KB File ID: #7501

printeps

by Jose Aumentado

 

21 Apr 2005 (Updated 22 Apr 2005)

This works around MATLABs tendency to call all fonts 'Helvetica' in .eps files.

| Watch this File

File Information
Description

When you export a figure to .eps in MATLAB, it will only use a small number of allowed fonts, even if the user has changed these fonts to something specific to their system. In most cases, you'll end up with 'Helvetica' specified in the resulting eps file. That is, if you import this file into Illustrator and have no font exactly called 'Helvetica' then you will end up substituting something else for it, often times doing bizarre things to your kerning, etc. like moving your subscripts to Siberia.

This script writes the .eps as usual, but figures out what font you actually used in the figure and does a find and replace to place your font (presumably actually resident on your system) back into the file. Currently this does not discriminate between the axis font and other text fonts in the figure (i.e., the title and added text), so everything gets changed to the axis font.

This is just a workaround until Mathworks decides their .eps exporting is problematic.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
18 Jan 2006 Hannah S

I haven't checked it thoroughly, but it solved my problem - thanks!

09 Jul 2007 Maxim Ts

Thanks. It solves the problem!

10 Jan 2008 L Matthews

Thank you,this has been driving me nuts. Why cant They sort real issues like this out.

02 Feb 2008 Dario Redaelli

I have exeprienced continuous problems to introduce matlab .eps files in latex ducments! You provided a simple solution, and exactly what I was looking for! Thank you very much.

29 Jun 2008 Ken Campbell

Simple, but it works. Thanks for solving this annoying problem.

25 Sep 2008 J W

works like a charm

23 Apr 2009 Ted S

Thank you, I assumed this is how MATLAB should have worked, and I was confused why I was having problems.... Works great with this.

04 Oct 2010 Andrey Kan  
15 Apr 2011 Nick Gravish

I work with eps figures in adobe illustrator and it has been a continual pain reconfiguring the fonts from matlab exported eps files. Thanks for the function.

One comment for illustrator users. Adobe illustrator (at least on my system) uses the times new roman font TimesNewRomanPSMT, so embedding the actual font name "Times New Roman" returned from get(gca,'FontName') still gives an error in illustrator. My workaround was to hard code actualfont = 'TimesNewRomanPSMT' since I always work with times. Just a heads up for anyone in a similar position.

22 May 2011 CĂ©ldor  
03 Jun 2011 Terrance Nearey

Thanks Jose for saving me some time finding out what Matlab should make clear in documentation. (Wish I'd spotted your contribution a couple of days ago!). The fonts actually supported in PRINT or SAVEAS in espc2 formats is apparently version- and platform-dependent.
On MATLAB Mac OS X Version: 10.6.7 Build: 10J869, the only fonts I could find that wound up in eps files were these: 'Courier' 'Helvetica' 'Palatino' 'Symbol' 'Times' 'Times New Roman' 'Zapf Dingbats'

Both Times New Roman and Times showed up as 'Times-Roman' in the eps file, but at least they weren't changed to 'Helvetica'.

30 Apr 2012 Alexandra  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
graphics import Jose Aumentado 22 Oct 2008 07:46:50
graphics export Jose Aumentado 22 Oct 2008 07:46:50
eps Jose Aumentado 22 Oct 2008 07:46:50
font Jose Aumentado 22 Oct 2008 07:46:50
helvetica Jose Aumentado 22 Oct 2008 07:46:50
utilities Jose Aumentado 22 Oct 2008 07:46:50
graphics Jose Aumentado 22 Oct 2008 07:46:50

Contact us at files@mathworks.com