You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the gem, it's come very handy in a lot of cases. I'm having an issue with textbox and a registered font, in this case, Roboto. When I load up a pdf with roboto and register the font, attempting to create a textbox raises the following error:
NoMethodError (undefined method ``[]' for nil:NilClass)
After a bit of debugging, I've figured out that the problem is with this line:
From what I can tell, when the font Robot is being registered the font metrics aren't being loaded appropriately, so the wx field is present but the boundingbox field is not.
The text was updated successfully, but these errors were encountered:
Thanks for the response. I've attached a sample pdf I use to get the font. I managed to get the font working by using ttfunk to manually extract metrics, but it tended to overestimate sizes and messed up alignment and the like. roboto_sample.pdf
Hello!
Thank you for the gem, it's come very handy in a lot of cases. I'm having an issue with textbox and a registered font, in this case, Roboto. When I load up a pdf with roboto and register the font, attempting to create a textbox raises the following error:
NoMethodError (undefined method ``[]' for nil:NilClass)
After a bit of debugging, I've figured out that the problem is with this line:
height = metrics_array.map { |m| m ? m[:boundingbox][3] : 0 } .max
From fonts.rb:141.
From what I can tell, when the font Robot is being registered the font metrics aren't being loaded appropriately, so the wx field is present but the boundingbox field is not.
The text was updated successfully, but these errors were encountered: