Character spacing changes after importing .eps file

Post questions on how to use or achieve an effect in Inkscape.
aalnaif
Posts: 2
Joined: Sat Nov 12, 2011 11:10 am

Character spacing changes after importing .eps file

Postby aalnaif » Sat Nov 12, 2011 11:25 am

Hi,
I am trying to import a .eps file so that I can use Inkscape to crop it, and then re-save it as a .eps. However, when I try to import the file into Inkscape, it distorts the text within the image (i.e., the characters become squished together, or become farther apart). Is this a common occurence? Why might this be happening?

Also, when I'm importing the .eps file, it seems like Inkscape tries to automatically try recognize the text. Is there a way to prevent it from doing this, and just treat the text as an image? I feel like, if I just prevent it from recognizing the text, I wouldn't get accompanying text distortion.

Here's the file (before text distortion):
http://www.mediafire.com/?9c5ioco0ighjffh

In case it matters, I am using Inkscape 0.48, and my operating system is Mac OS X 10.6.8

PatJr
Posts: 81
Joined: Fri Jul 29, 2011 5:35 am

Re: Character spacing changes after importing .eps file

Postby PatJr » Sun Nov 13, 2011 2:29 am

the file wouldn't dl for me?? probably something on my end

I'll take a guess at a font issue, you might get better luck if you have the same font installed on your system that is being used in the eps file
even with that, I have only had iffy luck with text being imported or even opened from svg files
if you can have the fonts outlined/curved before it saved as an eps file

Pat Jr.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Character spacing changes after importing .eps file

Postby brynn » Sun Nov 13, 2011 6:34 am

Welcome to InkscapeForum!

I'm not very familiar with EPS, and not at all with Macs. But I know that when one imports certain formats (besides SVG), there is a dialog with an option(s) about how to handle text. So you might try the import again, and look to see if you get any sort of dialog.

