aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkj_sh6042026-03-14 00:38:17 -0400
committerkj_sh6042026-03-14 00:38:17 -0400
commitf0763f404bb27923d36b60765ef9936096377a5e (patch)
tree79fd84aa2451387775ab99a6a4b10b931a94e38c
parentc3d3021b07d34e2866de375fc41bd30b03662276 (diff)
refactor: `system-ui` font option
-rw-r--r--src/app.py8
-rw-r--r--src/templates/index.html3
2 files changed, 9 insertions, 2 deletions
diff --git a/src/app.py b/src/app.py
index ce5a6e1..a587311 100644
--- a/src/app.py
+++ b/src/app.py
@@ -200,6 +200,8 @@ def build_pdf_css(
if font_family == "sans":
font_stack = "sans-serif"
+ elif font_family == "system-ui":
+ font_stack = 'system-ui, -apple-system, BlinkMacSystemFont, sans-serif'
else:
font_stack = "serif"
@@ -466,7 +468,9 @@ def convert_with_reportlab(
)
styles = getSampleStyleSheet()
- font_name = "Helvetica" if font_family == "sans" else "Times-Roman"
+ font_name = (
+ "Helvetica" if font_family in ("sans", "system-ui") else "Times-Roman"
+ )
spacing_val = float(line_spacing) if line_spacing else 1.0
body_style = ParagraphStyle(
@@ -657,7 +661,7 @@ def create_app():
)
font_family = request.form.get("main_font", "serif")
- if font_family not in ("serif", "sans"):
+ if font_family not in ("serif", "sans", "system-ui"):
font_family = "serif"
line_spacing = pick_option(
diff --git a/src/templates/index.html b/src/templates/index.html
index 9f3ea9c..490bb82 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -105,6 +105,9 @@
<label>
<input type="radio" name="main_font" value="sans" /> sans-serif
</label>
+ <label>
+ <input type="radio" name="main_font" value="system-ui" /> system-ui
+ </label>
</fieldset>
<label for="line_spacing">Line spacing</label>