Does the libharu-RELEASE_2_3_0 support Russian text display?

150 Views Asked by At

I Checked the libharu-RELEASE_2_3_0,there are hpdf_encoder_cns.c,hpdf_encoder_cnt.c,hpdf_encoder_jp.c,hpdf_encoder_utf.c which code support Russian text ?

3

There are 3 best solutions below

4
Martin Zeitler On

The UTF-8 hpdf_encoder_utf.c should support Cyrillic letters.

0
yangkunvanpersie On
    HPDF_UseUTFEncodings(pdf);
HPDF_SetCurrentEncoder(pdf,"UTF-8");

detail_font_name = HPDF_LoadTTFontFromFile (pdf, "ttfont/arial.ttf", HPDF_TRUE);

title_font = HPDF_GetFont (pdf, "Helvetica", NULL);

detail_font = HPDF_GetFont (pdf, detail_font_name, "UTF-8");

yes,I use this code to generate pdf with Russian.but I have to embed arial.ttf into pdf . And the pdf size is sure large.Is there any solution to solve it ?

0
l.yang On

If you just do NOT want to embed used font into your generated PDF document, just use the following:

detail_font_name = HPDF_LoadTTFontFromFile (pdf, "ttfont/arial.ttf", HPDF_FALSE);

The result PDF will not have a font embedded, not even a subset. But this requires the PDF viewer to pick the right glyph.