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

stylix: support various stylix.fonts.sizes units #251

Open
trueNAHO opened this issue Feb 7, 2024 · 1 comment
Open

stylix: support various stylix.fonts.sizes units #251

trueNAHO opened this issue Feb 7, 2024 · 1 comment
Labels
technical debt Things which should be cleaned up or improved

Comments

@trueNAHO
Copy link
Collaborator

trueNAHO commented Feb 7, 2024

The config.stylix.fonts.sizes attribute set should be extended to support the pixel and point units due to various applications supporting different units.

Each exact value of the pixel and point units should have a complementary rounded value to account for the 1 point = (4 / 3) pixels conversion introducing floating point numbers. For reference, numbers can be efficiently rounded with number: builtins.floor (number + 0.5).

To avoid inconsistencies, an assertion should verify that only one of the pixel and point units is set by the end user.

Related: #239 (comment)

trueNAHO added a commit to trueNAHO/stylix that referenced this issue Feb 7, 2024
danth pushed a commit that referenced this issue Feb 7, 2024
* fix(modules/qutebrowser): use correct 'fonts.web.size.default' type

Use the correct 'fonts.web.size.default' type to avoid the following
error:

> Errors occurred while reading config.py:
>   While setting 'fonts.web.size.default': Invalid value '10pt' -
>   expected a value of type int but got str.

Reference: https://qutebrowser.org/doc/help/settings.html#fonts.web.size.default
Follows: #221

* fix(modules/qutebrowser): convert 'point' unit to 'pixel' unit

Addresses: #239 (comment)
Requires: #251
@danth
Copy link
Owner

danth commented Feb 7, 2024

This could make use of black box types, which will be introduced by #102, to allow syntax like:

  • fonts.sizes.applications = config.lib.stylix.types.size.from.points 12
  • config.stylix.fonts.sizes.applications.as.pixels
  • config.stylix.fonts.sizes.applications.as.points

See here for the library function which implements this.

@danth danth added the technical debt Things which should be cleaned up or improved label Feb 7, 2024
trueNAHO added a commit to jezcope/stylix that referenced this issue Sep 11, 2024
trueNAHO pushed a commit to jezcope/stylix that referenced this issue Sep 12, 2024
trueNAHO pushed a commit to jezcope/stylix that referenced this issue Sep 12, 2024
trueNAHO pushed a commit that referenced this issue Sep 20, 2024
mateusauler pushed a commit to mateusauler/stylix that referenced this issue Nov 17, 2024
mateusauler pushed a commit to mateusauler/stylix that referenced this issue Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt Things which should be cleaned up or improved
Projects
None yet
Development

No branches or pull requests

2 participants