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
a0aa100815
font: GroupCache is like Group, but with caching...
2022-08-29 11:10:50 -07:00
Mitchell Hashimoto
a75035c042
font: introduce Group which will eventually replace FallbackSet
...
This is more oriented around glyph indexes and also introduces an
important concept in the FontIndex which can be cached ahead of time so
that we can eventually break down text into runs for text shaping.
2022-08-29 10:16:53 -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
28e9619361
allow non-printables even if modifiers are pressed
2022-08-28 21:12:58 -07:00
Mitchell Hashimoto
672f6e720c
pkg/freetype: finish APIs we need
2022-08-28 21:06:36 -07:00
Mitchell Hashimoto
8ef3018189
pkg/freetype: loading glyphs
2022-08-28 21:02:39 -07:00
Mitchell Hashimoto
a2b06d7705
pkg/freetype: more face APIs
2022-08-28 17:18:23 -07:00
Mitchell Hashimoto
7af9091497
pkg/freetype: Library and Face
2022-08-28 17:07:27 -07:00
Mitchell Hashimoto
483bb90cf9
shader: only downsample glyph if its bigger than width plus padding
2022-08-28 16:57:30 -07:00
Mitchell Hashimoto
d8a06e7768
clean up some imports
2022-08-28 14:50:22 -07:00
Mitchell Hashimoto
f42bac6bc4
pkg/harfbuzz: use extern funcs for freetype interop
2022-08-28 14:47:47 -07:00
Mitchell Hashimoto
c377e19bd0
pkg/harfbuzz: shape
2022-08-28 12:12:41 -07:00
Mitchell Hashimoto
1f2d2e926c
pkg/harfbuzz: buffer get glyph positions and info
2022-08-28 12:05:00 -07:00
Mitchell Hashimoto
0b4344693a
pkg/harfbuzz: buffer set direction, script, and language
2022-08-28 11:54:38 -07:00
Mitchell Hashimoto
3c077ee19b
pkg/harfbuzz: buffer init, add
2022-08-28 11:42:57 -07:00
Mitchell Hashimoto
5d42e2711f
pkg/harfbuzz: face, font, freetype
2022-08-28 11:21:35 -07:00
Mitchell Hashimoto
3d68c72912
pkg/harfbuzz: some blob APIs
2022-08-28 10:54:42 -07:00
Mitchell Hashimoto
44dfe54fe8
output harfbuzz version on startup
2022-08-28 10:26:49 -07:00
Mitchell Hashimoto
755760a79e
pkg/harfbuzz: some functions and tests
2022-08-28 10:24:07 -07:00
Mitchell Hashimoto
367aba62c4
Add harfbuzz build (not used yet)
2022-08-28 10:09:39 -07:00
Mitchell Hashimoto
8ff98446a9
sgr parsing bright colors now sets color properly
2022-08-27 10:55:10 -07:00
Mitchell Hashimoto
1609c8e775
hook up scroll down and up CSI codes (SD/SU)
2022-08-27 10:46:11 -07:00
Mitchell Hashimoto
cd74902f89
Charsets
...
Initial charset support. This gets a lot of stuff working but still has some critical (but not very real world) limitations.
Implements:
* All charset slots G0 to G3
* All shifting commands to shift into GL and GR
* Single shift commands `ESC N` and `ESC O`
* UTF8, ASCII, British, and DEC Special Graphics character sets
Notably missing:
* A number of rarely used charsets
* NRC handling
* Disabling UTF-8 mode
All the missing stuff is very edge case... but necessary for correctness.
2022-08-27 10:33:38 -07:00
Mitchell Hashimoto
1be4626726
update TODO
2022-08-27 10:29:52 -07:00
Mitchell Hashimoto
312d589a2e
implement locking shift
2022-08-27 10:20:54 -07:00
Mitchell Hashimoto
4a247e3bb8
single shift 2/3
2022-08-27 10:16:21 -07:00
Mitchell Hashimoto
bee82d58dc
Shift Out/Shift In (invoke charset into GL)
2022-08-27 10:08:01 -07:00
Mitchell Hashimoto
7626f194e9
basic charset mapping, support configuration, print tests
2022-08-27 09:42:05 -07:00
Mitchell Hashimoto
75b63f3df3
british charset
2022-08-27 08:41:06 -07:00
Mitchell Hashimoto
40ca2a69fb
starting charset tables
2022-08-26 20:00:25 -07:00
Mitchell Hashimoto
1f4572b3d2
update TODO
2022-08-26 15:20:28 -07:00
Mitchell Hashimoto
50409271a3
Mouse Reporting #8
...
Implements all known formats and event types for mouse reporting. This makes vim, htop, etc. handle mouse events!
Mouse formats:
* X10
* UTF-8
* SGR
* urxvt
* SGR Pixels
Event types:
* X10
* "Normal" - mouse button press/release, including scroll wheel
* "Button" - "Normal" + mouse motion events while a button is pressed
* "Any" - "Normal" + mouse motion events at anytime (even if a button is not pressed)
See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
2022-08-26 15:10:14 -07:00
Mitchell Hashimoto
ff460887b5
fix miscompilation around sgr mode
2022-08-26 15:07:22 -07:00
Mitchell Hashimoto
fe6ba02709
sgr pixels mouse report format
2022-08-26 14:59:44 -07:00
Mitchell Hashimoto
1039ad76bf
urxvt reporting format
2022-08-26 14:57:35 -07:00
Mitchell Hashimoto
f551c0ef66
SGR reporting
2022-08-26 14:55:18 -07:00
Mitchell Hashimoto
b46fe522d5
UTF-8 mouse reporting
2022-08-26 14:42:20 -07:00
Mitchell Hashimoto
ab305add6c
any event mouse tracking
2022-08-26 14:26:42 -07:00
Mitchell Hashimoto
bd5dd69538
normal event (motion) mouse tracking
2022-08-26 14:17:42 -07:00
Mitchell Hashimoto
9aa5378ffa
Track/cache button state and mods state
2022-08-26 13:55:24 -07:00
Mitchell Hashimoto
a4bab6592d
normal events can now track scroll
2022-08-26 12:25:33 -07:00
Mitchell Hashimoto
3096b32f13
mouse normal events in x10 format
2022-08-26 12:17:58 -07:00
Mitchell Hashimoto
93f45af41b
X10 click-only mouse reporting
2022-08-26 12:04:54 -07:00
Mitchell Hashimoto
43b7727cf8
change u1 in mode to bool
2022-08-26 11:27:44 -07:00
Mitchell Hashimoto
f9274bdafc
define mouse events, all TODO
2022-08-26 11:14:34 -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