.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PDF::API2::Resource::CIDFont::CJKFont 3pm" .TH PDF::API2::Resource::CIDFont::CJKFont 3pm 2024-05-17 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME PDF::API2::Resource::CIDFont::CJKFont \- Deprecated base class for CJK fonts .SH DESCRIPTION .IX Header "DESCRIPTION" This is not the CJK font support you are looking for. It dates back to the days when Unicode was young and poorly supported. PDFs created using this class are not portable. .PP Instead, use a regular TrueType or OpenType font that includes Unicode support and create your PDF normally: .PP .Vb 2 \& use PDF::API2; \& use utf8; \& \& my $pdf = PDF::API2\->new(); \& my $font = $pdf\->font(\*(Aq/path/to/font.ttf\*(Aq); \& my $page = $pdf\->page(); \& my $content = $page\->text(); \& $content\->font($font, 24); \& \& # Chinese \& $content\->translate(72, 72 * 9); \& $content\->text(\*(Aq你好\*(Aq); \& \& # Japanese \& $content\->distance(0, \-72); \& $content\->text(\*(Aqこんにちは\*(Aq); \& \& # Korean \& $content\->distance(0, \-72); \& $content\->text(\*(Aq안녕하세요\*(Aq); \& \& $pdf\->save(\*(Aqhello.pdf\*(Aq); .Ve .PP Note: The maintainer is not familiar with CJK languages and has deprecated this class based on his current understanding of Unicode and from reading many bug reports. If you are successfully using the CJK support from this class and think it should not be deprecated, please contact him to discuss. .SH "DEPRECATED METHODS" .IX Header "DEPRECATED METHODS" .ie n .IP "$font = $class\->new($pdf, $cjk_font_name, %options)" 4 .el .IP "\f(CW$font\fR = \f(CW$class\fR\->new($pdf, \f(CW$cjk_font_name\fR, \f(CW%options\fR)" 4 .IX Item "$font = $class->new($pdf, $cjk_font_name, %options)" Returns a CJK font object. The requested font will not be embedded in the PDF, so it will only be readable on computers that have the font installed. .Sp Available fonts: .RS 4 .IP "Chinese (Traditional)" 4 .IX Item "Chinese (Traditional)" Ming, Ming-Bold, Ming-Italic, and Ming-BoldItalic .IP "Chinese (Simplified)" 4 .IX Item "Chinese (Simplified)" Song, Song-Bold, Song-Italic, and Song-BoldItalic .IP Korean 4 .IX Item "Korean" MyungJo, MyungJo-Bold, MyungJo-Italic, and MyungJo-BoldItalic .IP "Japanese (Mincho Serif)" 4 .IX Item "Japanese (Mincho Serif)" KozMin, KozMin-Bold, KozMin-Italic, and KozMin-BoldItalic .IP "Japanese (Gothic Sans Serif)" 4 .IX Item "Japanese (Gothic Sans Serif)" KozGo, KozGo-Bold, KozGo-Italic, KozGo-BoldItalic .RE .RS 4 .Sp If the text isn't UTF\-8, include an \f(CW\*(C`\-encode\*(C'\fR option with the encoding to be used. .RE