Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Export: validate font selection and log on fallback instead of silently defaulting #43

Description

@stultus

Problem

src-tauri/src/commands/export.rs:33-36 and :123-128 resolve the user's font selection by hardcoding a match for "manjari" → "Manjari"; anything else silently falls through to "Noto Sans Malayalam". If a future font slug is added (or a .screenplay file carries an unrecognized value), the PDF will be generated in the wrong font without any indication.

Suggested fix

Either:

  1. Validate the font slug against a known set and return Err(...) if unknown — surfaces the problem to the user immediately, or
  2. Keep the fallback but eprintln! / log a warning when falling back, so it shows up in Tauri's stderr during development and in crash logs.

Option (1) is stricter and safer for a document format designed to be opened years later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions