* Split up source files into several static libraries: misc + vtlib
* Add a new executable, pgo, that links to vtlib
* pgo is kind of like a mock test:
- provides stub implementations of functions not present in vtlib
- sets up a dummy terminal instance
- calls vt_from_slave() with static (pre-generated) content
Instead of writing (and logging errors for) every parameter, one at a
time, send all fixed size data in a single struct, followed by all the
variable length data.
* New function: rgb_to_hsl()
* New function: hsl_to_rgb()
* Replace XTerm’s hls_to_rgb() with our own, hsl_to_rgb().
* Ensure hue/lum/sat values are within range before calling
hsl_to_rgb()
Note that sixels’ use the following primary hues:
* blue: 0°
* red: 120
* green: 240°
While “standard” HSL uses:
* red: 0°
* green: 120°
* blue: 240°
Thus, we need to adjust the sixel’s hue value before calling
hsl_to_rgb().
Use the new fcft_set_scaling_filter() API to use a non-default scaling
filter.
By default, we use lanczo3, the ‘best’ filter. This overrides the
default in fcft, which is ‘cubic’ filtering.
This removes the DWARF stack unwinding tables, which shrinks the
".eh_frame" and ".eh_frame_hdr" sections by about 24KiB. Stack
unwinding tables are pretty useless to a C program compiled in
release mode.
* Rename user_warning to user_notification
* Add warning and error types (in addition to the existing deprecated)
* Simplify logic when emitting a user notification after forking; we
don't need to copy the notification data since we're in a new
process and have total control over that memory.
When resizing the font on-the-fly, we now do a complete
font-reload (this is basically what fcft_size_adjust() did anyway).
To get the correct size, we maintain the current size ourselves.
We get the initial size from the user-provided font pattern, by
converting the string to an FcPattern, and using FcPatternGet() to
retrieve both the FC_SIZE and FC_PIXEL_SIZE attributes. These
attributes are then removed from the pattern, and the pattern is
converted back to a string.
The terminal struct maintains a copy of the font sizes. These are
initially set to the sizes from the config.
When the user resizes the font, the terminal-local sizes are
adjusted. To ensure the primary and user-configured fallback fonts are
resizes equally much, convert any pixel sizes to point sizes at this
point.
When the font size is reset, we reload the font sizes from the
config (thus once again returning actual pixel-sizes, if that's what
the user has configured).
Use a signalfd to listen for SIGCHLD signals.
When we receive a SIGCHLD over the signalfd, reap all dead children by
looping over all registered child PIDs and call waitpid(WNOHANG) on
them.
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.
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.
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 >= COMB_CHARS_LO).
Then we render the grapheme pretty much like before.