Skip to content

[222_46] : Fix Decimal Font Size Display and added Roundoff#2880

Open
git-lakshy wants to merge 3 commits intoMoganLab:mainfrom
git-lakshy:exp3
Open

[222_46] : Fix Decimal Font Size Display and added Roundoff#2880
git-lakshy wants to merge 3 commits intoMoganLab:mainfrom
git-lakshy:exp3

Conversation

@git-lakshy
Copy link
Contributor

@git-lakshy git-lakshy commented Feb 27, 2026

Fix decimal font size display in status bar and input roundoff

Fixes decimal font size display inconsistency between top bar and status bar. Font sizes now properly round to nearest 0.5 multiples and display correctly in both locations.

How to Test

Enter a decimal font size in the font size input field and check if the font size is displayed correctly in the status bar.
(multiple of 0.5)

Screencast.From.2026-02-27.08-39-26.mp4

Issue #2808 :

Decimal font sizes were not displayed correctly in the status bar.

What

To fix, modified the font size input and status bar to display correct decimal font sizes.

Changes made:

  1. TeXmacs/progs/generic/document-edit.scm: Modified set-init-env function to automatically round font-base-size inputs to the nearest 0.5 (e.g., 10.3 → 10.5, 10.7 → 10.5). Added type safety checks to ensure only valid string inputs are processed.

  2. src/Edit/Interface/edit_footer.cpp:

    • Changed get_env_int(FONT_BASE_SIZE) to get_env_double(FONT_BASE_SIZE) to preserve decimal values
    • Removed integer casting (int)((base_sz + 0.5) * sz) and replaced with direct decimal display base_sz * sz

Why

This fixes both issues at their source:

  • Input validation ensures all font sizes are properly rounded when set
  • Display changes preserve and show the decimal values correctly
  • Both top and bottom bars now show identical, correctly rounded font sizes

@git-lakshy git-lakshy marked this pull request as ready for review February 27, 2026 03:27
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.

1 participant