<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/box-drawing.c, branch spawn-terminal-cmdline-arguments</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=spawn-terminal-cmdline-arguments</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=spawn-terminal-cmdline-arguments'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-12-26T14:00:18Z</updated>
<entry>
<title>box-drawing: fenv.h: remove, not needed anymore</title>
<updated>2025-12-26T14:00:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-12-26T14:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=41679e64a84977225e193f4eb734ab0a0eab1e09'/>
<id>urn:sha1:41679e64a84977225e193f4eb734ab0a0eab1e09</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawings: handle architecture with soft-float</title>
<updated>2025-02-05T12:31:46Z</updated>
<author>
<name>Thomas Bonnefille</name>
<email>thomas.bonnefille@bootlin.com</email>
</author>
<published>2025-02-04T08:48:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9443ac7e2937bb4f26cf44c73bb8150860c5df45'/>
<id>urn:sha1:9443ac7e2937bb4f26cf44c73bb8150860c5df45</id>
<content type='text'>
Currently, architecture using soft-floats doesn't support instructions
FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW and FE_UNDERFLOW and so building
on those architectures results with a build error.
As the sqrt math function should set errno to EDOM if an error occurs,
fetestexcept shouldn't be mandatory.

This commit removes the float environment error handling.

Signed-off-by: Thomas Bonnefille &lt;thomas.bonnefille@bootlin.com&gt;
</content>
</entry>
<entry>
<title>box-drawings: implement octants</title>
<updated>2024-12-08T11:55:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-12-08T08:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9a1b59adaec22434473789953884c9b6db58e9a5'/>
<id>urn:sha1:9a1b59adaec22434473789953884c9b6db58e9a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't use fancy Unicode quotes, stick to ASCII</title>
<updated>2024-02-06T11:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7999975016a57cc0a2c2e20bc55f29de32df7044'/>
<id>urn:sha1:7999975016a57cc0a2c2e20bc55f29de32df7044</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: cache font baseline</title>
<updated>2023-10-10T12:23:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-10T12:23:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4449177517c2d96857483acbc8afd7438fcdfadd'/>
<id>urn:sha1:4449177517c2d96857483acbc8afd7438fcdfadd</id>
<content type='text'>
No need to redo the calculation for every single cell we render,
every frame...
</content>
</entry>
<entry>
<title>render: apply new baseline calculation everywhere</title>
<updated>2023-07-25T13:53:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-23T15:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a36f67cbe311bebd9321fbf58773dace8128fcd7'/>
<id>urn:sha1:a36f67cbe311bebd9321fbf58773dace8128fcd7</id>
<content type='text'>
* URL jump labels
* Scrollback position indicator
* Line/box drawings characters

Closes #1430
</content>
</entry>
<entry>
<title>Use circles for rendering light arc box-drawing characters.</title>
<updated>2022-04-03T16:49:47Z</updated>
<author>
<name>L3MON4D3</name>
<email>Simljk@outlook.de</email>
</author>
<published>2022-03-23T10:55:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d6dab2f2ba8c82cc9a3eb1eb40cb836a2fc2806b'/>
<id>urn:sha1:d6dab2f2ba8c82cc9a3eb1eb40cb836a2fc2806b</id>
<content type='text'>
Ellipses can look weird when the font is narrow.

Closes #988
</content>
</entry>
<entry>
<title>fcft: adapt to API changes in fcft-3.x</title>
<updated>2022-02-05T16:00:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-21T12:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0227266cabc015c282774ac898e3f52dce943df'/>
<id>urn:sha1:e0227266cabc015c282774ac898e3f52dce943df</id>
<content type='text'>
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.

Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.

For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).

Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.

These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.

For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the  __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.

FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.

Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.

Other fcft API changes:

