Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in AST wrapper font ordering pattern #2339

Open
confluence opened this issue Jan 17, 2024 · 3 comments
Open

Inconsistency in AST wrapper font ordering pattern #2339

confluence opened this issue Jan 17, 2024 · 3 comments

Comments

@confluence
Copy link
Collaborator

This is how the mapping of numeric font IDs to font families and styles is defined in post.ts:

Module.fonts = [
    "{size} sans-serif",
    "italic {size} sans-serif",
    "bold {size} sans-serif",
    "bold italic {size} sans-serif",
    "{size} times",
    "italic {size} times",
    "bold {size} times",
    "bold italic {size} times",
    "{size} arial",
    "bold {size} arial",
    "italic {size} arial",
    "bold italic {size} arial",
    "{size} palatino",
    "italic {size} palatino",
    "bold {size} palatino",
    "bold italic {size} palatino",
    "{size} courier new",
    "italic {size} courier new",
    "bold {size} courier new",
    "bold italic {size} courier new"
];

The styles are ordered in a consistent pattern (normal, italic, bold, bold italic), except for Arial, which swaps italic and bold. In the Python wrapper's API, family and style constants are mapped to a font ID and vice versa with a simple calculation, but for now I have to add a special workaround to swap these two IDs. Would it be possible to fix this? As far as I can see, the overlay font menus are automatically generated from this array, and the values are taken from these menus, so the only effect would be that the items would be swapped in the menus.

@veggiesaurus
Copy link
Collaborator

please forgive me @confluence 😆

@confluence
Copy link
Collaborator Author

I was so sure my maths was correct. And it was, but for the one font that didn't match the others. 😀

@kswang1029
Copy link
Collaborator

Sorry for not picking this up for so long. Now I am developing e2e tests for viewer settings via the Python wrapper to widen the test coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: New issues/PRs
Development

No branches or pull requests

3 participants