editor icon indicating copy to clipboard operation
editor copied to clipboard

Clamping fontsize to a minimum to avoid a crash

Open gbluma opened this issue 1 year ago • 0 comments

Problem:

When using font size adjustment in the header row, like $font=regular,15 a crash can be caused when deleting the trailing 5. (This seemed most likely when applying the change to an open document.) Since the font change is immediate, the editor sees this as a change to a font of size 1 and that is apparently invalid.

Solution

Since the font size is invalid, I patched the system where the font is actually applied, so if there are other entry points they would presumably also be patched.

I also noticed that a font size of 0 seems to imply "don't change the font size" so that is maintained.

gbluma avatar Apr 06 '24 23:04 gbluma