Re: Embedded TTF Font Problem

140 views
Skip to first unread message

James Healy

unread,
Feb 15, 2013, 8:43:58 PM2/15/13
to prawn...@googlegroups.com
Prawn PDFs are usually sufficiently plain text to use diff on, so
here's a diff on your two files:

https://gist.github.com/yob/4965056

The changes seem to mostly be Hash ordering - no significant
differences jump out at me.

The heading in the production files works fine for me in evince 3.4 on
linux and Acrobat Pro X on windows. What reader are you testing in?

James

On 16 February 2013 09:46, ammulder <ammu...@gmail.com> wrote:
> I have a bizarre problem with an embedded font. I generate PDFs that always
> use the same text in the same position in the same embedded font in the page
> framing, and the text appeared weird -- only the occasional letter would
> print and the rest was blank. When I updated from 0.12.0 to 1.0.0.rc1 that
> problem went away, and all the text appeared. I assumed that was due to
> issue #158 which was fixed.
>
> I run this app on a shared server, and one day, the server started
> manifesting that bug again. It turned out there were some 0.12.0 gems
> kicking around in my account here and there, and I've dutifully flushed them
> to the best of my ability (I have no idea what other sites on the same
> machine are doing, but it's running via passenger with everyone installing
> most gems locally, so there shouldn't be interference). Yesterday after the
> cleanup it was working. Today after restarting the app again, the bad text
> is back. On my local development machine everything looks good in the PDFs,
> but on the server it's like it was before upgrading to rc1. I've checked
> all the ttf.rb files I can find on the server for the #158 fix, and they
> have it, so perhaps this is not strictly related to that?
>
> I've attached an example of two files that should be identical, one
> generated on the server (prod) and one on my laptop (dev) and you can see
> the text in the header ("CAR WARS COMBAT GARAGE") is whacked in the prod
> one. I'm not sure what's causing it to be so, though I assume it has
> something to do with the embedded font metrics. But same font, same text,
> same size, same position, virtually the same rest of the page (I expect only
> the date stamp on the page to be different), as far as I can tell same
> versions of Prawn and TTFunk... I don't know how to account for the
> difference.
>
> I only know enough PDF to be dangerous, so I don't have a great way to
> diagnose exactly how the files differ, and certainly not why. Any help
> would be greatly appreciated!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prawn" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prawn-ruby+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

James Healy

unread,
Mar 4, 2013, 7:10:59 PM3/4/13
to prawn...@googlegroups.com
On 5 March 2013 11:07, Dan Dailey <dan.d...@gmail.com> wrote:
> My guess is that perhaps something in Preview changed? Perhaps with a recent
> OSX update? I'm guessing that only because I'm pretty sure I've not changed
> anything in my code that would matter...

Thanks for the details Dan. I'll see if I can find a mac to test
ammulder's PDFs on.

James

ammulder

unread,
May 9, 2013, 10:51:15 AM5/9/13
to prawn...@googlegroups.com
I am on a Mac, for what it's worth, and I probably only tried the files in Preview.

I've switched to an image of the text until we think there's a resolution for this issue, though that's obviously not my preferred approach.  I can't afford for some subset of my users to see garbled files, even if it's ultimately a Preview problem.

Thanks,
       Aaron

Dan Dailey

unread,
May 9, 2013, 11:52:04 AM5/9/13
to prawn...@googlegroups.com
I ended up embedding an image as well. It was the only option I could make work. Some of the reports I am generating are 50-100 pages and images make them much slower to render than embedded fonts, but it's the only thing that did the trick.
Reply all
Reply to author
Forward
0 new messages