summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorRyan Farley <ryan.farley@gmx.com>2019-08-20 03:16:22 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2019-12-04 06:25:24 +0000
commit5d446a02a7422d3a61f74b8d1c28b7b551ea06fd (patch)
tree2ac2ade99e6a8ee2df7acca142af49dc9c6070bc /read.c
parent6fc84fb2c0d4ac0b3b66330057bb90418cc1eb28 (diff)
let freetype handle ISO-8859-1 mapping
https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_encoding indicates that ISO-8859-1 is automatically mapped to Unicode for BDF and PCF fonts -- trying to use FT_Select_Charmap() with FT_ENCODING_NONE leads to an error for such fonts.
Diffstat (limited to 'read.c')
-rw-r--r--read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/read.c b/read.c
index 632c7e7..5e80cc5 100644
--- a/read.c
+++ b/read.c
@@ -79,10 +79,13 @@ readFile(char *filename, FontPtr font)
return -1;
}
+ /* FreeType will handle Unicode and automatically map ISO-8859-1 to
+ * Unicode for us -- everything else needs a mapping */
encoding_name = faceEncoding(face);
if(encoding_name == NULL) {
symbol = 1;
- } else if(strcasecmp(encoding_name, "iso10646-1") != 0) {
+ } else if((strcasecmp(encoding_name, "iso10646-1") != 0) &&
+ (strcasecmp(encoding_name, "iso8859-1") != 0)) {
if(reencode_flag)
mapping = FontEncMapFind(encoding_name,
FONT_ENCODING_UNICODE, 0, 0, NULL);