When tweak.allow-overflowing-double-width-glyphs=yes, then certain
glyphs are allowed to overflow into the neighbouring cell.
However, if the cell “owning” the double-width glyph is erased (_only_
that cell), then the cell overflowed into is not redrawn, causing
part of the double-width glyph to remain on screen.
To avoid checking for these glyphs when printing to the terminal (i.e
at parse time), simply mark both cells as dirty when we render the
overflowing glyph.
Yes, this means that the cells will always be re-rendered. We count on
them only making up a small portion of the screen.
“The optimize attribute should be used for debugging purposes
only. It is not suitable in production code.”
Luckily, it seems it really isn’t needed anymore; with all the other
size optimizations that has been done since this was introduced, there
is no longer any difference with or without this pragma.
Mixed here refers to mixed thickness - the lines thickness doesn’t
match the thickness of an abstract, orthogonal line going through the
middle of the cell.
When mirroring an arc, we need to adjust the mirrored position if the
arc’s position in the cell is asymmetrical. This happens when *either*
the line is odd sized, *or* the cell is. But not when both are.
Thus, we can simply do a ‘thickness % 2 ^ width % 2’ when adjusting
the position.
Describe this in a comment.
This reduces the size of the foot binary by ~4K; all the quad
macros called ceil() and floor() twice per macro, which caused many
float -> int -> float conversions in the expanded code.
By using functions instead, there’s no expansion - the conversion only
happens in one (well, four) places.
We were using so many function arguments that a lot of the emitted
code was just stack push and pops to pass around arguments.
Bundle the buffer data, width, height, stride, and current DPI, into a
single ‘buf’ argument. This greatly reduces the number of arguments to
all functions.
Rename the *function* {h,v}line() to _{h,v}line(), and add two new
macros: hline() and vline().
This allows us to shorten the argument list by removing the ‘buf’ and
‘stride’ arguments.