I'm trying to render a HTML page to PDF. But everytime I do this, and a font is not installed I just get random characters. -> http://cl.ly/WYCN . Also, When using a font like Helvetica a web preview via Gmail still shows these characters. I'd like to use a custom TTF font too.
What I've tried:
- Rendering the HTML with Helvetica -> Seems to work on all OS's but Web Preview.
- Rendering the HTML with Source Sans Pro (open source font, .ttf) -> Does only work on systems having Source Sans Pro installed. I did include the TTF in the bundle, added it to "Fonts required by application" and it's showing up with
[UIFont familyNames]
. - Adding
@font-face
in HTML for using Source Sans Pro
Is there any chance I can embed a font into a PDF using UIGraphicsBeginPDFContextToData
?
Thanks