Jason (jcreed) wrote,

Poking around with the little pdf-generation sml library I wrote a while ago. Didn't get a whole lot of anything new done (just added curveto and stroke) Here's a demo anyway. Trying to figure out the right thing to do about fonts is really annoying. On the one hand, PDF supports "Type 3" fonts, which aren't exactly PS Type 3 fonts, but they're the exact PDF analogue: glyphs are arbitrary PDF code. The bad thing is that, as far as I can tell, they only support 8-bit encodings, so I would have to translate all use of unicode into constant codepage-switching. The other option is just to stay with truetype support, which supports (via somewhat evil CIDFont machinery) UTF-8 and has the advantage of making it likely easier to use pre-existing fonts. The only problem there is that you really do need to extract the metrics from the font file to do anything useful. So there either I would shore up my shaky-house-of-cards truetype-parsing code, or else rely on something like fontforge to extract metrics for me. I'm kind of leaning towards the latter. I'm not eager to handle all the zillion special cases of TTF.
Tags: fonts, pdf, programming, sml
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded