Summary: | Cairo generated postscript files, fail to load under Adobe Illustrator (CS2) | ||
---|---|---|---|
Product: | cairo | Reporter: | Charles Doutriaux <doutriaux1> |
Component: | postscript backend | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | high | CC: | doutriaux1 |
Version: | 1.4.10 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Example of ps with fonts, that cannot be imported in Adobe Illustrator
example of the same file w/o fonts that works great under illustrator example of our old ps files which had font that worked under illustrator example of eps whose font loading fail in illustrator but is replaced with other fonts |
Description
Charles Doutriaux
2007-11-28 13:52:04 UTC
Created attachment 12799 [details]
Example of ps with fonts, that cannot be imported in Adobe Illustrator
Created attachment 12800 [details]
example of the same file w/o fonts that works great under illustrator
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. 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? 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"? (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. 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.
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 <<<<------ Created attachment 17769 [details]
example of eps whose font loading fail in illustrator but is replaced with other fonts
-- 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.