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 auto fit columns function #1386

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

add auto fit columns function #1386

wants to merge 6 commits into from

Conversation

yyt030
Copy link

@yyt030 yyt030 commented Nov 5, 2022

PR Details

add auto fit columns function

Description

add auto fit columns function

Related Issue

#92

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 5, 2022
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, I've left some comments.

col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
col.go Outdated Show resolved Hide resolved
@xuri xuri added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 6, 2022
@Noah-Chiu
Copy link

Noah-Chiu commented Nov 9, 2022

Little suggestion for you guys:
Maybe can add the feature to check if the cell has the Chinese or Japanese or other bigger font type
For me I use unicode.Is to check the unicode.Han, and plus the column width for every single word

@yyt030 yyt030 requested a review from xuri November 13, 2022 01:27
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

I have added some new comments, but there is some feedback in the previous review still not resolved.

col.go Outdated Show resolved Hide resolved
col_test.go Outdated Show resolved Hide resolved
col_test.go Outdated Show resolved Hide resolved
col_test.go Outdated Show resolved Hide resolved
col_test.go Outdated Show resolved Hide resolved
@yyt030
Copy link
Author

yyt030 commented Nov 15, 2022

Little suggestion for you guys: Maybe can add the feature to check if the cell has the Chinese or Japanese or other bigger font type For me I use unicode.Is to check the unicode.Han, and plus the column width for every single word

I rewrite the function to calculate length of sbcs and mbcs.

@yyt030 yyt030 requested a review from xuri November 15, 2022 15:39
}
}

// The ratio of 1.123 is the best approximation I tried my best to
Copy link
Member

Choose a reason for hiding this comment

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

We can't fix the character width, which also related to the font family and font size style, we need to consider this factor.

@xuri xuri linked an issue Mar 8, 2023 that may be closed by this pull request
@hq2333
Copy link

hq2333 commented Aug 4, 2023

Has this pull request not been merged into master yet?

@xuri
Copy link
Member

xuri commented Aug 18, 2023

Has this pull request not been merged into master yet?

There are some code review issues still not resolved. We need to resolve these issues before merging it into the master branch.

@n3m
Copy link

n3m commented Jan 16, 2024

What's missing for this PR to be merged? All conversations on the "Files" tab seem to be resolved (although idk if truly accepted).

If there's still logic pending for review, broken or missing, I might be able to help.

@edwardmatutino
Copy link

need this feature. any updates

@xuri
Copy link
Member

xuri commented Jan 19, 2024

Hi @yyt030, @n3m, @edwardmatutino, the character width is related to the font family and font size style, we need to calculate column width by font size. I have marked the unresolved comments in the code review conversion. In addition, there's a code conflict in this pull request, we need to resolve this for merging this, and before that please also reference the code in issues #92 and #204.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is there a way to auto fit columns?
6 participants