From a94ecea1aa6d3ce994782a7dd1d531728463186e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 10 Feb 2016 18:08:23 +0100 Subject: Add bold/italic/monospaced/serif flags to fz_font. Use the flags when selecting a fallback font. --- source/xps/xps-glyphs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/xps') diff --git a/source/xps/xps-glyphs.c b/source/xps/xps-glyphs.c index 8cfbbafc..a87c2862 100644 --- a/source/xps/xps-glyphs.c +++ b/source/xps/xps-glyphs.c @@ -242,8 +242,10 @@ xps_lookup_font(fz_context *ctx, xps_document *doc, char *base_uri, char *font_u if (style_att) { - font->ft_bold = !!strstr(style_att, "Bold"); - font->ft_italic = !!strstr(style_att, "Italic"); + font->fake_bold = !!strstr(style_att, "Bold"); + font->is_bold = font->fake_bold; + font->fake_italic = !!strstr(style_att, "Italic"); + font->is_italic = font->fake_italic; } xps_select_best_font_encoding(ctx, doc, font); @@ -421,7 +423,7 @@ xps_parse_glyphs_imp(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, else advance = mtx.hadv * 100; - if (font->ft_bold) + if (font->fake_bold) advance *= 1.02f; if (is && *is) -- cgit v1.2.3