Mitchell Hashimoto
af6fb294d0
wasm: use wasm allocator, rather than page allocator
...
Uses 4x less pages because we're not allocating 1 page (more or less)
per allocation and instead actually bin-packing it a bit.
2022-12-24 16:41:37 -08:00
Mitchell Hashimoto
2e462a3e7c
Merge pull request #67 from mitchellh/wasm-shared
...
wasm: use shared, imported memory
2022-12-24 16:37:38 -08:00
Mitchell Hashimoto
241bfee7d4
wasm: use shared, imported memory
...
This switches our wasm build to use "shared" memory. Shared memory can
be shared across multiple web workers, which is something we'll want to
support for our multi-threaded behaviors later.
Shared memory has a number of different restrictions so this updates
zig-js to support it as well as updates some of our functions that need
to be aware of it.
2022-12-24 16:24:43 -08:00
Mitchell Hashimoto
61450fce25
Test wasm builds in CI
2022-12-24 11:04:35 -08:00
Mitchell Hashimoto
134d63d1bc
update zig -- should fix codesign issue
2022-12-24 10:57:24 -08:00
Mitchell Hashimoto
f2a05041d8
update zig again
2022-12-22 20:26:01 -08:00
Mitchell Hashimoto
6f3bc5186d
update to latest zig
2022-12-21 18:30:21 -08:00
Mitchell Hashimoto
e210c91d10
update zig version, update @call for newer zig version
2022-12-16 22:34:54 -08:00
Mitchell Hashimoto
b3090f60af
mac: in debug, set locale to en_US if not manually set
...
See comment, I think this is a Zig miscompilation...
2022-12-15 14:50:52 -08:00
Mitchell Hashimoto
609ba91cc9
font: clear up some logging
2022-12-14 22:06:40 -08:00
Mitchell Hashimoto
ad9b773cd8
terminal: printing char outside of ASCII with non-UTF8 charset is space
2022-12-14 21:50:32 -08:00
Mitchell Hashimoto
4fae29ff13
terminal: scrollRegionUp outside of range does nothing
2022-12-14 21:43:47 -08:00
Mitchell Hashimoto
6f451f22bb
terminal: only clear wide spacer head if wide char is not on first line
2022-12-14 21:39:45 -08:00
Mitchell Hashimoto
8534e5a186
terminal: insertLines with count 0 no longer crashes
2022-12-14 21:29:06 -08:00
Mitchell Hashimoto
0592e4fa1a
terminal: osc parser gracefully handles input data larger than buffer
2022-12-14 21:24:43 -08:00
Mitchell Hashimoto
c7a28fab20
terminal: don't crash if cell claims to have grapheme but doesn't
2022-12-14 21:19:23 -08:00
Mitchell Hashimoto
4a3e2b35b9
terminal: parse table needs to have room for all chars
2022-12-14 21:10:22 -08:00
Mitchell Hashimoto
36c6e95dfc
terminal: ignore invalid C0 escape codes
2022-12-14 20:57:31 -08:00
Mitchell Hashimoto
c01a9f583f
zero-width chars are ignored if they're at col 0
...
This can cause a crash, and is impossible since zero-width chars are
always attached to a prior character. Word-wrapping doesn't come into
play here because this check happens prior to the wrapping.
2022-12-14 19:20:05 -08:00
Mitchell Hashimoto
9f92b5aa0a
Merge pull request #65 from mitchellh/canvas
...
wasm: procedurally generated glyphs (i.e. box fonts) for web canvas
2022-12-13 22:25:45 -08:00
Mitchell Hashimoto
05a5cfddb5
font: web canvas sprite trapezoid
2022-12-13 22:22:00 -08:00
Mitchell Hashimoto
c391d0f3de
font: web canvas sprite font can composite
2022-12-13 22:17:27 -08:00
Mitchell Hashimoto
bf054e5b44
font: web canvas sprite font can write to atlas
2022-12-13 22:01:13 -08:00
Mitchell Hashimoto
b48a0db040
font: web canvas rect sprite func
2022-12-13 21:46:33 -08:00
Mitchell Hashimoto
c9755f5fd1
font: mostly empty web canvas sprite renderer, but compiles
2022-12-13 21:19:40 -08:00
Mitchell Hashimoto
68e697dcbe
font: remove getData from canvas
2022-12-13 21:09:09 -08:00
Mitchell Hashimoto
ead8610604
font: Box font uses canvas abstraction
2022-12-13 21:08:45 -08:00
Mitchell Hashimoto
b21e18a9e6
font: start converting Box font to our abstract canvas interface
2022-12-13 16:16:56 -08:00
Mitchell Hashimoto
c34d911488
wasm: disable stack protector
2022-12-13 10:03:26 -08:00
Mitchell Hashimoto
a87b21dbee
font: mac should use freetype rasterizer by default
2022-12-12 22:12:11 -08:00
Mitchell Hashimoto
c8252133a3
update zig version
2022-12-12 22:10:52 -08:00
Mitchell Hashimoto
0ab8eff069
update example to show multi-codepoint grapheme
2022-12-12 22:05:27 -08:00
Mitchell Hashimoto
21b750fa65
Merge pull request #64 from mitchellh/shaper-abs
...
wasm: Text shaping for canvas faces
2022-12-12 21:57:40 -08:00
Mitchell Hashimoto
bc74033ad6
face: web canvas can render grapheme clusters
2022-12-12 21:40:54 -08:00
Mitchell Hashimoto
a1dda2c37f
font: faceFromIndex returns a pointer to the face
2022-12-12 21:34:34 -08:00
Mitchell Hashimoto
c06ca04a1a
font: web canvas tracks glyph indexes for grapheme clusters
2022-12-12 11:31:30 -08:00
Mitchell Hashimoto
2b3478ce3d
font: start web canvas shaping, we perform grapheme clustering
2022-12-11 22:12:12 -08:00
Mitchell Hashimoto
35000bced1
font: shaper test should decode unicode codepoints
2022-12-08 12:42:09 -08:00
Mitchell Hashimoto
0c9a9b1f91
font: web canvas face has to render to check presentation for cp
...
Since we have no way to detect our presentation (text/emoji), we need to
actually render the glyph that is being requested to double-check that
the glyph matches our supported presentation.
We do this because the browser will render fallback fonts for a glyph if
it can't find one in the named font.
2022-12-07 19:20:04 -08:00
Mitchell Hashimoto
2c5b5429e3
wasm: build.zig uses addDeps for wasm
2022-12-07 18:39:46 -08:00
Mitchell Hashimoto
f53d9fb704
font: web canvas shaper yields runs
2022-12-07 18:29:49 -08:00
Mitchell Hashimoto
dd71456f35
font: shapers init with allocator since web canvas needs to init buffer
2022-12-06 13:44:55 -08:00
Mitchell Hashimoto
760f0c057c
renderer: use new shaper structs
2022-12-06 13:25:52 -08:00
Mitchell Hashimoto
f0b7fbecee
font: extract common shaper elements out
2022-12-06 13:23:53 -08:00
Mitchell Hashimoto
e3c18f3f51
font: move shaper into comptime interface
2022-12-06 11:20:37 -08:00
Mitchell Hashimoto
b043748794
Merge pull request #62 from mitchellh/web-emoji
...
wasm: web canvas font rasterizer can render emoji (no ZWJ yet)
2022-12-06 11:01:27 -08:00
Mitchell Hashimoto
6aa212707e
font: web canvas can render emoji
2022-12-06 10:55:42 -08:00
Mitchell Hashimoto
41cbc1a323
wasm: show color atlas in example web app
2022-12-05 21:33:54 -08:00
Mitchell Hashimoto
10f708ee65
wasm: export terminal core API
2022-12-05 21:27:20 -08:00
Mitchell Hashimoto
95b89149aa
Merge pull request #61 from mitchellh/font-group
...
wasm: Discovery, DeferredFace, Group, GroupCache
2022-12-05 21:18:55 -08:00