-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Some Microsoft fonts produce unreadable EPS #5862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like the EPS file is leaving in lines that should be commented:
|
Something going wrong with the carriage returns right before
|
I assume this on windows? |
Indeed. FWIW, the EPS wouldn't open on Linux either. I removed the carriage returns from |
I meant generated on windows. On Sun, Jan 17, 2016, 09:06 Pete Bachant notifications@github.com wrote:
|
That line comes directly from the #5414 will hopefully someday address this by replacing the font-subsetting code. |
Nope, unfortunately, setting |
I suppose there is no fix yet to the problem? |
I used this as a workaround for now: def fix_eps(fpath):
"""Fix carriage returns in EPS files caused by Arial font."""
txt = b""
with open(fpath, "rb") as f:
for line in f:
if b"\r\rHebrew" in line:
line = line.replace(b"\r\rHebrew", b"Hebrew")
txt += line
with open(fpath, "wb") as f:
f.write(txt) |
Great, thanks. |
If this adds anything to solving the problem, I don't face the problem on win7 (only on win8.1). Can't check win10 at the moment. |
@mdboom Can you point me to where this code is? Is this something we can report upstream against windows (or who ever the source of that font file is)? |
FYI, the problem appears on win10 as well. |
@tacaswell: The new font subsetting code lives in freetypy -- not done yet, but it already might do better on this particular problem. https://github.com/matplotlib/freetypy/blob/master/lib/freetypy/subset.py I believe Microsoft releases Arial, but I doubt we'll convince them to fix it -- I think more likely we'll have to work around it, even if it's to hardcode a workaround to particular non-standard fonts like this. |
#6525 has pointed out that this occurs with Calibri as well. |
Using Arial as
font.sans-serif
in a figure will produce an EPS file that can't be opened or converted to PDF. In my case, using any other font, e.g. Bitstream Vera Sans or Liberation Sans produces a valid EPS.The text was updated successfully, but these errors were encountered: