diff options
| author | kj_sh604 | 2026-03-14 00:38:17 -0400 |
|---|---|---|
| committer | kj_sh604 | 2026-03-14 00:38:17 -0400 |
| commit | f0763f404bb27923d36b60765ef9936096377a5e (patch) | |
| tree | 79fd84aa2451387775ab99a6a4b10b931a94e38c /src/app.py | |
| parent | c3d3021b07d34e2866de375fc41bd30b03662276 (diff) | |
refactor: `system-ui` font option
Diffstat (limited to 'src/app.py')
| -rw-r--r-- | src/app.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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( |
