File: //usr/local/share/man/man3/PDF::API2::Resource::CIDFont::CJKFont.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" 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
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. 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 3"
.TH PDF::API2::Resource::CIDFont::CJKFont 3 "2024-05-18" "perl v5.26.3" "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 \s-1CJK\s0 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 \s-1PDF\s0 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 \s-1CJK\s0 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 \s-1CJK\s0 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 \s-1CJK\s0 font object. The requested font will not be embedded in the \s-1PDF,\s0
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 \s-1UTF\-8,\s0 include an \f(CW\*(C`\-encode\*(C'\fR option with the encoding to be
used.
.RE