fastexcel
fastexcel copied to clipboard
autoSize column width doesn't account for fontSize
If I set the cell style fontSize to say (14), the autoSizing that happens will not take into account the font size, and the cell will be partially hidden.
Fixed by PR #34.
Thanks, for merging my PR's...
PR #34 doesn't fix this issue.
It does allow column width to be set manually, but it would be nice if the auto-width algorithm took into account the font size which it currently doesn't.
My bad. We'll have indeed to dig into auto sizing issues.
I suppose this line needs some tweaking: https://github.com/dhatim/fastexcel/blob/ee98567d289f4e5d12a9506f757ed2fc367c53c6/fastexcel-writer/src/main/java/org/dhatim/fastexcel/Worksheet.java#L431
@ochedru What does this formula actually do? Why exactly those numbers (7,10,256)?
This may be of some assistance: https://github.com/apache/poi/blob/9f07780bac1b86bd65be33857fc33d7fa50f0072/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java#L553
Looks fairly complex in Apache POI...
As far as I can remember, I used a simplified version of what Apache POI does... My primary goal was to have something "good enough" with the default font, but time proves it was probably not that good 😄
Is there any update for auto maximum column width for excel, As i sees based on text length and text font this size going to vary, if we use column.width() it will overrides the last value.
+1 Having this would be really nice.
+1, same issue here, when I change font size for 14, some column are partially hidden