summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Smith <julian.smith@artifex.com>2021-04-02 20:38:14 +0100
committerJulian Smith <julian.smith@artifex.com>2021-04-02 20:38:14 +0100
commite33c1ff985cf6b08889de8401d87c342020dc7b3 (patch)
tree01ce8ad65716e207aff36ea62b1adf7cfde1d75d
parent74699203c7f70a6d7e3aebde49fa78299f30002f (diff)
fonts work.wip-odt
-rw-r--r--src/odt.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/odt.c b/src/odt.c
index e1fe2e6..e1c92c0 100644
--- a/src/odt.c
+++ b/src/odt.c
@@ -81,14 +81,8 @@ static int extract_odt_style_append_definition(extract_alloc_t* alloc, extract_o
outf("<style:text-properties style:font-name=\"%s\"", style->font_name);
if (extract_odt_char_append_stringf(alloc, text, "<style:text-properties style:font-name=\"%s\"", style->font_name)) return -1;
if (extract_odt_char_append_stringf(alloc, text, " fo:font-size=\"%ipt\"", style->font_size)) return -1;
- if (style->font_bold)
- {
- if (extract_astring_cat(alloc, text, " fo:font-weight=\"bold\"")) return -1;
- }
- if (style->font_italic)
- {
- if (extract_astring_cat(alloc, text, " fo:font-style=\"italic\"")) return -1;
- }
+ if (extract_odt_char_append_stringf(alloc, text, " fo:font-weight=\"%s\"", style->font_bold ? "bold" : "normal")) return -1;
+ if (extract_odt_char_append_stringf(alloc, text, " fo:font-style=\"%s\"", style->font_italic ? "italic" : "normal")) return -1;
if (extract_astring_cat(alloc, text, " /></style:style>")) return -1;
return 0;
}