diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-08-09 16:55:36 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2017-08-17 13:38:48 +0200 |
commit | b796ddf898817ad0a16013ffc7e67420c5881b6f (patch) | |
tree | fa43815b0bfd8fc56d3e6cd9d4635e9d8b2db93c /source/fitz | |
parent | b18437b5f1de6a0b9579eb1d51dee61bad8e0eb2 (diff) | |
download | mupdf-b796ddf898817ad0a16013ffc7e67420c5881b6f.tar.xz |
Detect bold/italic by also checking the font name.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/font.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/fitz/font.c b/source/fitz/font.c index dfe4ab24..38c9abab 100644 --- a/source/fitz/font.c +++ b/source/fitz/font.c @@ -567,6 +567,20 @@ fz_new_font_from_buffer(fz_context *ctx, const char *name, fz_buffer *buffer, in } } + if (name) + { + if (!font->flags.is_bold) + { + if (strstr(name, "Semibold")) font->flags.is_bold = 1; + if (strstr(name, "Bold")) font->flags.is_bold = 1; + } + if (!font->flags.is_italic) + { + if (strstr(name, "Italic")) font->flags.is_italic = 1; + if (strstr(name, "Oblique")) font->flags.is_italic = 1; + } + } + font->buffer = fz_keep_buffer(ctx, buffer); return font; |