Skip to content

Font Size 10 pt is recognized in source code but displayed as 9pt in the toolbar #1522

Open
@last-resort

Description

Describe the bug
Font Size 10 pt is recognized in source code but displayed as 9pt in the toolbar

To Reproduce
Steps to reproduce the behavior:

  1. Change the fontSizeUnit to pt
  2. Type text and set the size to 10 pt.
  3. If you inspect the source code of the text there's the correct attribute "font-size: 10pt"
  4. In the toolbar 9 pt is shown.

Expected behavior
The toolbar should also show 10 pt too

Additional context

It's a problem with convertFontSize in the core.js. First you multiply the 10 with 1.333 and round it: pxSize = math.round(sizeNum * 1.333);

Result is 13,333 and rounded 13.

After that the result get's divided by 1.333 and the pt String added to the result

return math.floor(pxSize / 1.333) + to;

If you divide 13 by 1,333. you get 9,75. This result is rounded down with math.floor. So in the end you've converted the 10 pt to 9pt which is shown in the toolbar.

Im not 100% sure what's the reason for the method at all, so i'm afraid to fix it myself.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions