290 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b18309187e Strikethrough (#19)
Not as straightforward as it sounds, but not hard either:

* Read OS/2 sfnt tables from TrueType fonts
* Calculate strikethrough position/thickness (prefer font-advertised if possible, calculate if not)
* Plumb the SGR code through the terminal state -- does not increase cell memory size
* Modify the shader to support it

The shaders are getting pretty nasty after this... there's tons of room for improvement. I chose to follow the existing shader style for this to keep it straightforward but will likely soon refactor the shaders.
2022-10-06 15:03:19 -07:00
Mitchell Hashimoto
1a2b684b0e RGB should not be packed, so that it has align = 1 2022-09-23 13:10:51 -07:00
Mitchell Hashimoto
c68c487e14 Make selection part of the cache key for GPU cells
If the selection state changes for a given row, the row must be
invalidated.
2022-09-14 19:58:36 -07:00
Mitchell Hashimoto
d5ee4f8b21 Cell GPU cache must also key by screen type (primary/alternate) 2022-09-13 10:43:03 -07:00
Mitchell Hashimoto
7bde20a43d a cell is empty only if it also has no styling
Previously we only checked if it had no character. With text shaping,
this was causing runs of only empty backgrounds to not render.
2022-09-13 10:12:44 -07:00
Mitchell Hashimoto
662b656218 implement LRU row GPU cell caching 2022-09-12 11:28:47 -07:00
Mitchell Hashimoto
8995e74e23 rows are dirty when initialized 2022-09-10 11:01:40 -07:00
Mitchell Hashimoto
08b7a866b6 Screen dirty tracking 2022-09-10 10:59:57 -07:00
Mitchell Hashimoto
98dff5a163 better handling of combination characters 2022-09-07 20:10:06 -07:00
Mitchell Hashimoto
85dff335f1 much more accurate run splits and cell widths in runs 2022-09-07 10:30:40 -07:00
Mitchell Hashimoto
3754de3b95 test very long emoji 2022-09-06 14:21:07 -07:00
Mitchell Hashimoto
9e8d00f140 attach zero-width joiners to cells 2022-09-05 11:32:14 -07:00
Mitchell Hashimoto
8ef31aaaf9 Disable 2022-09-05 11:22:29 -07:00
Mitchell Hashimoto
802f230fa2 handle graphemes with more than 1 joiner 2022-09-05 10:35:22 -07:00
Mitchell Hashimoto
47242ad12a test writing graphemes 2022-09-05 10:29:52 -07:00
Mitchell Hashimoto
7ceff79ea9 various methods on Row are grapheme-aware and tested 2022-09-05 09:47:35 -07:00
Mitchell Hashimoto
b3ec7028fb detect and attach grapheme to grapheme data 2022-09-04 21:57:07 -07:00
Mitchell Hashimoto
a605ff07e1 setup flags, storage for graphemes 2022-09-04 11:17:41 -07:00
Mitchell Hashimoto
e6564dfd11 fix some resize crashes 2022-09-04 09:43:20 -07:00
Mitchell Hashimoto
f417659368 on resize, if rows increasing, handle that first 2022-09-03 22:33:20 -07:00
Mitchell Hashimoto
f3f60e47d1 clearHistory 2022-09-03 21:40:03 -07:00
Mitchell Hashimoto
6373900dfa comment on screen struct 2022-09-03 21:35:43 -07:00
Mitchell Hashimoto
c0e36bedd6 remove dirty for now 2022-09-03 21:26:49 -07:00
Mitchell Hashimoto
3d0ec16ad4 resize with shrinking cols 2022-09-03 21:25:06 -07:00
Mitchell Hashimoto
7134ddec4e resize less rows 2022-09-03 17:59:24 -07:00
Mitchell Hashimoto
1121438d8a maybe clean up resize more cols 2022-09-03 17:50:04 -07:00
Mitchell Hashimoto
d6e243cde1 resize with reflow more cols 2022-09-03 17:28:26 -07:00
Mitchell Hashimoto
2583b8cb65 fix y pos on resize 2022-09-03 12:25:26 -07:00
Mitchell Hashimoto
41f2b756ae fix scrolling and new row calculation 2022-09-03 12:18:45 -07:00
Mitchell Hashimoto
d22a323896 clean up some assertions 2022-09-01 23:25:51 -07:00
Mitchell Hashimoto
8d6e8eb0aa asserts not being optimized away, use comptime gate 2022-09-01 22:21:54 -07:00
Mitchell Hashimoto
57725cf3a4 cache row iterator max value 2022-09-01 22:05:42 -07:00
Mitchell Hashimoto
5aa6d79519 screen: cache history offset
This is a super hot calculation so taking up memory to cache it resulted
in 15m less function calls when catting a 10mb file, and ~5% speedup.
2022-09-01 21:36:59 -07:00
Mitchell Hashimoto
73581eee0b small optimizations 2022-09-01 18:36:27 -07:00
Mitchell Hashimoto
30a14d230e process ASCII events manually to avoid function call overhead 2022-09-01 17:53:40 -07:00
Mitchell Hashimoto
d404be2993 grow our scrollback much faster 2022-09-01 01:15:20 -07:00
Mitchell Hashimoto
dba027d307 resize should maintain minimum of screen rows 2022-09-01 01:09:06 -07:00
Mitchell Hashimoto
77c8ec0a20 the big screen switchover 2022-09-01 00:58:47 -07:00
Mitchell Hashimoto
2f2b12a32f resize without reflow preserves cursor better 2022-08-31 21:51:01 -07:00
Mitchell Hashimoto
89e931e468 our new resize without reflow supports scrollback so test that 2022-08-31 21:29:28 -07:00
Mitchell Hashimoto
4056f2abf9 new screen supports resize without reflow 2022-08-31 20:48:48 -07:00
Mitchell Hashimoto
cf969b27eb screen2: dynamically allow scrollback when its needed 2022-08-31 19:54:10 -07:00
Mitchell Hashimoto
a192249c77 circbuf rotateToZero does nothing if its already at zero 2022-08-31 19:33:28 -07:00
Mitchell Hashimoto
50612002a8 circbuf resize operation 2022-08-31 17:17:43 -07:00
Mitchell Hashimoto
b7b83db119 fix some circbuf bugs (add tests) and add rotation 2022-08-31 17:08:02 -07:00
Mitchell Hashimoto
cb06bf4873 use non-extern unions so we get safety checks 2022-08-31 16:02:22 -07:00
Mitchell Hashimoto
10ec5f509e circbuf doesn't use zeroes, it takes a default value 2022-08-31 15:27:45 -07:00
Mitchell Hashimoto
e8009f89cf add cursor to new screen 2022-08-31 15:13:30 -07:00
Mitchell Hashimoto
c7b7e3cb44 screen2: selection 2022-08-31 14:58:43 -07:00
Mitchell Hashimoto
f6f8fee804 screen2: scrolling (to a certain extent), copying in tests 2022-08-31 11:44:39 -07:00