It sounds like you might have lost the kerning. I have a vague memory of a bug like this, but don't remember enough to search out the specifics. Or it could be a problem with the font. Inkscape tends to be picky about fonts. If you don't plan to edit the text, you might be able to convert the text to path (before importing, i.e. in another program). (And that's actually one of the above mentioned options, when importing some formats.) But note that you won't be able to edit the text as text after doing so. If you expect you might need to edit the text later, you could save a copy of the text, perhaps on a hidden layer, and then go ahead and convert to paths. But again, that would have to happen before you import it, if you don't get a dialog with such an option when you import.

I also can't download your file, but I've had trouble with MediaFire in the past. Someone else should be along who can download and open it, but if not, you're welcome to attach it to a reply. I'm pretty sure EPS is accepted. (Unfortunately, I don't have an EPS file to experiment with.)

And finally, when you say you want to use Inkscape to "crop" it -- you know that Inkscape doesn't have a cropping tool, right? Inkscape's equivalent tool is called Clipping, and does not technically remove the clipped portions. It essentially covers up the unwanted areas. So if you want to truly crop it, I would suggest using another program. Unfortunately, not being familiar with EPS, I can't recommend another program. (But others should be able to, if that's what you need.)

I wish I could be more helpful :D

aalnaif
Posts: 2
Joined: Sat Nov 12, 2011 11:10 am

Re: Character spacing changes after importing .eps file

Postby aalnaif » Sun Nov 13, 2011 7:48 am

Hi,
Thanks for your help. When I try to import the .eps file, I do get a dialog box, and there is a "Text handling" menu. However, that menu only has one option: "Import text as text". If this menu had another option, I'm sure that that would solve my problem.

I should also mention that this problem also occurs if I save the image as a PDF instead of EPS, and when I try to import the PDF, the "Text handling" menu still has only that option.

Also, selecting "Text->Remove Manual Kernels" does not fix my problem.

That's weird that the download doesn't work, because it seems to work for me. How can I attach a file to the reply?

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Character spacing changes after importing .eps file

Postby brynn » Sun Nov 13, 2011 5:51 pm

Using the full editor (Post Reply button) rather than Quick Reply, look below Submit button for "Upload attachments" tab, and follow prompts. For me, all I will be able to do is try to import it, and confirm whether I can reproduce the problem or not. Others might be able to do more though.

Removing manual kerns won't help. I think the problem might be that importing the text EPS file somehow caused the kerning that comes with the font to be removed, or stripped out. I saw a message the other day where there is a bug which causes that to happen, but I can't remember what file formats were involved with that. I've tried searching for it, but can't find it, which probably means that it did not involve and EPS file. That doesn't mean the bug doesn't happen with EPS, just that I can't confirm that it does or doesn't. But as I said, Inkscape can be picky about fonts.

Well, you might be able to do a test to confirm whether it's the font itself, or something else. I'm not clear the source of the file, or whether you created it or what. But if you can, use the program that created it, and make a copy of it. Change the font to something very standard, like Arial or Times New Roman, and save it. Then try importing to Inkscape to see if the same thing happens.

For that matter, if you have the program that created it, you could just convert the text to paths there, and solve the whole problem. And since I already mentioned that, it probably means that you don't have the program. (Duh!)

OR, here's another idea. What happens if you import to Inkscape, and then change the font? (Use the Text tool.) IF the problem is the kerning getting stripped out, then changing the font should put it back in. And especially if you happen to have that font installed, problem solved!

Of course there's always the chance that the kerns have nothing to do with it. But I guess we'll know more about that when we can download the file :D

Oh, I just thought of something simple! Sometimes when I look at an Inkscape file with text in it, at anything other than 100% zoom, the text appears a lot like you've described. So it might be a good idea to check on that :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Character spacing changes after importing .eps file

Postby ~suv » Sun Nov 13, 2011 10:05 pm

Question:
Do you have the font "CMR10" installed (and is it listed in Inkscape's font list)?

Explanation:
The EPS file references two fonts: 'CMR10' ("Computer Modern" - a font most often used in files generated with LaTeX) and Helvetica. 'CMR10' is embedded and subsetted in the EPS file, 'Helvetica' is assumed to be used from the installed system fonts.

Inkscape 0.48 cannot make use of embedded fonts in PDF/PS/EPS files, nor can it convert text to paths (i.e. outline text) on import. If Inkscape cannot find a referenced font when converting the (EPS -> PDF) file to an SVG structure, it uses the fallback font 'Sans' (usually Bitstream Vera Sans) to render the text.

Text in imported PDF/PS/EPS files is absolutely kerned i.e. each letter is positioned absolutely [1]. If a different (fallback) font is used to render the characters, the kerning (distance between individual letters) of course no longer matches (because the absolute positioning of each character can't be automatically updated when a different font is used to render them). Additionally, editing such text in Inkscape only works if the "manual" kerning has been removed. This is all explained in [1], which still applies to current Inkscape versions.

[1] Release notes 0.46 > PDF and AI Import (see "Text editing tips")

Workarounds:
What you could do: install the font 'CMR10' into '~/Library/Fonts' or '~/.fonts', restart Inkscape, open the EPS file and see whether Inkscape is able to use the correct font.

If this fails, you could manually change the font used for the serif texts to a serif font installed on your system (e.g. "Times New Roman") in Inkscape (switch to the text tool, click on a serif text object and choose a different font from the font drop down list on the text tool controls bar) - it might not be a perfect match, but still look more pleasing than the "broken" kerning with the fallback font 'Sans'.

Alternatively:
  1. There are Ghostscript commands which allow to outline fonts in EPS/PS files (use Google). One example:

    Code: Select all

    gs -q -dNOPAUSE -dBATCH -dSAFER -dNOCACHE -sDEVICE=epswrite -sOutputFile=inkscape_question-outlined.eps inkscape_question.eps
    convert the EPS file and then open the converted EPS (inkscape_question-outlined.eps) file in Inkscape: all text will be outlined (convert to path) using the embedded fonts.
  2. If you happen to have Evince installed (via MacPorts), convert the EPS file to PDF:

    Code: Select all

    ps2pdf -dEPSCrop inkscape_question.eps inkscape_question.pdf
    open the PDF file (inkscape_question.pdf) in evince

    Code: Select all

    evince inkscape_question.pdf
    and print to SVG (select 'Print to File' from the printer list, and the output format 'SVG') -> this will create an SVG file with outlined fonts based on the embedded fonts in the PDF file (inkscape_question-evince.svg).
  3. If you happen to have a recent development snapshot of Inkscape installed (the official osx nightly builds hosted on modevia are no longer available unfortuntately, but MacPorts offers 'inkscape-devel'), you can convert the EPS file to PDF (see above), launch inkscape and open the converted PDF file with the explicitly chosen file format "Adobe PDF via poppler-cairo (*.pdf)". This basically produces the same SVG structure as does printing to SVG via Evince (inkscape_question-inkscape-poppler.svg).

Converted files:
Attachments
inkscape_question-outlined-eps.svg
inkscape_question-outlined.eps opened in Inkscape and saved as 'Inkscape SVG' (without further edits)
(156.95 KiB) Downloaded 219 times
inkscape_question-evince.svg
(125.16 KiB) Downloaded 210 times
inkscape_question-inkscape-poppler.svg
(159.43 KiB) Downloaded 227 times


Return to “Help with using Inkscape”