* fcft_glyph_rasterize() -&gt; fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
</content>
</entry>
<entry>
<title>box-drawing: LIGHT ARC: check for sqrt() failures</title>
<updated>2022-02-04T17:15:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-03T21:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e97e873b9ef448aa2796667ba1d0a69ffe2e07e0'/>
<id>urn:sha1:e97e873b9ef448aa2796667ba1d0a69ffe2e07e0</id>
<content type='text'>
Closes #914
</content>
</entry>
<entry>
<title>term: only scale using DPI if *all* monitors have a scaling factor or one</title>
<updated>2021-09-24T20:07:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-19T09:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fb77637eb96a71de48b49e40fbe7dd71ec85bcbf'/>
<id>urn:sha1:fb77637eb96a71de48b49e40fbe7dd71ec85bcbf</id>
<content type='text'>
With dpi-aware=auto (the default), scale fonts using DPI *only*
if *all* available monitors have a scaling factor of one.

The idea is this: if a user, with multiple monitors, have enabled
scaling on *at least* one monitor, he/she has most likely done so to
match the size of his/hers other monitors.

For example, if the user has one monitor with a scaling factor of one,
and another one with a scaling factor of two, he/she expects things to
be twice as large on the second monitor.

If we (foot) scale using DPI on the first monitor, and using the
scaling factor on the second monitor, foot will *not* look twice as
big on the second monitor (this was the old behavior of
dpi-aware=auto).

Part of #714
</content>
</entry>
<entry>
<title>box-drawing: repair debug logs</title>
<updated>2021-09-19T09:49:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-19T09:49:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=705b5d786ca369f8c9d9ea2186ac77dffec6e809'/>
<id>urn:sha1:705b5d786ca369f8c9d9ea2186ac77dffec6e809</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: braille: prefer increasing spacing over dot width</title>
<updated>2021-09-14T08:20:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-14T08:20:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e426e77b1d3640868b521b65617525f76ab3b35c'/>
<id>urn:sha1:e426e77b1d3640868b521b65617525f76ab3b35c</id>
<content type='text'>
Too large dots make them harder to distinguish, when the spacing
between them is small.

Prefer increasing the spacing, instead of increasing the dot
size. This looks better at small font sizes in particular.
</content>
</entry>
<entry>
<title>box-drawing: NOINLINE braille</title>
<updated>2021-09-12T17:22:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-05T08:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ac2091f107cbcca546d9f62fc81c5a519aec67dc'/>
<id>urn:sha1:ac2091f107cbcca546d9f62fc81c5a519aec67dc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>box-drawing: add braille characters</title>
<updated>2021-09-12T17:22:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-02T12:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b4c759e2de429c20bf07c9e16162d154152014d9'/>
<id>urn:sha1:b4c759e2de429c20bf07c9e16162d154152014d9</id>
<content type='text'>
Render braille ourselves, instead of using font glyphs. Decoding a
braille character is easy enough; there are 256 codepoints,
represented by an 8-bit integer (i.e. subtract the Unicode codepoint
offset, 0x2800, and you’re left with an integer in the range 0-255).

Each bit corresponds to a dot. The first 6 bits represent the upper 6
dots, while the two last bits represent the fourth (and last) row of
dots.

The hard part is sizing the dots and the spacing between them.

The aim is to have the spacing between the dots be the same size as
the dots themselves, and to have the margins on each side be half the
size of the dots.

In a perfectly sized cell, this means two braille characters next to
each other will be evenly spaced.

This is however almost never the case. The layout logic currently:

* Set dot size to either the width / 4, or height / 8, depending on
  which one is smallest.

* Horizontal spacing is initialized to the width / 4

* Vertical spacing is initialized to the height / 8

* Horizontal margins are initialized to the horizontal spacing / 2

* Vertical margins are initialized to the vertical spacing / 2.

Next, we calculate the number of “remaining” pixels. That is, if we
add the left margin, two dots and the spacing between, how many pixels
are left on the horizontal axis?

These pixels are distributed in the following order (we “stop” as soon
as we run out of pixels):

* If the dot size is 0 (happens for very small font sizes), increase
  it to 1.
* If the margins are 0, increase them to 1.
* If we have enough pixels (need at 2 horizontal and 4 vertical),
  increase the dot size.
* Increase spacing.
* Increase margins.

Closes #702
</content>
</entry>
<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>
</feed>
