Bug 13433 - Cairo generated postscript files, fail to load under Adobe Illustrator (CS2)
Summary: Cairo generated postscript files, fail to load under Adobe Illustrator (CS2)
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: postscript backend (show other bugs)
Version: 1.4.10
Hardware: All All
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-28 13:52 UTC by Charles Doutriaux
Modified: 2018-08-25 13:35 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Example of ps with fonts, that cannot be imported in Adobe Illustrator (735.66 KB, application/postscript)
2007-11-28 13:52 UTC, Charles Doutriaux
Details
example of the same file w/o fonts that works great under illustrator (773.86 KB, application/postscript)
2007-11-28 13:53 UTC, Charles Doutriaux
Details
example of our old ps files which had font that worked under illustrator (452.83 KB, application/postscript)
2008-02-12 07:30 UTC, Charles Doutriaux
Details
example of eps whose font loading fail in illustrator but is replaced with other fonts (7.63 KB, image/x-eps)
2008-07-20 10:49 UTC, Charles Doutriaux
Details

Description Charles Doutriaux 2007-11-28 13:52:04 UTC
We're using freetype fonts. When loading the file into Adobe Illustrator, it complains about font being substituted and then either, crashes, complains about not enough emory, or does nothing... Importing the same file generated w/o any font, works great. This is still true under 1.5.2
Comment 1 Charles Doutriaux 2007-11-28 13:52:49 UTC
Created attachment 12799 [details]
Example of ps with fonts, that cannot be imported in Adobe Illustrator
Comment 2 Charles Doutriaux 2007-11-28 13:53:28 UTC
Created attachment 12800 [details]
example of the same file w/o fonts that works great under illustrator
Comment 3 Adrian Johnson 2007-12-02 01:57:51 UTC
I don't have Adobe Illustrator so I can't test this myself. I expect this is an Illustrator bug as it should not crash even if the input is bad.

The fonts in your file are TrueType fonts. Have you tried any other font types such as Type 1 or OpenType fonts? Do you have examples of PostScript files with embedded fonts created by other applications that Illustrator can import.
Comment 4 Adrian Johnson 2007-12-02 02:52:40 UTC
I had another look at your PostScript output. There are 35 embedded fonts in the file each with with a small number of glyphs. Many of the fonts have the same glyph name. Looking at the file in ghostscript there is not much text and all of it appears to be the same font. It looks like the same font is embedded each time a text string is drawn. In fact counting the all the graph labels and other text that appears to have been drawn with a separate call to cairo_show_text() or cairo_show_glyphs() I get exactly 35.

It may be the case that Illustrator has a problem with the same font embedded multiple times. Due to the subsetting the glyph numbering in each subset is restarted at 0 so each font will have different glyphs at the same glyph index.

Creating a scaled font once and re-using it each time you call cairo_show_text/glyphs will only embed the font once. Creating a cairo font face once and then creating scaled fonts multiple times will only embed one font for all glyphs drawn with the font face as the cairo_font_face_t type is what cairo uses to identify the font. However calling cairo_ft_font_face_create_for_ft_face() multiple times with the same FreeType face will result in a new embedded font for each call to cairo_ft_font_face_create_for_ft_face() as cairo does not know that it is the same face.

How are you creating the scaled fonts?
Comment 5 Charles Doutriaux 2007-12-03 08:50:21 UTC
OK i cleaned up my code and i'm calling the cairo_font_face only once per font now (instead of everytime i was writing some text). It definately improved as the file can now be seen in illustrator but w/o any font :(

So it's definately the embedding that's a problem. 

I'm not sure if it matters, but the ps files are genrated under Linux, while the illustrator is under windows, could it be that the embedding needs to tell something more so that the embedding be "platfrom-independent"?
Comment 6 Adrian Johnson 2007-12-10 02:34:02 UTC
(In reply to comment #5)
> OK i cleaned up my code and i'm calling the cairo_font_face only once per font
> now (instead of everytime i was writing some text). It definately improved as
> the file can now be seen in illustrator but w/o any font :(
> 
> So it's definately the embedding that's a problem. 

Is the imported PostScript file editable in Illustrator? It may be that Illustrator can not import PostScript files with subsetted fonts as it does not  have the complete font.

This may be a a use case for providing the option to embed the complete font in PS/PDF files.

However I would be interested in seeing a PostScript file with the same font that Illustrator can import so that I can see what type of font embedding can be imported.

> I'm not sure if it matters, but the ps files are genrated under Linux, while
> the illustrator is under windows, could it be that the embedding needs to tell
> something more so that the embedding be "platfrom-independent"?

The PostScript file is platform independent.
Comment 7 Charles Doutriaux 2008-02-12 07:30:59 UTC
Created attachment 14286 [details]
example of our old ps files which had font that worked under illustrator

This is what our old ps files (before cairo) looked like, they were actually converted from cgm files in the back with a software called "gplot" (very old, but i have the source code if you're interested). Hope this helps you.
Comment 8 Charles Doutriaux 2008-07-20 10:48:17 UTC
I had additional info about his from one of our users i'm attaching the eps next but here are his comments

--->>>>

I've dug up some info re the font problem.

1. From a web page having to do with Illustrator and problem eps files:

"If an EPS file [with an embedded font] is opened using Adobe Illustrator® on a computer that does not have the font installed, the font will be substituted. This is to prevent illegal use of the embedded font.

"Linking means to not incorporate the font information directly into the file, but to reference the font file as a separate component outside of the source file. This is not recommended because it requires that separate font files travel with the source file.

"Outlining, in general terms, turns a font into a set of paths... technically making it no longer a font (problem solved!). Outlining fonts typically will not result in a noticeable loss of quality, therefore this is the preferred way to handle fonts prior to saving an
EPS file." [But the font can then not be edited.]

2. The attached eps, generated with Matplotlib (i.e., Python), has Illustrator-editable text -- not in the form of outlines. But I don't believe the font is embedded and it also may not be TrueType. When I open the file in Illustrator I first get a similar error to what I reported before:

Font problems. Helvetica-Narrow: Default font substituted for missing font, etc.

In the CDAT case the font was identified as "f-0-0" and the figure opened with garbage characters. But with this figure the font substitution actually works. However, if I set the font in CDAT to Helvetica (x.setdefaultfont(4)) it is still identified by Illustrator (and in the eps file) as "f-0-0" and the figure opens with all the text stripped out, despite the "font substitution." Could there be a font naming issue?

Also, is it possible to specify a font without embedding it? One of the "standard" ps fonts might have to be used, but these might be more readily recognized and accepted by other programs such as Illustrator.

Hope this is helpful, and thanks (as usual!) for the assistance
<<<<------
Comment 9 Charles Doutriaux 2008-07-20 10:49:40 UTC
Created attachment 17769 [details]
example of eps whose font loading fail in illustrator but is replaced with other fonts
Comment 10 GitLab Migration User 2018-08-25 13:35:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/82.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.