From 672b9afb9bb05a67bbcd8664ba268521ea728ca6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 Nov 2018 21:49:56 +0100 Subject: Add more encoding tables. Add tables for Windows-1250, Windows-1251, and ISO-8859-1. Also add unicode_from_encoding tables. Move encodings from PDF namespace to Fitz. --- source/pdf/pdf-encoding.c | 59 ++--------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) (limited to 'source/pdf/pdf-encoding.c') diff --git a/source/pdf/pdf-encoding.c b/source/pdf/pdf-encoding.c index f4fe584c..bf0d3df8 100644 --- a/source/pdf/pdf-encoding.c +++ b/source/pdf/pdf-encoding.c @@ -7,6 +7,8 @@ #include #include +#define pdf_win_ansi fz_glyph_name_from_windows_1252 + void pdf_load_encoding(const char **estrings, const char *encoding) { @@ -85,60 +87,3 @@ pdf_lookup_agl_duplicates(int ucs) } return empty_dup_list; } - -int pdf_cyrillic_from_unicode(int u) -{ - int l = 0; - int r = nelem(koi8u_from_unicode) - 1; - if (u < 128) - return u; - while (l <= r) - { - int m = (l + r) >> 1; - if (u < koi8u_from_unicode[m].u) - r = m - 1; - else if (u > koi8u_from_unicode[m].u) - l = m + 1; - else - return koi8u_from_unicode[m].c; - } - return -1; -} - -int pdf_greek_from_unicode(int u) -{ - int l = 0; - int r = nelem(iso8859_7_from_unicode) - 1; - if (u < 128) - return u; - while (l <= r) - { - int m = (l + r) >> 1; - if (u < iso8859_7_from_unicode[m].u) - r = m - 1; - else if (u > iso8859_7_from_unicode[m].u) - l = m + 1; - else - return iso8859_7_from_unicode[m].c; - } - return -1; -} - -int pdf_winansi_from_unicode(int u) -{ - int l = 0; - int r = nelem(winansi_from_unicode) - 1; - if (u < 128) - return u; - while (l <= r) - { - int m = (l + r) >> 1; - if (u < winansi_from_unicode[m].u) - r = m - 1; - else if (u > winansi_from_unicode[m].u) - l = m + 1; - else - return winansi_from_unicode[m].c; - } - return -1; -} -- cgit v1.2.3