summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <default@localhost.localdomain>2019-12-30 20:46:08 -0300
committerdefault <default@localhost.localdomain>2019-12-30 20:46:08 -0300
commitf3fbeabfe19453ed5979bf4607ef3a7079780711 (patch)
treeda0f53cf6b172dd1a9d39443c9ee4620526f75be
parente2b65d832fd897a10c9df3909b5739fa4e866eee (diff)
Hack in special font-size case to PDF generation
This is specifically for `big-if-true`.
-rwxr-xr-xgenpdf.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/genpdf.py b/genpdf.py
index 9fd3cad..f508c52 100755
--- a/genpdf.py
+++ b/genpdf.py
@@ -533,6 +533,13 @@ def render(pagenos, corpus, bookmark, c, xml, fonts):
if obj.tag in block_fonts:
font_family, font_size = block_fonts[obj.tag]
+
+ size_override = re.search(r'font-size:\s*([\d.]+)em',
+ obj.get('style', ''))
+ if size_override:
+ font_size = (current_style['font-size']
+ * float(size_override.group(1)))
+
if not top_of_block:
new_font_size = (font_size if font_size is not None else
current_style['font-size'])