Mitchell Hashimoto
b6a4fff6d8
search for fonts on startup
2022-09-29 11:57:29 -07:00
Mitchell Hashimoto
30a5041a38
font Group has Lib, loads deferred faces when needed
2022-09-29 10:30:45 -07:00
Mitchell Hashimoto
92251ed913
font group works with deferred faces exclusively
2022-09-23 14:12:38 -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
b5f9e8abf0
fix potential crash
2022-09-13 10:12:29 -07:00
Mitchell Hashimoto
662b656218
implement LRU row GPU cell caching
2022-09-12 11:28:47 -07:00
Mitchell Hashimoto
97aef76501
avoid large shaper buffer allocation on every frame
2022-09-07 20:27:36 -07:00
Mitchell Hashimoto
98dff5a163
better handling of combination characters
2022-09-07 20:10:06 -07:00
Mitchell Hashimoto
e326bc4921
fonts are presentation format aware (text vs emoji)
2022-09-06 13:30:29 -07:00
Mitchell Hashimoto
90d250a3ba
Rebase
2022-09-05 11:41:40 -07:00
Mitchell Hashimoto
480d262bc1
Calculate grid_width properly, use that instead of wide mask in shader
2022-09-05 11:38:53 -07:00
Mitchell Hashimoto
3231b84927
Ligatures
...
This introduces a naive first pass at integrating ligatures. The basic
ligatures (such as "==" in some fonts) work great. Skin-toned emoji are
struggling a bit.
This isn't the most performant way to do this, either, and I plan on
improving that.
2022-09-05 11:38:52 -07:00
Mitchell Hashimoto
77c8ec0a20
the big screen switchover
2022-09-01 00:58:47 -07:00
Mitchell Hashimoto
2cab94e64d
move cell metrics calculation out into src/font
2022-08-29 11:44:05 -07:00
Mitchell Hashimoto
bd9c048c02
use new font.GroupCache, remove unused font structs
2022-08-29 11:34:21 -07:00
Mitchell Hashimoto
985b329c8a
src/font: change Face to require font to init
2022-08-29 08:48:40 -07:00
Mitchell Hashimoto
f1abca51f7
convert src/font to use new pkg/freetype
2022-08-28 22:22:16 -07:00
Mitchell Hashimoto
dc6fc5c1c3
implement faint colors (SGR 2)
2022-08-26 11:13:34 -07:00
Mitchell Hashimoto
65df657b4e
make cell attrs bools instead of u1s
2022-08-26 11:09:48 -07:00
Mitchell Hashimoto
9601920b4d
font size is now in font points, determine size based on window DPI
2022-08-25 12:29:28 -07:00
Mitchell Hashimoto
f4b1783c1f
atlas tracks modified/resize state, reallocate on GPU if resized
2022-08-24 12:41:31 -07:00
Mitchell Hashimoto
561bbca053
don't render wide char trailers
2022-08-20 17:17:13 -07:00
Mitchell Hashimoto
8a1d7070b3
render wide chars
2022-08-20 16:49:55 -07:00
Mitchell Hashimoto
43c61f57ef
font FallbackSet for looking up in fallback TTFs (emoji)
2022-08-20 10:37:12 -07:00
Mitchell Hashimoto
22ed65a818
really hacked in emoji support, time to clean it up
2022-08-20 10:37:11 -07:00
Mitchell Hashimoto
742dd010eb
Texture atlas supports variable color depth, not just greyscale
2022-08-19 14:37:22 -07:00
Mitchell Hashimoto
eeaad799e5
get rid of Z buffer stuff
...
This optimization will take more work, and we already got a lot of the
way there by optimizing how we send data down to the GPU.
2022-08-19 13:48:34 -07:00
Mitchell Hashimoto
2351f88631
updateCell sets the proper Z value and bumps it
2022-08-19 13:34:07 -07:00
Mitchell Hashimoto
73e43b6e64
Grid supports sending partial cell updates to GPU
2022-08-19 12:54:07 -07:00
Mitchell Hashimoto
4ca45936f7
Only reallocate the GPU buffer if our CPU capacity changes
...
Previously, every single render was re-allocating a fairly large (~1MB)
buffer on the GPU. The recommended best practice is to allocate once and
then use `glBufferSubData` to update the memory in-place on the GPU.
We now track the last size we sent to the GPU, compare it to our copy on
the CPU, and if it _grows_ then we reallocate the GPU buffer. If it
shrinks we leave the GPU as-is for now. After this, we use the sub-data
routines to update the data in place.
2022-08-19 10:26:23 -07:00
Mitchell Hashimoto
390d95a5af
Enable depth buffer, add depth to shader
2022-08-19 10:07:30 -07:00
Mitchell Hashimoto
a36ae221ae
rename font/font.zig to font/main.zig
2022-08-19 09:56:01 -07:00
Mitchell Hashimoto
e5c583ccf5
get rid of gb_math and create matrices from scratch
2022-08-18 11:33:28 -07:00
Mitchell Hashimoto
5c2edf4d2a
Fix some stage2 compilation errors
2022-08-17 14:42:23 -07:00
Mitchell Hashimoto
2f36d5f715
pkg/tracy
2022-08-17 14:03:49 -07:00
Mitchell Hashimoto
92602dafca
rowIterator takes the tag type to iterate over
2022-08-07 10:26:04 -07:00
Mitchell Hashimoto
d0dc69a0a8
color selection!
2022-08-04 14:37:10 -07:00
Mitchell Hashimoto
f2e9746d2b
fix build error
2022-08-04 13:08:51 -07:00
Mitchell Hashimoto
5564bd7213
cursor belongs to screen (prep for alternate screen)
2022-07-22 13:08:40 -07:00
Mitchell Hashimoto
6641fcbd4c
add --font-size flag for font size in pixels
2022-07-21 21:35:49 -07:00
Mitchell Hashimoto
da622abd77
don't draw cursor on scroll
2022-07-12 21:10:35 -07:00
Mitchell Hashimoto
d15ab77c3a
handle inversion with screen inversion properly
2022-06-30 10:12:46 -07:00
Mitchell Hashimoto
527d8baaa0
invert attribute
2022-06-30 10:05:47 -07:00
Mitchell Hashimoto
f53efa633a
initial underline support, can be improved
2022-06-28 14:22:25 -07:00
Mitchell Hashimoto
75b9d1cb84
bold font rendering
2022-06-28 13:44:20 -07:00
Mitchell Hashimoto
385a682b24
move towards font family management to prep for bold/italic
2022-06-28 10:31:11 -07:00
Mitchell Hashimoto
e325ea1616
parse more SGR attrs
2022-06-26 17:37:08 -07:00
Mitchell Hashimoto
c749371bae
switch to new screen, bugs!
2022-05-21 16:42:55 -07:00