<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/vt.c, branch 1.3.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.3.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.3.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-05-10T15:10:33Z</updated>
<entry>
<title>unicode-combine: simplify - remove -Dunicode-precompose option</title>
<updated>2020-05-10T15:10:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-10T15:10:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=00df12f1a3cfee6c0f876f4e082ce3efbeba0bda'/>
<id>urn:sha1:00df12f1a3cfee6c0f876f4e082ce3efbeba0bda</id>
<content type='text'>
Since the pre-composing functionality is now part of fcft, it makes
little sense to have a compile time option - there's no size benefit
to be had.

Furthermore, virtually all terminal emulators do
pre-composing (alacritty being an exception), this really isn't that
controversial.
</content>
</entry>
<entry>
<title>unicode-precompose: use fcft's precompose functionality</title>
<updated>2020-05-09T10:06:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-08T21:36:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b1b32152c182fdb0b9494e75acb605d0486e30fa'/>
<id>urn:sha1:b1b32152c182fdb0b9494e75acb605d0486e30fa</id>
<content type='text'>
This allows us more options when determining whether to use a
pre-composed character or not:

We now only use the pre-composed character if it's from the primary
font, or if at least one of the base or combining characters are from
a fallback font.

I.e. use glyphs from the primary font if possible. But, if one or more
of the decomposed glyphs are from a fallback font, use the
pre-composed character anyway.
</content>
</entry>
<entry>
<title>unicode-combining: limit maximum number of allowed composed chains</title>
<updated>2020-05-03T09:31:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-03T09:31:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4d4df92f661c6756cffd2ab6bc7983c3f1ced8c2'/>
<id>urn:sha1:4d4df92f661c6756cffd2ab6bc7983c3f1ced8c2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unicode-combining: detect when we've reached the chain limit</title>
<updated>2020-05-03T09:27:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-03T09:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ebdc0116263c2ac8f5b4de98c8bfe0aa768480b'/>
<id>urn:sha1:1ebdc0116263c2ac8f5b4de98c8bfe0aa768480b</id>
<content type='text'>
We currently store up to 5 combining characters in any given
base+combining chain.

This adds a check for when that limit is about to be exceeded. When
this happens, we log the chain + the new combining character.

Since things will break anyway, we simply overwrite the last combining
character.
</content>
</entry>
<entry>
<title>unicode-combining: store seen combining chains "globally" in the term struct</title>
<updated>2020-05-03T09:03:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-03T09:03:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=62e07743194c8051334ed9b23be90ce31ab80773'/>
<id>urn:sha1:62e07743194c8051334ed9b23be90ce31ab80773</id>
<content type='text'>
Instead of storing combining data per cell, realize that most
combinations are re-occurring and that there's lots of available space
left in the unicode range, and store seen base+combining combinations
chains in a per-terminal array.

When we encounter a combining character, we first try to pre-compose,
like before. If that fails, we then search for the current
base+combining combo in the list of previously seen combinations. If
not found there either, we allocate a new combo and add it to the
list. Regardless, the result is an index into this array. We store
this index, offsetted by COMB_CHARS_LO=0x40000000ul in the cell.

When rendering, we need to check if the cell character is a plain
character, or if it's a composed character (identified by checking if
the cell character is &gt;= COMB_CHARS_LO).

Then we render the grapheme pretty much like before.
</content>
</entry>
<entry>
<title>vt: use signed integers to correctly detect when we're done</title>
<updated>2020-05-02T18:01:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-02T18:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b10436e49b754478c2a6fa3889ab46d3f71772fe'/>
<id>urn:sha1:b10436e49b754478c2a6fa3889ab46d3f71772fe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>meson: don't generate pre-compose table when -Dunicode-precompose=false</title>
<updated>2020-05-02T16:43:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-02T16:43:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=804642580e98ce01eb7ca90a24a88182daca4a16'/>
<id>urn:sha1:804642580e98ce01eb7ca90a24a88182daca4a16</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unicode-combine: remove utf8proc dependency</title>
<updated>2020-05-02T15:29:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-02T15:29:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d945b68b734427a03d114716ff8aeac7998a7c57'/>
<id>urn:sha1:d945b68b734427a03d114716ff8aeac7998a7c57</id>
<content type='text'>
We only used utf8proc to try to pre-compose a glyph from a base and
combining character.

We can do this ourselves by using a pre-compiled table of valid
pre-compositions. This table isn't _that_ big, and binary searching it
is fast.

That is, for a very small amount of code, and not too much extra RO
data, we can get rid of the utf8proc dependency.
</content>
</entry>
<entry>
<title>unicode-combining: don't limit ourselves to the (western) diacritics blocks</title>
<updated>2020-05-02T14:11:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-02T14:11:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8389c76549d0bd04fc3a8a8c6d370ac0a79eee2f'/>
<id>urn:sha1:8389c76549d0bd04fc3a8a8c6d370ac0a79eee2f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unicode-combine: only compose if we don't have any other combining characters</title>
<updated>2020-05-01T18:17:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T18:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=50543983ad109b7a48b3c4dc0ff114702e09cb9e'/>
<id>urn:sha1:50543983ad109b7a48b3c4dc0ff114702e09cb9e</id>
<content type='text'>
If the client sent the sequence SAB, where SA does NOT have a composed
representation, but SB does, the old code would compose SB and throw
away A.

