Font Module
Reported by TomasC | July 21st, 2008 @ 11:34 PM
Hi guys,
tried to used prawn on a Rails project (together with prawn_view http://github.com/thorny-sun/pra... and run into a clash with Font module.
My app has a model called Font. After installing prawn, any controller using my Font model throws "undefined method `find' for Font:Module". Not exactly sure why.
Any suggestions?
Thanks,
T
P.S. greeting to New Haven -- I moved out at the end of June -- finally! ;-)
Comments and changes to this ticket
-

Gregory Brown July 21st, 2008 @ 11:39 PM
- → State changed from new to open
Hi Tomas,
This is because Prawn vendors the Font::TTF library, which defines a top level Font module. If you set up a namespace for your model, you can avoid this problem.
-greg
-

TomasC July 21st, 2008 @ 11:54 PM
Hey Greg,
thanks for prompt reply.
Well I guess that's a solution ... yet ... couldn't prawn be completely encapsulated in its own namespace?
T
-

Gregory Brown July 22nd, 2008 @ 12:03 AM
Prawn is. That is to say, all of the code we have written is within the Prawn namespace.
Font::TTF is a separate package which has its own namespace (Font), which your model is clashing with.
I could move Font::TTF into the Prawn namespace but that'd really be overstepping boundarys, IMO. We aren't maintaining Font::TTF, and we want all the necessary praise / blame to go back to the original author of that library.
Font::TTF is a dependency, if that helps clarify things. It's only vendored in Prawn for convenience, you'd have the same problem if we depended on a gem of it.
-

TomasC July 22nd, 2008 @ 12:13 AM
Understand, that makes sense.
I have two questions if I may ask:
- is there a way to implement support for OTF fonts?
- is there a way to 'outline' all text so the pdf does no longer contain the embeded font file but is rather a set of curves (outlines)?
-

-

Gregory Brown July 22nd, 2008 @ 12:26 AM
- → State changed from open to resolved
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Prawn is a fast and nimble PDF generator written in pure Ruby. You can find the code on Github: http://github.com/sandal/prawn
When you file a ticket, please tag bug reports with 'defect' and feature requests with 'request'. Please do not attach patches to tickets, instead submit them by sending a pull request on Github.
Please use the mailing list for discussion, and Github for patching. The bug tracker is well... a bug tracker. If you've got rough ideas for things you'd like to see or encounter a problem that you aren't sure is a bug, use the mailing list before filing a ticket.
