Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DOCX font size converting issue (#1905) #1906

Merged

Conversation

speckyspooky
Copy link
Contributor

No description provided.

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

There are many magic numbers. Moreover the range of all size values is not covered, except I suppose to default to 10pt. What if size is 8, -3, +5, or 100? Is 10pt fine of all those? Can the sizes specified in the DOM have units, like pt or px or are they purely numbers? What's special about size.length > 2 such that you know to ignore all but the first two values? I guess you assume then to consider only with +/- prefix and only up to the value 9.

It's not possible for fontSize to be null or have length not > 0 as tested later one.

@speckyspooky
Copy link
Contributor Author

The W3C documentation describe the allowed values: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font

grafik

Therefore values different from this range are not allowed and the default "10pt" is based on the BIRT default which is "10pt".
(On a next step I will provide user property class and then I can make the default configurable.)

Further answers to your questions:

  • "size"-values couldn't have units (see documentation).

  • Relative values: The prefix "+" & "-" is specific for relative values

  • Relative values: only allowed for "-[0|..|3]" or "+[0|..|4]" (the +4 is a special case which is supported for the browsers but not listed at the documentation)

  • Relative values: values of +2.5 will be handle through the browsers like "+2", there is no rounding up or down given

  • The variable "fontSize" will be set into the second if-statement to the default "10pt" so in my point of view it cannot be null. Do you think I there is a constellation where it could be remain with the null-value?

Copy link
Contributor

@merks merks left a comment

Choose a reason for hiding this comment

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

The explain makes it all clear now. Thanks! 👍

@merks
Copy link
Contributor

merks commented Sep 13, 2024

@speckyspooky

Will this be the final change for 4.17 such that I can do another milestone build after this is merged?

@speckyspooky
Copy link
Contributor Author

Yes, this is the last change of 4.17 from my side :o)

@speckyspooky speckyspooky merged commit 0ae7df0 into eclipse-birt:master Sep 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugFix Change to correct issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOCX: MS Word with uncorrect style converting of font size "12pt" based on BIRT produced DOCX-documents
2 participants