From 2a1a79c623636c8cf47a96ca8424174a9283aa10 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 16 Jul 2014 17:07:19 +0200 Subject: Improve callback for loading substitute CJK fonts to return TTC index. --- source/pdf/pdf-font.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/pdf/pdf-font.c') diff --git a/source/pdf/pdf-font.c b/source/pdf/pdf-font.c index c6dc7123..5ac722f0 100644 --- a/source/pdf/pdf-font.c +++ b/source/pdf/pdf-font.c @@ -228,14 +228,14 @@ pdf_load_substitute_cjk_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fon { unsigned char *data; unsigned int len; + int index; - data = pdf_lookup_substitute_cjk_font(ros, serif, &len); + data = pdf_lookup_substitute_cjk_font(ros, serif, fontdesc->wmode, &len, &index); if (!data) fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find builtin CJK font"); - /* The DroidSansFallback fonts have both H and V variants in the TTC */ - /* A glyph bbox cache is too big for DroidSansFallback (51k glyphs!) */ - fontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, fontdesc->wmode, 0); + /* A glyph bbox cache is too big for CJK fonts. */ + fontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, index, 0); } fontdesc->font->ft_substitute = 1; -- cgit v1.2.3