From b9f7b021f320c8f6b4879ddc20acf11976bd5add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Sat, 22 Feb 2014 19:37:57 +0100 Subject: Bug 694851: pass more information to fz_load_system_font The following changes allow font providers to make better choices WRT what font to provide and under what circumstances: * bold and italic flags are passed in so that implementors can decide themselves whether to ask for simulated boldening/italicising if a font claims not to be bold/italic * is_substitute is replaced with needs_exact_metrics to make the meaning of this argument hopefully clearer (that argument is set only for PDF fonts without a FontDescriptor) * the font name is always passed as requested by the document instead of the cleaned name for the standard 14 fonts which allows distinguishing e.g. Symbol and Symbol,Bold --- source/fitz/font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/fitz') diff --git a/source/fitz/font.c b/source/fitz/font.c index 45d75f95..4e676361 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -240,7 +240,7 @@ void fz_install_load_system_font_funcs(fz_context *ctx, fz_load_system_font_func ctx->font->load_cjk_font = f_cjk; } -fz_font *fz_load_system_font(fz_context *ctx, const char *name, int is_substitute) +fz_font *fz_load_system_font(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics) { fz_font *font = NULL; @@ -248,7 +248,7 @@ fz_font *fz_load_system_font(fz_context *ctx, const char *name, int is_substitut { fz_try(ctx) { - font = ctx->font->load_font(ctx, name, is_substitute); + font = ctx->font->load_font(ctx, name, bold, italic, needs_exact_metrics); } fz_catch(ctx) { -- cgit v1.2.3