I am a programmer and I have printing code that draws grid on the paper.
Grid has 4 columns, and they have equal horizontal length. Height of the cell is one tenth of the paper size and is fixed.
Total number of rows is unknown but I know for a fact that there will be at least one row, and that cells will have fixed dimensions.
Maximum number of characters that can fit into cell is 50.
User can choose the paper size on which printing will be done and there I face a problem:
Since the cell dimensions depend on paper size, I do not know how to calculate font size so text can fit into cell.
I have asked for help on StackOverflow but failed, and have tried to find a mathematical formula but that solution didn't work for every case.
I apologize for asking here, but I am desperate at the moment. If further info is required please ask and I will update my post.
Thank you.