Skip to content

Add editor font size settings#911

Draft
CopeFiend wants to merge 23 commits intoFyroxEngine:masterfrom
CopeFiend:editor_font_size_settings
Draft

Add editor font size settings#911
CopeFiend wants to merge 23 commits intoFyroxEngine:masterfrom
CopeFiend:editor_font_size_settings

Conversation

@CopeFiend
Copy link
Copy Markdown
Contributor

@CopeFiend CopeFiend commented Apr 12, 2026

Closes #910

Description

Add options for configuring font size in Editor UI.

Progress

  • Add font_size option to Settings Window -> General
  • Modify Editor font size through font_size option
  • Store modified value in settings.ron
  • Clamp value in Settings Window (8.0px - 48.0px)
  • Handle text widgets with previously hard-coded values (World Viewer, Tilemap Property, etc.)
  • Handle layout scaling with large fonts

Review Guidance

  • Most Builders now have the following fields and methods:
pub font: Option<FontResource>, // Default: None
pub font_size: Option<StyledProperty<f32>>, // Default: None

pub fn with_font(mut self, font: FontResource) -> Self {
   self.font = Some(font);
   self
}

pub fn with_font_size(mut self, font_size: StyledProperty<f32>) -> Self {
   self.font_size = Some(font_size);
   self
}
  • Every instance of Builder now explicitly calls the with_font() and with_font_size() methods
  • Would like to whether putting everything in Settings::general is a wise decision.

Screenshots/GIFs

WIP

Checklist

  • My code follows the project's code style guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes don't generate new warnings or errors
  • No unsafe code introduced (or if introduced, thoroughly justified and documented)

@CopeFiend CopeFiend force-pushed the editor_font_size_settings branch 5 times, most recently from 2bf7e3c to caa8397 Compare April 20, 2026 14:06
@CopeFiend CopeFiend force-pushed the editor_font_size_settings branch from be386ca to d8778d3 Compare April 25, 2026 07:16
@CopeFiend CopeFiend mentioned this pull request Apr 25, 2026
5 tasks
@CopeFiend CopeFiend force-pushed the editor_font_size_settings branch from c2910a2 to 6c5a62c Compare April 29, 2026 14:14
@mrDIMAS
Copy link
Copy Markdown
Member

mrDIMAS commented Apr 29, 2026

I'm not quite sure why there's a need to add this huge heap of additional methods. What I'd do is to just modify standard style's variable and called ui.set_style. This will propagate all the changes to all widgets that handles text. Also, for now the editor uses this FONT_SIZE variable almost everywhere, so it is basically uses the same font size for every widget.

For places that has different font size, I'd just add a separate style variable, specific to the place where it belongs. Then it can be modified and ui.set_style can be called.

To proportionally change the font size for every styled variable I'd change the type of FONT_SIZE variable to a new type called FontSize and after that it'd be possible to iterate over all such properties in the style and scale them accordingly. So basically: take the default style, create its copy, scale all the FontSize properties accordingly, then call ui.set_style. This should be enough.

Of course, I might be missing some issues. Let's discuss this.

CopeFiend added 21 commits April 30, 2026 02:11
…mattedText, added style update to Text and

TextBox, boilerplate work

- Every Text/TextBox widget in editor/ now explicitly uses
`Editor::UI_FONT_SIZE` instead of the default `Style::FONT_SIZE`
- `pub fn build_and_open() moved from FolderNameDialog to
  FolderNameDialogBuilder
- `InspectorContext` and other "context" structs now carry explicit font/font_size values
- Method calls now have to explicitly set font/font_size data
- Changed helper functions to also take font/font_size
- Builders now have font/font_size fields
@CopeFiend CopeFiend force-pushed the editor_font_size_settings branch from fb8a730 to 40973cc Compare April 29, 2026 18:12
@CopeFiend
Copy link
Copy Markdown
Contributor Author

@mrDIMAS Created a Discussion thread #915 , with replies to feedback #915 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add UI font size configuration in Editor Settings Window

2 participants