It works! I think my (and perhaps Andrea's) mistake was assuming that the PDF::API2 "core fonts" were the same as the standard TrueType fonts of the same name -- in my case, the version of Times New Roman in the Windows Fonts folder. When I changed your font line in the script above to this:

my $font = $pdf->ttfont('C:/Windows/Fonts/times.ttf');

I got the appropriate Unicode text in my PDF, in Times New Roman. The standard TrueType versions of Times New Roman, Verdana, and other fonts that come with Windows and probably other systems do support at least the basic Greek character set. That was why I assumed that the core fonts "should" support Greek. Thanks for your help!

Thanks, too, for the recommendation for the DejaVu fonts. They seem like nice ones! I am kind of a font hoarder, especially for useful Unicode ones. For the extended Greek character set, diacritics and such, I also like the New Athena fonts (one of which supports the inverted breve circumflex, as opposed to the tilde circumflex many use).

http://www.fontspace.com/american-philological-association/new-athena-unicode

Correction once again: New Athena is a nice one, but it's Gentium and GentiumAlt that have the inverted breve circumflex:

http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=gentium


In reply to Re^3: PDF::API2 / unicode characters by LonelyPilgrim
in thread PDF::API2 / unicode characters by PerlSci

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.