Mitchell Hashimoto
5e9ddb5e65
renderer/metal: offset zero-advance glyphs by the cell width
2023-12-10 17:08:32 -08:00
Mitchell Hashimoto
0b60ae0010
renderer/metal,opengl: replace matching image IDs if transmit time differs
...
Fixes #1037
Renderers must convert the internal Kitty graphics state to a GPU
texture for rendering. For performance reasons, renderers cache the GPU
state by image ID. Unfortunately, this meant that if an image was
replaced with the same ID and was already cached, it would never be
updated on the GPU.
This PR adds the transmission time to the cache. If the transmission
time differs, we assume the image changed and replace the image.
2023-12-10 09:16:10 -08:00
Mitchell Hashimoto
56c6c096fa
renderer: handle scenarios the preedit text is wider than our screen
2023-12-03 20:16:49 -08:00
Mitchell Hashimoto
0cdefe8b8b
core: remove size limit on preedit length by heap allocating
...
Fixes #882
We previously had a hardcoded limit of 16 codepoints. In #882 , a user
pointed out that in Chinese, is reasonable for a preedit input to be
longer than this.
To avoid any future issues, this commit moves to a heap-allocated
variant. Preedits aren't that common, they aren't high throughput, and
they're generally pretty small, so using a heap allocation is fine. The
memory is owned by the person who set it.
2023-12-03 19:54:26 -08:00
Mitchell Hashimoto
7f40881747
font: faces use primary grid metrics to better line up glyphs
...
Fixes #895
Every loaded font face calculates metrics for itself. One of the
important metrics is the baseline to "sit" the glyph on top of. Prior to
this commit, each rasterized glyph would sit on its own calculated
baseline. However, this leads to off-center rendering when the font
being rasterized isn't the font that defines the terminal grid.
This commit passes in the font metrics for the font defining the
terminal grid to all font rasterization requests. This can then be used
by non-primary fonts to sit the glyph according to the primary grid.
2023-12-02 09:51:15 -08:00
Mitchell Hashimoto
7af4009f27
renderer/metal: minimum contrast ratio is configurable
2023-12-01 21:24:38 -08:00
Mitchell Hashimoto
6c859cca82
renderer/metal: minimum contrast experiment
...
This uses WCAG2 algorithms with a minimum ratio hardcoded of 3:1. This
is not shippable in its current state because we want the ratio to be
configurable and I'm not happy with the way data is being sent to the
shader.
2023-12-01 20:51:16 -08:00
Mitchell Hashimoto
8fcf3f08dd
core: send mouse hover point
2023-11-29 15:30:22 -08:00
Mitchell Hashimoto
5a7596e1b1
renderer: link set for more efficient matching
2023-11-29 15:30:22 -08:00
Mitchell Hashimoto
aa86031ff6
terminal: move line searching here, unit test
2023-11-29 15:30:22 -08:00
Mitchell Hashimoto
5db002cb12
renderer/metal: underline urls
2023-11-29 15:30:21 -08:00
Mitchell Hashimoto
cf8a0bdaec
renderer: handle Kitty images where z < 0 for all placements
2023-11-20 21:34:17 -08:00
Mitchell Hashimoto
9988dedb80
renderr/opengl: stylistic
2023-11-20 09:45:38 -08:00
Mitchell Hashimoto
e55cb274ba
config: custom-shader-animation
2023-11-17 21:51:07 -08:00
Mitchell Hashimoto
4742cd308d
renderer: animation timer if we have custom shaders
2023-11-17 21:50:53 -08:00
Mitchell Hashimoto
244e7266a1
renderer/metal: don't recreate custom shader resources per frame
2023-11-17 21:50:53 -08:00
Mitchell Hashimoto
d3bc1ab6da
renderer/metal: reuse an intermediate texture for custom shaders
2023-11-17 21:50:53 -08:00
Mitchell Hashimoto
01a73994cb
renderer/metal: setup sampler state
2023-11-17 21:50:53 -08:00
Mitchell Hashimoto
1e572fb10b
renderer/metal: load custom shaders
2023-11-17 21:50:52 -08:00
Mitchell Hashimoto
c347148fd7
renderer/metal: CRT effect, ugly hacky code
2023-11-17 21:50:34 -08:00
Mitchell Hashimoto
3095dce685
renderer/metal: wip for loading custom shader pipelines
2023-11-17 21:50:34 -08:00
Mitchell Hashimoto
389712a698
renderer/opengl: switch to new update vs draw
2023-11-17 21:50:34 -08:00
Mitchell Hashimoto
0e92f68228
renderer: separate update frame data from draw
2023-11-17 21:50:34 -08:00
Mitchell Hashimoto
67dce5ce0e
update zig-objc
2023-11-17 21:50:34 -08:00
Mitchell Hashimoto
45dfbfe53c
renderer: address issue with inverted cells
2023-11-17 21:47:24 -08:00
Raiden1411
fd444b6d05
renderer: add support for metal
2023-11-18 01:08:18 +00:00
Krzysztof Wolicki
44a48f62f1
change unmodified var
s to const
s in anticipation of zig changes
2023-11-17 15:46:46 +01:00
Mitchell Hashimoto
b5bf7e9d3b
Merge pull request #890 from mitchellh/faint-bg
...
renderer: faint should not be applied to bg alpha
2023-11-15 11:41:35 -08:00
Mitchell Hashimoto
ed3e3764d9
renderer: faint should not be applied to bg alpha
...
Fixes #889
2023-11-15 11:38:16 -08:00
Mitchell Hashimoto
ad24e5e687
renderer/opengl: use new preedit format
2023-11-15 09:59:08 -08:00
Mitchell Hashimoto
7457b40a45
renderer/metal: handle preedit wider than our screen
2023-11-15 09:53:51 -08:00
Mitchell Hashimoto
50f0aaf26b
renderer/metal: support multi-codepoint preedit text
2023-11-15 09:49:28 -08:00
Mitchell Hashimoto
5c8c4bb06e
renderer/opengl: handle wide preedit
2023-11-10 17:30:14 -08:00
Mitchell Hashimoto
ce4541dd61
core, renderer: handle wide preedit chars
...
Fixes #855
2023-11-10 17:26:36 -08:00
Gregory Anders
171292a063
core: implement OSC 12 and OSC 112 to query/set/reset cursor color
2023-11-09 16:21:07 -06:00
Gregory Anders
1c0b79c40f
core: separate default colors from modifiable colors
...
Default colors are those set by the user in the config file, or an
actual default value if unset. The actual colors are modifiable and can
be changed using the OSC 4, 10, and 11 sequences.
2023-11-09 14:08:14 -06:00
Nawaf
b3dd363e3b
fix macos font being drawn thicker when updating font size
2023-11-06 00:25:38 -05:00
Lukáš Dvořák
bca7140248
balanced padding cleanup
2023-10-30 14:56:02 +01:00
Lukáš Dvořák
6887ea7e53
fix window-padding-balance in combination with explicit padding
2023-10-30 13:46:19 +01:00
Mitchell Hashimoto
95f0b4779d
renderer/metal: reclaim cell buffer memory when resizing
2023-10-28 11:30:02 -07:00
Mitchell Hashimoto
ab35a21dc2
renderer: render cursor behind colored emoji
2023-10-16 12:57:23 -07:00
Mitchell Hashimoto
b4070eb67e
renderer: unfocused cursor should always be fully opaque
2023-10-14 14:11:15 -07:00
Mitchell Hashimoto
ff38d3e358
config: add cursor-opacity
2023-10-14 14:08:06 -07:00
Mitchell Hashimoto
7167cf9054
renderer: default cursor color to foreground
...
Fixes #667
2023-10-14 14:02:17 -07:00
Mitchell Hashimoto
4f5a05e087
renderer: render cursor over wide character if on tail part
2023-10-13 14:39:10 -07:00
Mitchell Hashimoto
7995d44cfb
font: render sprites with a configurable grid cell width
...
Fixes #666
2023-10-13 14:31:55 -07:00
Mitchell Hashimoto
b98cc3d79f
config: add remaining font modifiers
2023-10-04 22:08:19 -07:00
Mitchell Hashimoto
5c1fbd09cd
font: shaper dynamically allocates cell buffer
...
Pathlogical grapheme clusters can use a LOT of memory, so we need to be
able to grow.
2023-09-26 17:59:16 -07:00
Mitchell Hashimoto
b1389cbbfe
renderer: support font style changing at runtime
2023-09-26 08:51:04 -07:00
Mitchell Hashimoto
4b791f3ee1
renderer: always reset font group on config change
2023-09-26 08:18:11 -07:00