UI: Configurable UI Font Weight #112454
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112454
Loading…
Reference in New Issue
No description provided.
Delete Branch "Harley/blender:TextUiStyles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Allows selecting different font weights in Text Styles
Our new Interface font, Inter, is a variable font, which means the one font can be used for almost any weight. It is as if we shipped with an entire family of the font in all its weights. This PR allows us to change the weight for each of the Text Styles:
The "Weight" value is like CSS:
If a font is variable yet does not offer the full range from 100-900 then the weights are augmented with glyph emboldening.
WIP: UI: Configurable UI Text Stylesto UI: Configurable UI Text StylesUI: Configurable UI Text Stylesto UI: Configurable UI Variable Text StylesOoh nice! Already reaping the benefits of variable fonts :D
Any particular reason for the weight values to be normalised? 100-900 is a range many designers will understand.
Positive slant values do nothing for me here, negative values do. Not sure if it is a limitation of the font. Also perhaps this should be a value slider instead of a numeric one?
It is complicated.
With variable fonts each design aspect that can change is an "axis". The font designer can add any arbitrary value for the min, max, and default values. And these just correspond to the minimum and maximum variation in the design and a default they like. The Inter font is made by someone sane so he uses proper css weight values. But I have seen fonts that have amazingly strange values in there. It all works just fine if they use -1000 and +1000 and min and max.
Right now I am treating all the variable axes generically, so that default becomes "0" for no change, the min maps to -1 and the max to 1.
Slant values are backwards from what you expect. This is because when this value is used properly it defines a rotation in counter-clockwise degrees. Inter allows a rightward slant, but not a leftward one. So for this axis it has a max of 0, a default of 0, and a negative minimum value, which is considered quite normal. Apparently this counter-clockwise rotation nonsense was to keep the value similar to one that was used in a really old font table (post, for "Postscript").
You can see this stupid behavior on Google Fonts site too. If you go here and play with "Slant". https://fonts.google.com/specimen/Inter/tester
But keep in mind that I was playing with these variable fonts when they first coming out. So some of the weirdness of the early fonts could be gone by now. We might be able to assume now that sane fonts will use these values sanely now.
But this range is nice for things like node inputs.
One option that DOESN'T easily work is to keep them as -1 to 1 ranges internally but expose them to users as weights like 100, 400, etc that get converted to the normalized range. This is because I don't actually know what the range is, as in a font might be variable but only support 200-800. To do that right I'd have to expose the variable stuff to the higher level BLF code. BLF_Variable_Axis_Maximum(axisname) or similar.
Then you might even be able to get a slant value that goes the right way.
I guess it all depends on whether we can get this stuff exposed to users. If yes, I think @brecht and @HooglyBoogly might have to weigh in about these values.
Thanks for the thorough explanation! I was just asking as I didn't know how this works.
If the values are normalized then having a value slider (instead of number slider) probably works best? Either way it's fine and would be a great addition to have with the new font in 4.0
UI: Configurable UI Variable Text Stylesto WIP: UI: Configurable UI Variable Text StylesOkay, I think I can get us what we want. I just need to do the following:
For example, the "wght". 1-1000 values only, treated as values from OS/2 usWeightClass (100-900, with 400 being normal or regular). Allow full 100-900 range, even if the font supports only a subset, by adding emboldening when needed. For non-variable fonts I'll need to get the regular weight value from the OS/2 table usWeightClass value, so that bold fonts stay properly in the range.
For 'slnt" support subset of the -90 - 90 range (+- 15?). Angle of slant in counter-clockwise degrees from upright. 0 is normal. Use obliquing to fill holes in coverage. Get font's regular slant from "post" table "italicAngle". Expose to users as clockwise degrees.
For "wdth", positive values interpreted as a percentage of normal (whatever that means to the designer). 100 is normal. Do a width transform without advance change to fill in coverage. For non-variable fonts get the normal value from OS./2 table usWidthClass value. note this is just 9 values so needs interpolation.
Since the above fills in coverage holes with synthetic changes we don't need to expose min and maxes to users. Weight, for example, can always be 100-900 regardless of that the font actually supports.
@pablovazquez
This PR now allows specifying font weight like css, with values between 100-900. Slant is in clockwise degrees and can lean both ways (rightward is built into the font, while leftward is done with glyph transformations). Width using 1.0 as normal, as does Spacing.
It is quite fun to play with. The only thing it doesn't do (yet) is deal properly with non-variable fonts that are bold or italic, and so won't add boldness or obliquing quite as I'd like, but that is fairly obscure anyway.
WIP: UI: Configurable UI Variable Text Stylesto UI: Configurable UI Font WeightAwesome!
I think this will improve accessibility a lot for people with low vision.
For reference:
Thanks for working on this!
I have also had reports of people running Blender with Inter Light, long before we made the change
@blender-bot build
@blender-bot build