diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-03-15 11:55:06 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-03-16 14:51:41 +0100 |
commit | 1cd2046b3cce264a3d13481652868fd1c31537fc (patch) | |
tree | 8ba181113cc22f2ffe4ba1a3ed549926b747bc8c /include | |
parent | 2612c20b725319833caeef36ccf4240f34e0e24b (diff) | |
download | mupdf-1cd2046b3cce264a3d13481652868fd1c31537fc.tar.xz |
Add simple fonts with 8-bit greek and cyrillic encodings.
Use KOI8-U for Cyrillic, and ISO 8859-7 for Greek.
Use with 'mutool create' using an extra argument to the %%Font directive:
%%Font TmRmC Times-Roman Cyrillic
BT
/TmRmC 16 Tf 10 10 Td
<fa c4 d2 c1 d7 d3 d4 d7 d5 ca d4 c5 21> Tj
ET
The alternatives are "Latin", "Greek", and "Cyrillic".
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/pdf/font.h | 8 | ||||
-rw-r--r-- | include/mupdf/pdf/resource.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/mupdf/pdf/font.h b/include/mupdf/pdf/font.h index 730d3459..dae52d3e 100644 --- a/include/mupdf/pdf/font.h +++ b/include/mupdf/pdf/font.h @@ -30,6 +30,12 @@ extern const char * const pdf_mac_expert[256]; extern const char * const pdf_win_ansi[256]; extern const char * const pdf_standard[256]; +extern const char * const pdf_glyph_name_from_koi8u[128]; +extern const char * const pdf_glyph_name_from_iso8859_7[128]; + +int pdf_cyrillic_from_unicode(int u); +int pdf_greek_from_unicode(int u); + typedef struct pdf_font_desc_s pdf_font_desc; typedef struct pdf_hmtx_s pdf_hmtx; typedef struct pdf_vmtx_s pdf_vmtx; @@ -123,7 +129,7 @@ float pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, void pdf_run_glyph(fz_context *ctx, pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nested_depth, fz_default_colorspaces *default_cs); -pdf_obj *pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font); +pdf_obj *pdf_add_simple_font(fz_context *ctx, pdf_document *doc, fz_font *font, int encoding); pdf_obj *pdf_add_cid_font(fz_context *ctx, pdf_document *doc, fz_font *font); pdf_obj *pdf_add_cjk_font(fz_context *ctx, pdf_document *doc, fz_font *font, int script); diff --git a/include/mupdf/pdf/resource.h b/include/mupdf/pdf/resource.h index 885a404e..05de95b2 100644 --- a/include/mupdf/pdf/resource.h +++ b/include/mupdf/pdf/resource.h @@ -18,6 +18,7 @@ void pdf_empty_store(fz_context *ctx, pdf_document *doc); */ enum { PDF_SIMPLE_FONT_RESOURCE=1, PDF_CID_FONT_RESOURCE=2, PDF_CJK_FONT_RESOURCE=3 }; +enum { PDF_SIMPLE_ENCODING_LATIN, PDF_SIMPLE_ENCODING_GREEK, PDF_SIMPLE_ENCODING_CYRILLIC }; pdf_obj *pdf_find_font_resource(fz_context *ctx, pdf_document *doc, int type, int encoding, fz_buffer *item, unsigned char md5[16]); pdf_obj *pdf_insert_font_resource(fz_context *ctx, pdf_document *doc, unsigned char md5[16], pdf_obj *obj); |