https://bz.apache.org/bugzilla/show_bug.cgi?id=63108

--- Comment #6 from aditsu <[email protected]> ---
I did some more digging (learned more about column widths than I ever wanted
to), and my current best understanding is that when the default width is not
specified, it can be calculated from the base width like this (kotlin again,
but easy to understand):

const val DEFAULT_BASE_WIDTH = 8
const val PIXELS_PER_CHAR = 7
const val ROUNDING = 8 // don't have hard facts on that but it seems to be true
const val PADDING = 5 // 2 pixels margin on each side + 1 pixel gridline

val baseWidth: Int = DEFAULT_BASE_WIDTH // or could be specified in the sheet
val pixels = baseWidth * PIXELS_PER_CHAR + PADDING
val roundedUp = (pixels + ROUNDING - 1) / ROUNDING * ROUNDING
val defaultWidth = (roundedUp - PADDING) / PIXELS_PER_CHAR.toDouble()

With the above constants, we get 8.428571428571429, which seems to be where
8.43 is coming from.
If PIXELS_PER_CHAR = 8, we get 8.375, and 8.38 is another value reported in the
wild with a slightly different font.

In my attached example, the default width is actually specified, so the above
calculation would not be triggered.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to