This patch fixes this by only allowing a compose if there aren't
any pre-existing combining characters.
</content>
</entry>
<entry>
<title>vt: utf8: track combining characters that we failed to compose</title>
<updated>2020-05-01T09:52:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T09:52:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb5f80ec6a8bda1f71581261cc3fc56b20ebdd7d'/>
<id>urn:sha1:cb5f80ec6a8bda1f71581261cc3fc56b20ebdd7d</id>
<content type='text'>
When we detect a combining character, we first try to compose it with
the base character (like before).

When this fails, we instead add the combining character to the base
cell's combining characters array.

The reason for using a composed character when possible is twofold:
one, the rendered glyph will look better since it will be a single
glyph instead of two separate glyphs (possibly from different
fonts(!)). And two, for performance. A composed glyph is a single
glyph to render, while a decomposed glyph sequence means the renderer
has to render multiple glyphs for a single cell.
</content>
</entry>
<entry>
<title>util.h: new header file defining commonly used macros</title>
<updated>2020-05-01T09:46:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-05-01T09:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=69c3e744983e37662fa7b4f61482fb1d142e257c'/>
<id>urn:sha1:69c3e744983e37662fa7b4f61482fb1d142e257c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: lazily reset utf8 in action_utf8_*_entry</title>
<updated>2020-04-27T13:50:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-27T13:50:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3f3fff768aebe4d1a7822bbe3ecc3e68a3023c8f'/>
<id>urn:sha1:3f3fff768aebe4d1a7822bbe3ecc3e68a3023c8f</id>
<content type='text'>
action_clear() is in the super hot code path. Avoid resetting utf8
state there, as utf8 input is relatively uncommon.

Instead, reset it when we explicitly enter any of the utf8 collecting
states, as this is exactly the point where we need it.
</content>
</entry>
<entry>
<title>vt: action_utf8_print: idx is cleared in action_clear()</title>
<updated>2020-04-27T13:49:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-27T13:49:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d1fc419e34b125dc99a6f5e5e1818fb1e8e72096'/>
<id>urn:sha1:d1fc419e34b125dc99a6f5e5e1818fb1e8e72096</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vt: utf8-*-entry: idx is cleared in action_clear()</title>
<updated>2020-04-27T13:47:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-27T13:47:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4278af99d2954bd8d87c0db6fa1290663c1d9040'/>
<id>urn:sha1:4278af99d2954bd8d87c0db6fa1290663c1d9040</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: remove unneeded utf8.left member</title>
<updated>2020-04-27T13:06:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-27T13:06:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e478874dd9cefb08011c46d43deb850e68a4458b'/>
<id>urn:sha1:e478874dd9cefb08011c46d43deb850e68a4458b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>utf8: add support for unicode combining characters</title>
<updated>2020-04-27T10:13:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-27T10:13:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4283a8c51b37330ded50e49f61c6c9a3a4fe19b8'/>
<id>urn:sha1:4283a8c51b37330ded50e49f61c6c9a3a4fe19b8</id>
<content type='text'>
This feature lets foot combine e.g. "a\u0301" to "á".

We first check if the current character (that we're about to print) is
a combining character, by checking if it's in one of the following
ranges:

* Combining Diacritical Marks (0300–036F), since version 1.0, with
  modifications in subsequent versions down to 4.1
* Combining Diacritical Marks Extended (1AB0–1AFF), version 7.0
* Combining Diacritical Marks Supplement (1DC0–1DFF), versions 4.1 to 5.2
* Combining Diacritical Marks for Symbols (20D0–20FF), since version
  1.0, with modifications in subsequent versions down to 5.1
* Combining Half Marks (FE20–FE2F), versions 1.0, with modifications
  in subsequent versions down to 8.0

If it is, we check if the last cell appears to contain a valid symbol,
and if so, we attempt to compose (combine) the last cell with the
current character, using utf8proc.

If the result is a combined character, we replace the content in the
previous cell with the new, combined character.

Thus, if you select and copy the printed character, you would get
e.g. "\u00e1" instead of "a\u0301".

This feature can be disabled. By default, it is enabled if the
utf8proc library is found, but can be explicitly disabled, or enabled,
with 'meson -Dunicode-combining=disabled|enabled'.
</content>
</entry>
<entry>
<title>grid: move 'cursor' state from terminal to grid</title>
<updated>2020-04-16T16:51:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-16T16:51:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=89559d5466502176995720a33316714012a638d1'/>
<id>urn:sha1:89559d5466502176995720a33316714012a638d1</id>
<content type='text'>
This way, the 'normal' and 'alt' grids have their own cursor state,
and we don't need to switch between them.
</content>
</entry>
<entry>
<title>mbstate: fix compile warning on systems where mbstate_t isn't an integral</title>
<updated>2020-04-13T09:58:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-13T09:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d67f437458ed96b55d475a471d1a16da52ca4cd4'/>
<id>urn:sha1:d67f437458ed96b55d475a471d1a16da52ca4cd4</id>
<content type='text'>
An empty initializer still ensures the entire object is
zero-initialized.
</content>
</entry>
<entry>
<title>alt-screen: use a custom 'saved' cursor when switching to alt screen</title>
<updated>2020-03-16T11:00:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-16T11:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1006608093fbbe19103f63fc1140b122a3904500'/>
<id>urn:sha1:1006608093fbbe19103f63fc1140b122a3904500</id>
<content type='text'>
This fixes an issue where we failed to restore the cursor correctly
when exiting from the alternate screen, if the client had sent escapes
to save the cursor position while inside the alternate screen.

This was because we used the *same* storage for saving the cursor
position through escapes, as for saving it when entering the alternate
screen.

Fix by using a custom variable dedicated to normal &lt;--&gt; alt screen
switching.
</content>
</entry>
</feed>
