Skip to content

Support all text styles for text input#24187

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
chronicl:text_input_styles
May 8, 2026
Merged

Support all text styles for text input#24187
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
chronicl:text_input_styles

Conversation

@chronicl
Copy link
Copy Markdown
Contributor

@chronicl chronicl commented May 8, 2026

Objective

Current text inputs do not apply all styles set in TextFont to their text.

Solution

Set the missing text styles in update_editable_text_styles.

Testing

Tested in my own non-public project. If desired I can write or extend an existing example to showcase.

@mnmaita mnmaita added C-Feature A new feature, making something new possible A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 8, 2026
@mnmaita mnmaita requested a review from ickshonpe May 8, 2026 09:53
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah I think I just left out font features specifically because for some reason I thought, at some moment, it's just small caps and superscripts, no one needs that. But it isn't, and, of course, we should support the full text API.

I'd like us to add a few options to one of the examples (or a new example) with some controls to enable or disable some of these features. That should be left for a follow up though, there's no reason to hold up on merging this.

style_set.insert(StyleProperty::FontWeight(text_font.weight.into()));
style_set.insert(StyleProperty::FontWidth(text_font.width.into()));
style_set.insert(StyleProperty::FontStyle(text_font.style.into()));
style_set.insert(StyleProperty::FontFeatures(
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to ask why you left out FontVariations, but I didn't realise the variations PR isn't merged yet. It looks like it got forgotten with all the problems we had with github a few days ago.

@ickshonpe ickshonpe added D-Trivial Nice and easy! A great choice to get started with Bevy and removed D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels May 8, 2026
@alice-i-cecile alice-i-cecile added S-Blocked This cannot move forward until something else changes and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 8, 2026
@alice-i-cecile
Copy link
Copy Markdown
Member

Blocked by #24088

@alice-i-cecile alice-i-cecile added this to the 0.19 milestone May 8, 2026
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior and removed C-Feature A new feature, making something new possible labels May 8, 2026
@Zeophlite Zeophlite added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Blocked This cannot move forward until something else changes labels May 8, 2026
@chronicl chronicl force-pushed the text_input_styles branch from c7d248b to 99dbd75 Compare May 8, 2026 22:11
@chronicl
Copy link
Copy Markdown
Contributor Author

chronicl commented May 8, 2026

Updated.

@alice-i-cecile alice-i-cecile enabled auto-merge May 8, 2026 22:31
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels May 8, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 8, 2026
Merged via the queue into bevyengine:main with commit 7dda2bc May 8, 2026
40 checks passed
allocatedribble added a commit to allocatedribble/bevy that referenced this pull request May 10, 2026
Brings in 25 upstream commits since 90a282a, including:

- Resource hooks & immutable resources (bevyengine#24164) — `#[resource(immutable)]`,
  `add_resource_hook`, `mutate_resource[_safe]` reorganization
- OpenType font variations (bevyengine#24088) — `FontVariations`, `font_variations.rs`
  example, integration through `bevy_text` and `bevy_ui`
- Tileset grids in `ImageArrayLayout` (bevyengine#24132) — new
  `ImageArrayLayout::Tileset` variant supported by the image loader
- Free camera controller local-Y controls (bevyengine#24161) and showcase wiring
- Solari shader updates: gbuffer perceptual roughness, motion vector wiring
  in DLSS-RR resolve, GI alpha=0 outputs, PSR uses perceptual roughness
- Stale directional light shadow map caching fix (bevyengine#24199)
- All-style support for text input (bevyengine#24187), `Outline::Default`, ECS query
  contiguous-iterator API returning `Result`, lz4_flex 0.13 bump, and a
  raft of wasm/feature gating fixes (bevyengine#24188..bevyengine#24195) plus dependabot bumps

Conflicts (Solari WGSL, both resolved):

- `crates/bevy_solari/src/realtime/resolve_dlss_rr_textures.wgsl`
  Took upstream's `motion_vectors` import (now used by the `specular_motion_vectors` write upstream added) while preserving the
  fork's `dlss_rr_bias` binding, the
  `DLSS_RR_DIFFUSE/GLOSSY_SURFACE_BIAS` constants, and the
  `store_dlss_rr_background_guides` helper. The depth==0 branch keeps
  the fork's helper call (it writes the same diffuse/specular/normal
  defaults plus the bias texture, which the fork's bind group still
  expects).
- `crates/bevy_solari/src/realtime/specular_gi.wgsl`
  Took upstream's three `textureStore` lines for the PSR mirror branch
  (alpha=0.0 in albedo writes, `material.perceptual_roughness` instead
  of `saturate(material.roughness)` for the normal_roughness `.w`).
  Re-added the `dlss_rr_bias` write at 0.85 to keep the fork's DLSS-RR
  bias texture initialized — removing it would leave bind group 2
  binding 4 uninitialized after PSR.

Validation: `cargo check --workspace --all-targets` clean. The only
warnings are upstream `f32` fallback notices in
`crates/bevy_feathers/src/controls/text_input.rs`, introduced by
PR bevyengine#24187 and not caused by this merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants