Ask Your Question
0

Fonts in graph (graph theory) pictures are Type 3???

asked 2012-12-07 14:45:26 +0200

G-Sage gravatar image

updated 2012-12-07 15:00:34 +0200

I am writing my thesis. One requirement is I can not have any Type 3 fonts. My document does have Type 3 fonts (Go to File, Properties, then the Font tab in Adobe Reader to check) and I believe it is caused by the graphs I have drawn with Sage, which I save as PDFs and then include with \includegraphics in LaTeX. For example:

g=graphs.CycleGraph(5)
g.relabel(lambda i: i+1)
graph_plot = g.plot(talk=True)
graph_plot.save('5cycle.pdf')

It is listed as "BitstreamVeraSans-Roman". I am using the thesis LaTeX template provided by my university, and I have not added any statements that tell it to use a certain font anywhere, so I don't think it's possible that the Type 3 font is anywhere in my text, unless the person who made the template is a jerk.

That left me to guess it is in my pictures. I googled "bistream verasans roman sage" and came across this question which suggests it is possible. I also deleted out 70% of my thesis, starting from the spot where the first figure appears, so that I deleted out all figures created as PDFs in Sage. And, now there are no Type 3 fonts.

Is it possible to change the font used? I guess it is the font used in labeling the vertices of the graphs??? Or, is it possible to explain why these fonts were used so I can try to explain why these fonts will not cause a problem? The reason we can not use Type 3 fonts is because this website says they cause problems, essentially that Type 1 fonts appear nicer when you are reading it on the screen.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2012-12-08 00:29:11 +0200

ppurka gravatar image

updated 2012-12-10 14:38:23 +0200

This seems to be controlled by matplotlib. See this blog post for a workaround. Unfortunately, I don't think there is any easy way to pass those parameters to matplotlib via Sage.

EDIT: See @jason-grout 's message below for a way by using a matplotlibrc file. Create the file in the working directory with the required matplotlib parameters as mentioned in the blog post.

edit flag offensive delete link more

Comments

Do you think that is something that could be patched into Sage? I mean, the only reason I ever used Sage for my graphs is because William Stein has a graph theory video talking where he mentions how awesome Sage graphs are, high quality, blah blah blah. And, yet, apparently according to my university and the blog post you gave and the website I shared above, there are lots of places where you are not allowed to even use Type 3 fonts, and thus these graphs are bad quality in some ways. If Sage isn't patched, my alternative is to learn some new program and re-create every graph in my thesis, which I don't have time to do.

G-Sage gravatar imageG-Sage ( 2012-12-08 10:12:53 +0200 )edit

Try [this patch](https://raw.github.com/ppurka/sage-patches/master/sage_devel/type1-fonts.patch). It seems to work for me. To apply, run the following commands (can't get rid of the link below): cd SAGE_ROOT/devel/sage hg qimport -P https://raw.github.com/ppurka/sage-patches/master/sage_devel/type1-fonts.patch ../../sage -b

ppurka gravatar imageppurka ( 2012-12-08 10:52:09 +0200 )edit
2

You probably could just put those lines in a matplotlibrc file. You could put the matplotlibrc file in the current directory or in the ~/.sage/ directory (see http://matplotlib.org/users/customizing.html#the-matplotlibrc-file). That way you don't have to patch Sage.

Jason Grout gravatar imageJason Grout ( 2012-12-08 22:09:41 +0200 )edit

@jasonGrout So, is this something that should be changed in Sage for future releases? Again, as my above comment says, if many publications don't allow Type 3 fonts, would it not be better to use Type 1 fonts, especially if there's an easy fix?

G-Sage gravatar imageG-Sage ( 2012-12-10 10:02:31 +0200 )edit

Okay, had someone install the patch on our Sage server and now my thesis does not have any Type 3 fonts!!!! Thanks so much!

G-Sage gravatar imageG-Sage ( 2012-12-10 12:03:43 +0200 )edit
0

answered 2013-05-30 10:19:44 +0200

ppurka gravatar image

I have added a patch at ticket 14664 to enable type 1 fonts at runtime.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-12-07 14:45:26 +0200

Seen: 7,767 times

Last updated: May 30 '13