From 000b8df004b175781af5b071590cf3867ae16f3a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 21 Jan 2016 12:34:56 +0100 Subject: epub: Put font fallback chain in fz_font. fz_encode_character_with_fallback finds the first font in the fallback chain that has the glyph encoded, and if none do then try to encode a bullet character. --- include/mupdf/fitz/font.h | 4 ++++ include/mupdf/html.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/mupdf/fitz/font.h b/include/mupdf/fitz/font.h index b6ea3362..313f5ac8 100644 --- a/include/mupdf/fitz/font.h +++ b/include/mupdf/fitz/font.h @@ -68,6 +68,9 @@ struct fz_font_s /* cached encoding lookup */ uint16_t *encoding_cache[256]; + + /* fallback font chain */ + fz_font *fallback; }; /* common CJK font collections */ @@ -103,6 +106,7 @@ void fz_decouple_type3_font(fz_context *ctx, fz_font *font, void *t3doc); float fz_advance_glyph(fz_context *ctx, fz_font *font, int glyph); int fz_encode_character(fz_context *ctx, fz_font *font, int unicode); +int fz_encode_character_with_fallback(fz_context *ctx, fz_font *font, int unicode, fz_font **out_font); void fz_print_font(fz_context *ctx, fz_output *out, fz_font *font); diff --git a/include/mupdf/html.h b/include/mupdf/html.h index afa203ec..75d46313 100644 --- a/include/mupdf/html.h +++ b/include/mupdf/html.h @@ -153,7 +153,7 @@ struct fz_css_style_s fz_css_color background_color; fz_css_color border_color[4]; fz_css_color color; - fz_font *font, *fallback; + fz_font *font; }; enum -- cgit v1.2.3