summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-encoding.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-13 21:49:56 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-13 23:45:37 +0100
commit672b9afb9bb05a67bbcd8664ba268521ea728ca6 (patch)
tree24699741d5cf8d71ac8f5d000722e82388a97bc7 /source/pdf/pdf-encoding.c
parenta06709ac88453bbfeff46ddaa62492172183b1a7 (diff)
downloadmupdf-672b9afb9bb05a67bbcd8664ba268521ea728ca6.tar.xz
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.
Diffstat (limited to 'source/pdf/pdf-encoding.c')
-rw-r--r--source/pdf/pdf-encoding.c59
1 files changed, 2 insertions, 57 deletions
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 <string.h>
#include <stdlib.h>
+#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;
-}