576 Commits

Author SHA1 Message Date
Mitchell Hashimoto
13225a2d78 remove done shader TODO 2022-08-20 17:39:34 -07:00
Mitchell Hashimoto
f19f5fdc79 update TODO 2022-08-20 17:37:41 -07:00
Mitchell Hashimoto
235146ccd4 Emoji and Wide Unicode Char Support (i.e. Asian characters)
Many changes to support emoji and wide chars:

- Freetype built with libpng support (some emoji font use pngs)
- Introduced `font.FallbackSet` structure for looking for glyphs in multiple fonts so we can find emojis
- Texture atlas supports 3 and 4 channel colors (RGB/RGBA, although emojis are in BGRA)
- `font.Face` supports loading colored fonts and glyphs
- `font.Face` supports fonts that do not support variable pixel sizes
- Shader supports two textures (greyscale and colored)
- Shader will downsample glyphs that don't fit into the cell size because some fixed size emoji fonts are large
- Shader supports wide (2x) cells across all types: cursor, fg, bg, underline
- Terminal state supports detecting and managing wide (2x) chars by looking them up in the Unicode EastAsianWidth database and populating "spacer" cells.
- Selection (and clipboard ops) support wide chars
2022-08-20 17:33:59 -07:00
Mitchell Hashimoto
ec288d9111 get rid of assertions because its possible they're false 2022-08-20 17:21:14 -07:00
Mitchell Hashimoto
561bbca053 don't render wide char trailers 2022-08-20 17:17:13 -07:00
Mitchell Hashimoto
28072157d5 selection of wide chars and copy/paste works 2022-08-20 17:10:10 -07:00
Mitchell Hashimoto
8a1d7070b3 render wide chars 2022-08-20 16:49:55 -07:00
Mitchell Hashimoto
da79aae0ab terminal: print wide characters 2022-08-20 16:11:48 -07:00
Mitchell Hashimoto
ecf8353c74 support dynamic linking (not default) test in GH actions 2022-08-20 15:21:24 -07:00
Mitchell Hashimoto
f93e9eedb3 font: move codepoint into a public API 2022-08-20 10:50:37 -07:00
Mitchell Hashimoto
32d96dd49b add utf8proc so we can detect unicode char width 2022-08-20 10:48:54 -07:00
Mitchell Hashimoto
e83262e48e nix: remove libpng 2022-08-20 10:37:39 -07:00
Mitchell Hashimoto
813f11a5eb fix crash that could happen looking up fallback 2022-08-20 10:37:12 -07:00
Mitchell Hashimoto
c29f4cace6 remove the font style fallback for the fallback set 2022-08-20 10:37:12 -07:00
Mitchell Hashimoto
6026fdf834 only downsample size if its an emoji 2022-08-20 10:37:12 -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
3d6ca0e423 font face supports loading color fonts (emoji!) 2022-08-20 10:37:11 -07:00
Mitchell Hashimoto
5d27fd55e9 temp: add libpng to nix 2022-08-20 10:37:06 -07:00
Mitchell Hashimoto
5ae450099d freetype builds in png support, uses our own zlib 2022-08-20 10:33:57 -07:00
Mitchell Hashimoto
54b0c6cd03 Merge branch 'ft-libpng' 2022-08-20 10:25:32 -07:00
Mitchell Hashimoto
43e42a54cd vendor 2022-08-20 10:25:19 -07:00
Mitchell Hashimoto
728df4af16 build libpng and link freetype to it 2022-08-20 10:24:49 -07:00
Mitchell Hashimoto
583eec0fe6 zlib 2022-08-20 10:02:04 -07:00
Mitchell Hashimoto
f9313801f1 avoid an alloc and buffer copy in the common case on font loading 2022-08-19 15:12:57 -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
d16c672771 update Zig, fixed new invalid octal error 2022-08-19 08:58:27 -07:00
Mitchell Hashimoto
1aecfc1061 math style 2022-08-18 11:42:32 -07:00
Mitchell Hashimoto
4dd8924427 clean up ortho2d to do less things 2022-08-18 11:37:29 -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
b562eec83c erase display complete should scroll to bottom 2022-08-17 17:24:09 -07:00
Mitchell Hashimoto
16f981a48a Typing a character clears selection, scrolls to bottom 2022-08-17 17:23:58 -07:00
Mitchell Hashimoto
5e42d56d95 update zig 2022-08-17 17:09:13 -07:00
Mitchell Hashimoto
7c50ac2be5 skip a test on stage2, with this the main package tests pass! 2022-08-17 17:06:42 -07:00
Mitchell Hashimoto
ffa9ddc0d9 only build tracy if enabled 2022-08-17 17:03:38 -07:00
Mitchell Hashimoto
08292e58f3 add system SDK to build to enable cross compilation 2022-08-17 14:53:34 -07:00
Mitchell Hashimoto
5c2edf4d2a Fix some stage2 compilation errors 2022-08-17 14:42:23 -07:00
Mitchell Hashimoto
fcfd8da57a Fix libuv tests 2022-08-17 14:40:46 -07:00
Mitchell Hashimoto
2f36d5f715 pkg/tracy 2022-08-17 14:03:49 -07:00
Mitchell Hashimoto
ea1e972a29 turn tracy into proper package 2022-08-17 14:02:09 -07:00
Mitchell Hashimoto
2457454b07 test wasm of the term package 2022-08-17 13:57:21 -07:00
Mitchell Hashimoto
ead6e5a435 src/terminal can build into a minimal wasm library, I think 2022-08-17 12:25:53 -07:00
Mitchell Hashimoto
37b854f77c Revert "update libuv tests"
This reverts commit 2228675973b789a938c0d5e30b138f3e5d88121e.
2022-08-17 11:36:08 -07:00
Mitchell Hashimoto
2228675973 update libuv tests 2022-08-17 11:29:08 -07:00