861 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b28b04d710 pkg/libuv: fix stage2 compilation issues 2022-10-14 09:44:22 -07:00
Mitchell Hashimoto
2d3febac0e fix invalid ptrcast 2022-10-14 09:19:58 -07:00
Mitchell Hashimoto
c99fb89738 new opengl function calls for stage2 2022-10-14 09:18:33 -07:00
Mitchell Hashimoto
e73db24f0e move shaders into src/ tree for stage2 2022-10-14 09:18:20 -07:00
Mitchell Hashimoto
8decfa6452 I think this gets us on master zig... 2022-10-13 11:31:02 -07:00
Mitchell Hashimoto
225de43062 update mach to fix stage2 issue 2022-10-13 11:06:43 -07:00
Mitchell Hashimoto
699da6fcfe update mach 2022-10-13 11:03:23 -07:00
Mitchell Hashimoto
e493a722a3 fix some issues that fail nightly stage2 compiler 2022-10-13 10:54:30 -07:00
Mitchell Hashimoto
a6c3ee3bc2 pkg/macos: fix zig C ABI issue 2022-10-10 09:18:57 -07:00
Mitchell Hashimoto
1e23779337 pkg/macos: more stuff 2022-10-10 09:03:03 -07:00
Mitchell Hashimoto
c75e54fca0 update to API 2022-10-09 16:30:26 -07:00
Mitchell Hashimoto
1cf390729e pkg/macos: bitmap info arg 2022-10-09 16:29:19 -07:00
Mitchell Hashimoto
276ae4f788 font: fix some coretext rendering issues 2022-10-09 11:45:02 -07:00
Mitchell Hashimoto
9c99a49ac5 font: deferred face can load core text backend 2022-10-09 11:28:28 -07:00
Mitchell Hashimoto
97e989daa8 font: coretext initial render glyph 2022-10-09 11:23:57 -07:00
Mitchell Hashimoto
1b7bc052d4 font: coretext calculate cell metrics 2022-10-09 10:57:19 -07:00
Mitchell Hashimoto
150b0a4d51 font: calculate cell height 2022-10-09 08:51:30 -07:00
Mitchell Hashimoto
8b3959dceb macos: frames, attributed strings, stylized strings 2022-10-09 08:07:56 -07:00
Mitchell Hashimoto
1e2e4169a5 pkg/macos: starting frames 2022-10-08 17:52:01 -07:00
Mitchell Hashimoto
cc14344bf8 pkg/macos: path 2022-10-08 17:39:25 -07:00
Mitchell Hashimoto
061f7f6a30 pkg/macos: text framesetter 2022-10-08 17:29:50 -07:00
Mitchell Hashimoto
26280d4fe5 macos: AttributedString 2022-10-08 17:24:33 -07:00
Mitchell Hashimoto
a97f997f9a font: start working on core text cell height calcs 2022-10-08 17:03:09 -07:00
Mitchell Hashimoto
22f437aac6 font: coretext cell width calculation 2022-10-08 11:49:23 -07:00
Mitchell Hashimoto
c9a335646e pkg/macos: some font metrics functions 2022-10-08 11:34:45 -07:00
Mitchell Hashimoto
f393049988 fix compilation 2022-10-08 11:25:54 -07:00
Mitchell Hashimoto
0e167ae24c font: coretext initialize face from memory 2022-10-08 11:21:24 -07:00
Mitchell Hashimoto
26629bcb6e pkg/macos: create fonts from data 2022-10-08 10:21:33 -07:00
Mitchell Hashimoto
d0e269df6a macos: data 2022-10-08 10:20:48 -07:00
Mitchell Hashimoto
240c560720 macos: create descriptors from URL 2022-10-08 10:16:35 -07:00
Mitchell Hashimoto
175ff0f777 macos: url from path 2022-10-08 10:13:30 -07:00
Mitchell Hashimoto
a21dda2b08 font: lower interface requirement for face 2022-10-08 10:07:35 -07:00
Mitchell Hashimoto
0ff79a0623 font: coretext glyphIndex 2022-10-08 10:04:17 -07:00
Mitchell Hashimoto
723db8be2f font: coretext face presentation 2022-10-08 09:55:22 -07:00
Mitchell Hashimoto
90f3b9391c font: begin coretext Face 2022-10-08 09:43:54 -07:00
Mitchell Hashimoto
71ec509930 Make font face a compile time interface, stub for coretext 2022-10-08 09:19:21 -07:00
Mitchell Hashimoto
833fd0e49a pkg/macos: bounding rects for text 2022-10-07 21:23:34 -07:00
Mitchell Hashimoto
67bb68b39f pkg/macos: RGB color space 2022-10-07 21:07:11 -07:00
Mitchell Hashimoto
c48ddcecd7 pkg/macos: font draw glyphs 2022-10-07 21:04:30 -07:00
Mitchell Hashimoto
61955c5d8d pkg/macos: CGContext 2022-10-07 20:56:24 -07:00
Mitchell Hashimoto
ca7f3647ff pkg/macos: CGColorSpace 2022-10-07 17:59:52 -07:00
Mitchell Hashimoto
fd509a2cb4 TODO for colored and styled underlines 2022-10-06 16:07:48 -07:00
Mitchell Hashimoto
8edf52f832 Add some padding to emoji 2022-10-06 15:45:05 -07:00
Mitchell Hashimoto
a44d4ea33b Fix underline/strikeout position with larger fonts 2022-10-06 15:40:43 -07:00
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
4909e0117c Merge pull request #18 from mitchellh/font-metrics
This improves the way we calculate metrics based on fonts to be more accurate. Two practical impacts:

* We now position the underline and underline thickness based on the font metrics
* We now correctly position Apple Emoji font

And I'm going to follow this up with strikethrough since that should be possible now.
2022-10-06 14:14:31 -07:00
Mitchell Hashimoto
3a7e53e2e4 font: calculate correct offset for non-scalable emoji fonts 2022-10-06 14:12:03 -07:00
Mitchell Hashimoto
3b549e0709 more accurately compute font metrics 2022-10-06 11:07:49 -07:00
Mitchell Hashimoto
3d4aacd51d underline is derived from the primary font 2022-10-04 11:08:07 -07:00
Mitchell Hashimoto
c149696f61 redoing some of the baseline calcs, remove from shader 2022-10-04 10:00:32 -07:00