More...
Using the unicode version of libHaru (2.3.0-dev) and the
ttfont_demo_jp.c source, I generated a pdf file. Here are the
pertinent modifications:
HPDF_UseUTFEncodings( pdf );
detail_font_name = HPDF_LoadTTFontFromFile2 (pdf, "C:\\Windows\\Fonts\
\msgothic.ttc", 2, HPDF_TRUE);
detail_font = HPDF_GetFont (pdf, detail_font_name, "UTF-8");
/* draw japanese (Katakana) text: カテコリ (0x30AB, 0x30C6, 0x30B4,
0x30EA) */
HPDF_Page_MoveTextPos (page, 0, -48);
HPDF_Page_SetFontAndSize (page, detail_font, 48);
HPDF_Page_ShowText (page, "カテゴリ"); // utf8 byte stream:
E382AB E383C6 E382B4 E383AA
The resulting PDF shows the two fonts - /F1=Helvetica to display the
font name + encoding, MS-UIGothic (UTF-8), and /F2=MS UI Gothic to
display the text. The text seems to be the correct utf8 byte stream.
However, the pdf displays boxes for the text.
/F1 10 Tf
BT
10 190 Td
(MS-UIGothic) Tj
( \050) Tj
(UTF-8) Tj
(\051) Tj
0 -48 Td
/F2 48 Tf
<E382ABE38386E382B4E383AA32> Tj
The byte stream has 3 bytes per japanese character. Does this mean
that libHaru does not support this encoding? How could it be modified
to do so? Or, am I missing something else that I need to do?
Thanks for any help.