UI: replace "x" with multiplication sign when displaying calculations #106388
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106388
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "pioverfour/blender:dp_replace_x_in_dimensions"
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?
The multiplication sign looks like an "x" but should be used in its
stead to display calculations and dimensions such as "1920x1080". It
is supported in many fonts including DejaVu Sans, the font currently
used for the UI.
The modification was done only for strings which are displayed in the
user interface, so this excludes prints.
That's a pretty cool idea. Note that this symbol is safe to use even if you select a different UI font. This is because we are using a stack of multiple fonts so if their selected font does not contain "×" it will still be found in the "Noto Sans Math" font in the fallback stack. You can see all the fonts in the datafiles/fonts folder.
I'm a little leery of the use of the "Universal Characters Name"
\u00D7
though as I'm unsure of the support in all platform compilers. I'd hate to find that some dumb compiler adds 0x00 0xD7 and not the actual utf8 bytes of 0xC3 0x97.Simplest would be to just use the literal '×' there. We've had direct uses of characters not in the lower ascii range for quite a few years without issues. A good example is in rna_wm.c you will find ←, ↓, →, ↑.
Thanks, I hadn’t thought of that. Your font stack system is really very cool :)
Oh, interesting, I thought on the contrary that non-ascii characters would be less compatible. Probably because I saw these \u codes recently in Python working on another PR (!106240).
Can you run a build just to make sure?
Yes, I remain a bit surprised that those arrows in rna_wm.c have never been a problem, but it could be that things are just getting better over time.
Where we use an ellipsis character it looks like this:
Looking now I actually used Universal Characters Names in blf_thumbs.c for the font samples. Although slightly different usage in that they were in 32-bit strings like
U"\ud55c\uad6d\uc5b4"
. There is a utf8 specifier likeu8"This is utf8"
but no idea how supported that is. In your case you just have a char array and\u00D7
and hoping it turns into 0xC3 0x97 and not 0x00 0xD7. Probably always works fine and I am just being too cautious. But it would look nicer with '×' in there.Are you not able to, or not sure how? Try adding a new comment to this thread that contains nothing but the following single line:
I was pretty sure I didn’t have the proper rights to do it, but now that you mention it I’ll have to test it next time I need it—because your comment just triggered a build!
a2ca4fe873
to37aaa0c815
@blender-bot build
Only blender organization members with write access can start builds. See documentation for details.
Hello Harley, sorry about the delay.
I found a few other occurrences of strings using "x" as a multiplication sign, so I replaced them as well. I hope I got all of them, this time!
I also used a literal "×" as you suggested, and there wasn’t any problem when building on Linux, could you trigger the bot again to make sure it’s all right, since the bot denied me?
If there is any issue, it’s in a separate commit I can still remove, otherwise it can be squashed.
Screenshots:
Gitea makes a bunch of noise with this change.
Does anyone know if those only show up in pull requests, or do they appear in the code repository as well?
They do, here in my fork.
I should say that this encoding issue recently came up with Campbell on this: #106581 and he didn't want even want Unicode literals in comments. I ended up using the same "Universal Characters Names" that was your first idea. Sorry if I led you astray.
37aaa0c815
to4ec573c4f5
No problem, I reset to the previous version.
UI: replace "x" by multiplication sign when displaying calculationsto UI: replace "x" with multiplication sign when displaying calculations4ec573c4f5
to188cf47424
188cf47424
to0d0d54a44d
Hey @pioverfour, sorry for the delay.
I had a look around at all our other uses of Unicode characters and found it to be a bit of a messy hodgepodge. We use literals, universal characters and byte escape sequences. And it also looks like most of that mess is my fault. So I made the following - #109163 - which adds defines for them in a single format. I am hoping you can take a look at it. Maybe they should be elsewhere, be in a different format, or have a different naming scheme, etc.
Hey, no worry, this isn’t the most urgent feature!
I replied in the PR, but basically I believe unifying Unicode characters is a good idea, but this solution breaks translations. I don’t have a strong opinion on which alternative is best, I guess I’d probably go with universal characters as in this PR.
0d0d54a44d
tof06ff2fb45
@Harley I changed the PR to use your new
BLI_STR_UTF8_
macros, except for strings parsed using regex (oneTIP_()
and oneBKE_reportf()
).@pioverfour - Noice!