Subject: :box :line-width and :underline :position should accept fractional sizes

From: JD Smith <[email-masked]>
Date: Sat, 18 May 2024 10:52:03 -0400

For modes which layout mostly on fixed character-width grids, it is convenient to preserve that layout even as the text-scale changes.  Most of the size related attributes associated with display and face properties accommodate this style well, since they accept floating point values which adapt to the underlying char size.  These include face height, display height and raise, specified space dimensions, etc.   

There are, however, two face size attributes which are hard-coded in pixels: :box :linewidth and :underline :position.  It would be very convenient if these also accepted fractional floating point values.  E.g. a face attribute of:

:box (:line-width (0.5 . -0.25)) 

would indicate a box with half a char width outside padding left & right, and one-quarter char height padding above and below.

In addition, :box would be even more powerful, and obviate the use of SVG styling in many situations, if :box :line-width optionally accepted a list of four parameters for box dimensions, one for each side:

:line-width (left right top bottom)

naturally as either pixel or floating point fractions.