222 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2ee54879a4 renderer: use fg as extension color for covering glyphs (U+2588)
Fixes #2099

This is another heuristic of sorts to make `window-padding-color=extend`
look better by default. If a fully covering glyph is used then we use
the fg color to extend rather than the background.

This doesn't account for fonts that may do this for whatever codepoints,
but I think that's a special scenario that we should just recommend
disabling this feature.
2024-08-18 11:56:50 -07:00
Qwerasd
37872afbce kitty graphics: support loading 1 channel grayscale images 2024-08-15 21:38:46 -04:00
Mitchell Hashimoto
bc667714dd renderer/opengl: add comment explaning ogl lock on darwin 2024-08-15 14:25:05 -07:00
Qwerasd
57d850822e macos/opengl: lock context while rendering to stop resize crashes 2024-08-14 23:47:33 -04:00
Qwerasd
900aab10f2 renderer: don't update frame if renderer grid size != terminal size 2024-08-14 22:43:58 -04:00
Qwerasd
10b8ca3c69 spelling: normalize grey -> gray 2024-08-11 18:31:01 -04:00
Mitchell Hashimoto
f7f8c655df renderer: remove alt-screen extend-always 2024-08-10 10:39:10 -07:00
Mitchell Hashimoto
9f06e74353 config: add window-padding-color=extend-always to force always 2024-08-10 10:34:12 -07:00
Mitchell Hashimoto
e4b8cac7ad renderer/opengl: reset screen uniforms on font change
Fixes #2067
2024-08-09 10:26:46 -07:00
Mitchell Hashimoto
0f8ed39766 Merge pull request #2049 from pluiedev/fix/exempt-powerline-from-minimum-contrast
renderer: exempt Powerline cells from minimum contrast requirements
2024-08-06 10:12:14 -07:00
Leah Amelia Chen
503dfae6ff renderer: exempt Powerline cells from minimum contrast requirements
With a minimum contrast set, the colored glyphs that Powerline uses
would sometimes be set to white or black while the surrounding background
colors remain unchanged, breaking up contiguous colors on segments of
the Powerline.

This no longer happens with this patch as Powerline glyphs are now
special-cased and exempt from the minimum contrast adjustment.
2024-08-06 15:28:50 +08:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Mitchell Hashimoto
ea551990eb renderer: disable window-padding-color=extend in certain scenarios
There are scenarios where this configuration looks bad. This commit
introduces some heuristics to prevent it. Here are the heuristics:

  * Extension is always enabled on alt screen.
  * Extension is disabled if a row contains any default bg color. The
    thinking is that in this scenario, using the default bg color looks
    just fine.
  * Extension is disabled if a row is marked as a prompt (using semantic
    prompt sequences). The thinking here is that prompts often contain
    perfect fit glyphs such as Powerline glyphs and those look bad when
    extended.

This introduces some CPU cost to the extension feature but it should be
minimal and respects dirty tracking. This is unfortunate but the feature
makes many terminal scenarios look much better and the performance cost
is minimal so I believe it is worth it.

Further heuristics are likely warranted but this should be a good
starting set.
2024-08-03 21:56:19 -07:00
Mitchell Hashimoto
ed1c163c7b renderer/opengl: support window-padding-color=extend 2024-08-03 16:29:17 -07:00
Mitchell Hashimoto
62cc279fc0 Merge pull request #1989 from gpanders/cursor-invert-fg-bg
config: add cursor-invert-fg-bg option
2024-07-31 19:39:27 -07:00
Mitchell Hashimoto
765254e784 renderer/opengl: unicode placeholder support 2024-07-29 19:15:42 -07:00
Mitchell Hashimoto
763e7fab8a renderer: skip virtual placements 2024-07-25 21:32:44 -07:00
Gregory Anders
3e4a8644b5 renderer/opengl: implement cursor-invert-fg-bg 2024-07-22 16:23:06 -05:00
Mitchell Hashimoto
af132a3838 Merge pull request #1872 from qwerasd205/various-performance
Various Performance Changes
2024-06-23 09:51:21 -07:00
Mitchell Hashimoto
71353d016e coretext shaper owns CFReleaseThread, works on both Metal and OpenGL now 2024-06-22 20:42:59 -07:00
Mitchell Hashimoto
4325dc51bc font: coretext shaper owns the cf release pool 2024-06-22 20:32:24 -07:00
Mitchell Hashimoto
6f43c01b76 renderer/opengl: invert cursor cell text when glyph is constrained
Fixes #1867
2024-06-18 14:59:49 -07:00
Qwerasd
3f3db4896b add CFReleasePool handling to OpenGL renderer 2024-06-14 02:07:17 -04:00
Mitchell Hashimoto
a502089582 renderer/opengl: don't append assume capacity
Fixes #1815
2024-06-03 20:55:11 -07:00
Jan200101
94a7166028 terminal: support using the bright palette for bold text 2024-05-25 16:58:19 +02:00
Mitchell Hashimoto
06bcbe868f renderer: kitty image with y offset should stretch image
Fixes #1784

This was just a misunderstanding of the "spec." When both a y offset
into the image is specified and a height, the image should be stretched.
I mistakingly thought that the image should be offset (even with this
misunderstanding there was a data corruption bug).

