From 19412d9ac3fb7f00346273cfe914601c844f5872 Mon Sep 17 00:00:00 2001 From: Christopher Zimmermann Date: Sat, 18 Jul 2020 08:39:01 +0200 Subject: Add warnings when wrapping multiple fonts and on PCF fonts --- read.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'read.c') diff --git a/read.c b/read.c index db79a59..26443ff 100644 --- a/read.c +++ b/read.c @@ -29,6 +29,7 @@ THE SOFTWARE. #include FT_FREETYPE_H #include FT_MODULE_H #include FT_BDF_H +#include FT_FONT_FORMATS_H #include "X11/Xos.h" #include "fonttosfnt.h" #include "X11/fonts/fontenc.h" @@ -102,7 +103,7 @@ readFile(char *filename, FontPtr font) BitmapPtr bitmap; int symbol = 0; int force_unicode = 1; - char *encoding_name = NULL; + const char *encoding_name, *file_format; FontMapPtr mapping = NULL; FontMapReversePtr reverse = NULL; @@ -133,6 +134,15 @@ readFile(char *filename, FontPtr font) return -1; } + file_format = FT_Get_Font_Format(face); + if(strcmp(file_format, "BDF") != 0) + fprintf(stderr, + "font file %s is of format %s.\n" + "It's recommended to convert directly from a BDF font.\n" + "Some font properties may get lost when converting via a PCF font.\n", + filename ? filename : "", + file_format); + /* FreeType will insist on encodings which are simple subsets of unicode * to be read as unicode regardless of what we call them. */ for(j = 0; j < face->num_charmaps; ++j) { -- cgit v1.2.3