UI: Increased Overlay Text Contrast #117351

Merged
Harley Acheson merged 4 commits from Harley/blender:OverlayContrast into main 2024-01-22 21:58:05 +01:00
Member

Increased contrast of light text on any background by increasing the
effectiveness of the dark shadow.


Over the years I have tried a number of different ways of increasing the contrast of the text overlays when they are used in extreme situations, like white text on a white background. I have tried picking the best text color to contrast with the background, and I have tried many ways of improving the text shadows and outlines. There just isn't a reliable way to always know the effective background color. And my attempts at improving the text outline have not been as performant and as effective as proposed here.

Our regular text output features the ability to add shadows while being displayed, on the GPU. My attempts to create text outlines would have involved printing text twice, once for the outline and once for the text. But these would be two different glyph sets since this isn't the same glyphs twice. This PR prints twice, but using the existing GPU shadows, so the same glyphs twice. Once with a centered 5 pixel shadow and a second time with a slightly-offset 3-pixel shadow. The result is much more readable.

The following contrasts this PR with the current text on our worst case, white on white:

TextShadow.gif

Increased contrast of light text on any background by increasing the effectiveness of the dark shadow. --- Over the years I have tried a number of different ways of increasing the contrast of the text overlays when they are used in extreme situations, like white text on a white background. I have tried picking the best text color to contrast with the background, and I have tried many ways of improving the text shadows and outlines. There just isn't a reliable way to always know the effective background color. And my attempts at improving the text outline have not been as performant and as effective as proposed here. Our regular text output features the ability to add shadows while being displayed, on the GPU. My attempts to create text outlines would have involved printing text twice, once for the outline and once for the text. But these would be two different glyph sets since this isn't the same glyphs twice. This PR prints twice, but using the existing GPU shadows, so the same glyphs twice. Once with a centered 5 pixel shadow and a second time with a slightly-offset 3-pixel shadow. The result is much more readable. The following contrasts this PR with the current text on our worst case, white on white: ![TextShadow.gif](/attachments/794d043e-174e-4138-94e2-f97ab167ddab)
Harley Acheson added 1 commit 2024-01-20 00:36:27 +01:00
0a25f5d056 UI: Increased Overlay Text Contrast
Increased contrast of light text on any background by increasing the
effectiveness of the dark shadow.
Harley Acheson added this to the User Interface project 2024-01-20 00:37:51 +01:00
Harley Acheson requested review from Pablo Vazquez 2024-01-20 00:37:58 +01:00
Pablo Vazquez approved these changes 2024-01-22 11:36:23 +01:00
Pablo Vazquez left a comment
Member

The white on white will always be an issue unless we add a full background on each line, but that introduces other issues.

This is definitely an improvement to what we have, so looks-wise I'd say +1

test on white
test on color

The white on white will always be an issue unless we add a full background on each line, but that introduces other issues. This is definitely an improvement to what we have, so looks-wise I'd say +1 ![test on white](/attachments/c85aed50-b5a6-4256-88aa-16b74905d085) ![test on color](/attachments/4c27df74-c0af-4b52-90a4-3a49840e95c2)
Harley Acheson added 2 commits 2024-01-22 21:07:20 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
5a9363a238
BLF_draw_default_shadow -> BLF_draw_default_shadowed
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson added 1 commit 2024-01-22 21:52:57 +01:00
Harley Acheson merged commit a4a8683788 into main 2024-01-22 21:58:05 +01:00
Harley Acheson deleted branch OverlayContrast 2024-01-22 21:58:08 +01:00
Sign in to join this conversation.
No reviewers
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#117351
No description provided.