<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/box-drawing.c, branch 1.9.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-08-13T15:38:56Z</updated>
<entry>
<title>pt-or-px: heed the dpi-aware setting</title>
<updated>2021-08-13T15:38:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-13T15:38:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6f8f2b35ec10eb09f2c7c5b8214b62fa87b59e5'/>
<id>urn:sha1:f6f8f2b35ec10eb09f2c7c5b8214b62fa87b59e5</id>
<content type='text'>
Before this patch, pt-or-px values, like letter-spacing, were *always*
scaled using the current DPI value.

This is wrong; if the fonts are scaled using the output’s scaling
factor, then so should all other point values.

This also fixes an issue where e.g. letter-spacing would use one DPI
value at startup, but then when increasing/decreasing or resetting the
font size, would be re-calculated using a different DPI value, leading
to completely different spacing.

This happened when there were multiple monitors, with different DPI
values, and foot guessed the initial DPI value wrong. Normally, foot
would correct itself as soon as the window was mapped, and the
“correct” DPI value known. But if the fonts were scaled using the
scaling factor, it was possible that the font reload never happened.

This patch also updates the thickness calculation (for LIGHT and HEAVY
box drawing characters) to use the scaling factor when appropriate.

Closes #680
</content>
</entry>
<entry>
<title>box-drawing: fix compiler warning</title>
<updated>2021-08-06T20:29:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-06T20:29:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=22b280b3558710e622c76723e7bb0ca6783807a6'/>
<id>urn:sha1:22b280b3558710e622c76723e7bb0ca6783807a6</id>
<content type='text'>
../../box-drawing.c: In function 'box_drawing':
../../box-drawing.c:2774:13: error: 'y1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 2774 |     int y0, y1;
      |             ^~
../../box-drawing.c:2774:9: error: 'y0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 2774 |     int y0, y1;
      |         ^~
</content>
</entry>
<entry>
<title>box-drawing: re-align sextants and wedges</title>
<updated>2021-08-06T20:26:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:32:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=130cf791e9e841b590b8b173537089c125699744'/>
<id>urn:sha1:130cf791e9e841b590b8b173537089c125699744</id>
<content type='text'>
Improve the visual quality of sextants (and wedges) when the cell height isn’t a
multiple of three.
</content>
</entry>
<entry>
<title>box-drawing: don’t inline functions called for multiple codepoints</title>
<updated>2021-08-05T17:51:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:29:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6f591861937b333c09c2b6828ededeb405f305ae'/>
<id>urn:sha1:6f591861937b333c09c2b6828ededeb405f305ae</id>
<content type='text'>
In several cases, this expanded to multiple calls, and when inlined, resulted in
much larger code size.
</content>
</entry>
<entry>
<title>box-drawing: wedges: pre-load x_halfs[] and y_thirds[]</title>
<updated>2021-08-05T17:51:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:29:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=97e64e2cafed73fa665dfa5a5f8d20d0abff84c8'/>
<id>urn:sha1:97e64e2cafed73fa665dfa5a5f8d20d0abff84c8</id>
<content type='text'>
This reduces the number of loads in the rest of the function.
</content>
</entry>
<entry>
<title>box-drawing: wedges: avoid floating point math</title>
<updated>2021-08-05T17:51:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:27:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0e10d2b1a2320004e1609e2463e24aa1d04d845d'/>
<id>urn:sha1:0e10d2b1a2320004e1609e2463e24aa1d04d845d</id>
<content type='text'>
Re-use the pre-calculated offsets used by the sextants. This is the correct
thing to do since wedges *should* align with sextants.
</content>
</entry>
<entry>
<title>box-drawing: pre-calculate sextant x,y offsets</title>
<updated>2021-08-05T17:51:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T19:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=950c1b6010efe07a9a65116618a980179ed279a5'/>
<id>urn:sha1:950c1b6010efe07a9a65116618a980179ed279a5</id>
<content type='text'>
We’re using floating point math, as a way to ensure that sextant primitives
overlap, rather than leaving empty spaces, or being uneven, when the cell
width/height isn’t divisible with 2 (width) or 3 (height).

