PhilterPaper / Perl-PDF-Builder

Extended version of the popular PDF::API2 Perl-based PDF library for creating, reading, and modifying PDF documents
https://www.catskilltech.com/FreeSW/product/PDF%2DBuilder/title/PDF%3A%3ABuilder/freeSW_full
Other
6 stars 7 forks source link

[RT 128674] error "requested cmap '' not installed" with many CJK fonts #98

Closed PhilterPaper closed 5 years ago

PhilterPaper commented 5 years ago

perlbug [...] jgreely.com (ssimms/pdfapi2#32)

PDF::API2 version 2.033 Font::TTF version 1.06 Perl version 5.20.2

Sample code:

#!/usr/bin/env perl 
use PDF::API2; 
$pdf = PDF::API2->new(); 
$pdf->page(); 

$pdf->ttfont("NotoSansJP-Medium.otf"); 
# downloaded from here: 
# https://github.com/googlei18n/noto-cjk/blob/master/NotoSansJP-Medium.otf

dies with:

requested cmap '' not installed at /Users/Shared/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/PDF/API2/Resource/CIDFont/TrueType/FontFile.pm line 27.

About a third of the CJK fonts I have don't work with PDF::API2. I used Noto Sans JP in the above example because it's freely available, but it's not the only one, and at least one other PostScript-flavored OTF font that I own does work (DFKyoKaShoStd-W4.otf). Is there a workaround or a fix?

-j