This resolves the issue and output matches Kitty.
2024-05-22 15:40:31 -04:00
Qwerasd
ac5725d582 fix(renderer): rebuild font grid and reset shaper cache on hot reload
When hot reloading config with a new font, shaper cache data needs to be
invalidated and the font grid needs to be rebuilt. This change just
makes that happen on all config reloads since it's a rare action so it's
not a performance concern.
2024-05-10 09:39:07 -07:00
Mitchell Hashimoto
8fdf6b4b64 renderer: add window-vsync option (defaults to false) 2024-05-05 10:18:15 -07:00
Mitchell Hashimoto
ac813c9244 renderer/metal: stop/start display link on occlusion 2024-05-04 14:49:50 -07:00
Mitchell Hashimoto
406824bcd4 renderer/opengl: use shaper cache 2024-05-01 19:43:48 -07:00
Mitchell Hashimoto
f7714a113d renderer/opengl: fix compilation 2024-04-28 09:40:03 -07:00
Mitchell Hashimoto
4398896905 renderer/opengl: strikethrough as sprite 2024-04-22 10:30:27 -07:00
Mitchell Hashimoto
06df9b7867 font: remove old files 2024-04-06 20:10:57 -07:00
Mitchell Hashimoto
e3402cef4d address many fontmem todos 2024-04-06 20:00:22 -07:00
Mitchell Hashimoto
3b0b9c2cfd renderer/opengl: set the font grid 2024-04-06 19:55:00 -07:00
Mitchell Hashimoto
3afeac99e9 renderer/opengl: support font size change 2024-04-06 19:35:56 -07:00
Mitchell Hashimoto
a22ca8e4c1 renderer/opengl: clean up texture sync 2024-04-06 09:34:34 -07:00
Mitchell Hashimoto
45f518851d renderer/opengl: convert to SharedGrid, new windows/tabs are frozen 2024-04-05 22:00:51 -07:00
Mitchell Hashimoto
fd9280429e renderer: re-enable URL underlining 2024-03-22 20:28:05 -07:00
Mitchell Hashimoto
d1faa37b65 renderer/opengl: convert 2024-03-22 20:28:01 -07:00
Qwerasd
e8460fa2c2 fix(renderer): allocate enough room for fg cells
Previously encountered OOB when screen filled with cells with glyphs,
underlines, and strikethroughs. Also clarified comment slightly.
2024-03-03 20:26:51 -05:00
Mitchell Hashimoto
6de4533afb core: handle mouse capture events with link highlighting
Fixes #1416

At a high level, the issue is that when mouse capture is enabled (i.e. in
neovim), "shift" escapes the capture. So "cmd+shift" is equal to "cmd"
which doesn't get sent to the TUI program and so on. For link
highlighting which now requires "cmd" (super) is held, we were sending
"cmd+shift" to the renderer so we weren't checking for links.

So the core of this commit is respecting this scenario and stripping the
shift modifier.

This commit also found that when the mouse wasn't over a link, we were
always checking and highlighting links on line one of the visible
screen. This bug is fixed and should also result in a very slight
performance improvement on rendering in all cases.
2024-02-01 09:19:39 -08:00
Leaf Garland
d1d7665510 Default to background color for cursor-text
Previously the default was black which doesn't work so well if the
cursor block is dark.
2024-01-28 20:20:40 +13:00
Mitchell Hashimoto
3efe88c85c input: add link highlight always/hover w/ mods 2024-01-27 19:07:49 -08:00
Mitchell Hashimoto
7c8b156960 kitty images: support pngs with greyscale/alpha (bpp=2)
Fixes #1355
2024-01-22 14:32:27 -08:00
Mitchell Hashimoto
df09c21103 apprt/embedded: compile for Linux 2024-01-18 08:44:56 -08:00
Mitchell Hashimoto
adb7958f61 remove tracy usage from all files 2024-01-13 15:06:08 -08:00
Mitchell Hashimoto
96d33fef20 custom shader animation can be set to "always" to always remain active
Fixes #1225

The `custom-shader-animation` configuration can now be set to "always"
which keeps animation active even if the terminal is unfocused.
2024-01-09 09:21:15 -08:00
Mitchell Hashimoto
f447e6f9df font: insert blank cells for multi-cell ligatures for styling
Up to this point, every font I've experienced with ligatures has
replaced the codepoints that were replaced for combining with a space.
For example, if a font has a ligature for "!=" to turn it into a glyph,
it'd shape to `[not equal glyph, space]`, so it'd still take up two
cells, allowing us to style both.

Monaspace, however, does not do this. It turns "!=" into `[not equal
glyph]` so styles like backgrounds, underlines, etc. were not extending.

This commit detects multi-cell glyphs and inserts synthetic blank cells
so that styling returns. I decided to do this via synthetic blank cells
instead of introducing a `cell_width` to the shaper result because this
simplifies the renderers to assume each shaper cell is one cell. We can
change this later if we need to.

Annoyingly, this does make the shaper slightly slower for EVERYONE to
accomodate one known font that behaves this way. I haven't benchmarked
it but my belief is that the performance impact will be negligible
because to figure out cell width we're only accessing subsequent cells
so they're likely to be in the CPU cache and also 99% of cells are going
to be width 1.
2024-01-06 19:22:25 -08:00
Mitchell Hashimoto
be176bb8bd renderer: reload background, foreground, cursor-color at runtime
Fixes #1212
2024-01-04 21:47:12 -08:00