Greetings, I have recently discovered the ability to use 'ttf' fonts when creating a PDF with PDF::API2. Everything seemed to be going very well, until I realised an issue with the kerning. Namely that there is no kerning.
my $headline_text = $page->text; my $tmpFont=$pdf->ttfont("../pdf/API2/fonts/Exmouth.ttf"); $headline_text->font( $tmpFont, 12 / pt ); $headline_text->fillcolor('black'); $headline_text->translate( 95 / mm, 131 / mm ); $headline_text->text_center('Testing Testing');
This correctly embeds the Exmouth ttf font, and correctly uses it. The resulting PDF uses the font (i.e. the letters look ok) however the character spacing is uniform..i.e. no kerning. I have tried various methods, including adding a -dokern option to the font. .. To no avail. Has anyone any experience in embedding ttf fonts? or come up against this issue? Many thanks in advance

In reply to PDF API2 Kerning by TienLung

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.