vandeseer / easytable

Small table drawing library built upon Apache PDFBox
MIT License
246 stars 94 forks source link

#23 Methods and fallbacks for word breaking to be used in heights and widths #24

Closed AdrianMiska closed 5 years ago

AdrianMiska commented 5 years ago

I've written a test that covers the unwanted behavior and have changed the word breaking logic so that Rows and Cells have fallbacks in case the Table is not built yet.

This could be expanded to allow for cell and row wise word breaking overrides but for now this only restores the old behavior where calling wordBreak on TableBuilder would allow for the TableBuilders rows to determine their heights and widths without building the table.

AdrianMiska commented 5 years ago

I seem to have made an error while rebasing to develop. I will do another pull request when I've fixed this.

vandeseer commented 5 years ago

Thanks already for your effort! :+1: This is very much appreciated! :)

AdrianMiska commented 5 years ago

Well, when I tried to work my way through the last failing test I realized that I was probably messing more up than I was fixing. I think it’s also important to continue the principle of having the “hierarchy” where Cell settings override Row settings etc. and my approach was doing the opposite so I believe it’s best if you will take a look at it sometime. I will look into it again if I find the time before you. However you can probably use my test case.