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

Add correction to row height and column width obtained in SheetUtil methods #941

Merged
merged 3 commits into from
Nov 9, 2022

Conversation

artem-iron
Copy link
Contributor

SixLabors.TextMeasurer measures strings differently than System.Common.Drawing did. The corrective coefficients here are not 100% accurate either, but they make sure, that cell contents are not cut off. The coefficient's values were tweaked by testing them on sizable sample of test strings with different fonts, font sizes and string lengths (and heights in case of multi-line strings). Accuracy will vary depending on font size and font itself, but on average accuracy is improved for most cases.

Fix incorrect number of rows count in merged region returned by GetNumberOfRowsInMergedRegion method:
Due to copy-paste it was actually returning a number of columns.

Artem Koloskov added 2 commits October 26, 2022 16:18
Due to copy-paste it was actually returning a number of columns.
…thods

SixLabors.TextMeasurer mesures strings differnetly than System.Common.Drawing did. the corrective coefficients here are not 100% accurate either, but they make sure, that cell contents are not cut off. The coefficient's values were tweaked by testing them on sizable sample of test strings with different fonts, font sizes and string lengths (and hights in case of multy-line strings). Accuracy will vary depending on font size and font itself, but on average acuracy is improved for most cases.
@artem-iron
Copy link
Contributor Author

the checks have failed due to the ')' missing issue, that was fixed in the PR before this one

@tonyqus
Copy link
Member

tonyqus commented Nov 9, 2022

#940 is merged. Can you merge the latest code to your branch?

@artem-iron
Copy link
Contributor Author

@tonyqus Done

@tonyqus
Copy link
Member

tonyqus commented Nov 9, 2022

LGTM

@tonyqus tonyqus merged commit 27b01fe into nissl-lab:master Nov 9, 2022
@tonyqus tonyqus added this to the NPOI 2.6.1 milestone Nov 9, 2022
@artem-iron artem-iron deleted the fix-autosize-methods branch November 9, 2022 08:46
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.

2 participants