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 130040] Mention cannot make synthetic cjkfont #104

Closed PhilterPaper closed 4 years ago

PhilterPaper commented 5 years ago

Wed Jul 10 22:02:59 2019 jidanni [...] jidanni.org - Ticket created

We read

$font = $pdf->synfont($basefont, [%options])

Returns a new synthetic font object. OK, but mention cannot use with cjkfonts:

my $font = $pdf->cjkfont('traditional');
$font2 = $pdf->synfont($font, -slant => 0.85);

Makes a mess out of a document.

[Verify and update documentation as necessary]

PhilterPaper commented 4 years ago

Investigated, and indeed, synfont does not produce a good synthesized font when used against a base font file created with cjkfont. Confirmed that it works properly for corefont, psfont, and ttfont. As with the failure to embed CJK files (RT 130041, #105), this has something to do with the internal format of the CJK font file, and possibly its history of external Cmap and Data files. At this point, it doesn't appear to be worth extensively reworking the innards of CJK fonts, but if someone wants to dive into the code and find a fix, you're welcome to. I have updated the documentation to inform users that synfont cannot be used on cjkfont fonts.

Closed, in release 3.016.