Font texture styling - demo window and metric/debug #6129
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using the Light style, the font texture displayed in the demo window (Widgets/Images) and the Metrics/Debug window is white on a light background and nearly unreadable (especially the magnified part under the mouse cursor)
This is caused by a fixed white tint being applied to the font texture image which is fine for the Dark and Classic styles but is not suitable for the Light style.
ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
Changing the tint_col to use the styles text colour fixes the image display for the Light style and leaves the Dark and Classic styles unchanged as their font colour is light
ImVec4 tint_col = ImGui::GetStyleColorVec4(ImGuiCol_Text);
Result with fixed applied
Dark style unaffected - before -
After -