This gets rid of all floating point math from the sextant drawing functions.
</content>
</entry>
<entry>
<title>box-drawing: deal with quads in the same as sextants</title>
<updated>2021-08-05T17:51:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T18:55:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=469d5abc694e1b71310be7c7281dabd6380edfeb'/>
<id>urn:sha1:469d5abc694e1b71310be7c7281dabd6380edfeb</id>
<content type='text'>
That is, encode which “pieces” make up each quad in a static array, and use a
single function to draw all quads using the four primitives “upper left/right,
lower left/right”.
</content>
</entry>
<entry>
<title>box-drawing: don’t inline horizontal-one-eighth-block-N</title>
<updated>2021-08-05T17:51:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T18:54:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1dcdc42091024f9b47521a4d5133b7a58c673b4b'/>
<id>urn:sha1:1dcdc42091024f9b47521a4d5133b7a58c673b4b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: don’t inline light diagional</title>
<updated>2021-08-05T17:51:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T18:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=67e285f16cdb1f0e85caa1c2921c022f2c9d5b03'/>
<id>urn:sha1:67e285f16cdb1f0e85caa1c2921c022f2c9d5b03</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: wedges: fix alignment of inverted wedges</title>
<updated>2021-08-05T16:25:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:21:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=36ecd0baede55c46d910b03273dff93a5db181ed'/>
<id>urn:sha1:36ecd0baede55c46d910b03273dff93a5db181ed</id>
<content type='text'>
We render the inverted wedges by first rendering a non-inverted triangle, and
then inverting it with PIXMAN_OP_OUT.

In cases where truncating and round():ing the triangle points have different
results, the final, inverted wedge ends up being unaligned with the
corresponding sixel(s).

This patch fixes that by handling the pre-inverted triangles
specifically. I.e. we don’t re-use the same triangle coordinates as the
corresponding non-inverted triangle.
</content>
</entry>
<entry>
<title>box-drawing: wedges: don’t group similar cases together</title>
<updated>2021-08-05T16:25:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-04T15:32:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=56d7a51d35fbb1f8c188dc1adf8730b3eb83f531'/>
<id>urn:sha1:56d7a51d35fbb1f8c188dc1adf8730b3eb83f531</id>
<content type='text'>
Since they’re not exactly alike, we still need branches within each case. Better
to split them up - one case per codepoint.
</content>
</entry>
<entry>
<title>box-drawing: add U+1FB3C-U+1FB6F, U+1FB9A and U+1FB9B</title>
<updated>2021-08-05T16:25:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T16:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1c43fdbea4751de9a84d24be8320712c85045414'/>
<id>urn:sha1:1c43fdbea4751de9a84d24be8320712c85045414</id>
<content type='text'>
These are the “wedges” from the Unicode 13 “Legacy Computing” symbols.

Closes #474
</content>
</entry>
<entry>
<title>box-drawing: big-endian support when setting bits manually</title>
<updated>2021-07-14T17:46:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-13T19:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=34f42b3dd638195bc35acdaa87762d0915757eee'/>
<id>urn:sha1:34f42b3dd638195bc35acdaa87762d0915757eee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: pre-calculate the LIGHT and HEAVY thicknesses</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-07T16:01:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8473deeed35e811152a145e26ed15372009edeeb'/>
<id>urn:sha1:8473deeed35e811152a145e26ed15372009edeeb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: always pass ‘buf’ as the first parameter</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-07T15:39:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3dbb9063258ab904552b9ec3369725f585e99fa2'/>
<id>urn:sha1:3dbb9063258ab904552b9ec3369725f585e99fa2</id>
<content type='text'>
This way, the compiler doesn’t have to waste instructions on
re-ordering the parameters
</content>
</entry>
<entry>
<title>box-drawing: don’t inline _thickness()</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-07T12:34:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=25ce458281facca6a8945a556ba2f9a81a1a6992'/>
<id>urn:sha1:25ce458281facca6a8945a556ba2f9a81a1a6992</id>
<content type='text'>
It results in quite a lot of floating point instructions being emitted
in almost every box drawing function we have...
</content>
</entry>
<entry>
<title>box-drawing: use fill_boxes() instead of fill_rectangles()</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-07T12:09:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b48414e72c5f690ab5326b42bf11b4f487109613'/>
<id>urn:sha1:b48414e72c5f690ab5326b42bf11b4f487109613</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: increase brightness of solid shades</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-07T09:42:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b771a28d17397892eebdacdfb07fba6e331a0207'/>
<id>urn:sha1:b771a28d17397892eebdacdfb07fba6e331a0207</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: add tweak.box-drawing-solid-shades=yes|no</title>
<updated>2021-05-17T15:58:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-05T20:24:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e7109d6b7739503c1d69749bda63460fb65580f0'/>
<id>urn:sha1:e7109d6b7739503c1d69749bda63460fb65580f0</id>
<content type='text'>
When enabled, shades are rendered as solid blocks, using a darker
variant of the current foreground color.

When disabled, shades are instead rendered in a checker box pattern,
using the foreground color unmodified.

Default is enabled.
</content>
</entry>
</feed>
