275 Commits

Author SHA1 Message Date
Mitchell Hashimoto
1e5c17dffa Comment to show native access 2022-10-28 10:02:32 -07:00
Mitchell Hashimoto
71042b6f1b pkg/objc: more methods 2022-10-28 09:36:56 -07:00
Mitchell Hashimoto
59cb774cdd pkg/objc: properties 2022-10-25 21:25:07 -07:00
Mitchell Hashimoto
aaaae38fa1 pkg/objc: more message send stuff 2022-10-25 20:55:41 -07:00
Mitchell Hashimoto
7d48e564b5 pkg/objc: message send 2022-10-25 20:30:42 -07:00
Mitchell Hashimoto
10ee05b435 pkg/objc: selectors 2022-10-25 16:33:45 -07:00
Mitchell Hashimoto
dd8fde52d9 pkg/objc starting 2022-10-25 16:21:11 -07:00
Mitchell Hashimoto
d346309cb3 pkg/libuv: generate cimport.zig for specific platforms 2022-10-24 14:35:30 -07:00
Mitchell Hashimoto
aa3d132947 run rendering on another real thread (still bugs) 2022-10-24 09:17:48 -07:00
Mitchell Hashimoto
77b981950c pkg/libuv: Idle handles 2022-10-23 21:15:58 -07:00
Mitchell Hashimoto
c3d9ee1d85 pkg/libuv: get rid of sleep state, it did nothing 2022-10-23 16:15:47 -07:00
Mitchell Hashimoto
58c107dceb freetype: resize glyphs that are too tall prior to storing in texture
Most emoji fonts are massive glyphs (128x128, 256x256, etc.). This means
the texture we need to store emoji is also massive. For a 128x128 emoji
font (both Apple and Noto), we can only store 12 emoji before resizing
prior to this commit.

This commit now threads through a max height through to the font face
and resizes the bitmap in memory before putting it in the atlas. This
results in significant savings. The max height is the cell height. We
allow the glyphs to be as wide as necessary due to double (and more)
wide glyphs.

For the unicode emoji test file, the atlas size before and after:

  Before: 262 MB
  After: 16 MB
2022-10-17 19:14:30 -07:00
Mitchell Hashimoto
c103a278f1 render font info in dev mode 2022-10-17 14:47:51 -07:00
Mitchell Hashimoto
7cb3f2267f use our built-in font for dev mode 2022-10-17 11:56:46 -07:00
Mitchell Hashimoto
20f1077e86 enable freetype with imgui 2022-10-17 11:41:46 -07:00
Mitchell Hashimoto
15a57983a6 pkg/freetype: remove unused API 2022-10-16 21:03:17 -07:00
Mitchell Hashimoto
2e1bc7bb01 Bring back freetype font bitmap conversion
Monaco on Mac is mono
2022-10-16 20:47:21 -07:00
Mitchell Hashimoto
f29393bca6 Imgui (#20)
* vendor/cimgui

* Add a "dev mode" window which for now is just imgui demo
2022-10-16 16:20:08 -07:00
Mitchell Hashimoto
5b6eb2736a pkg/libpng: name the lib png, so its not "liblibpng" 2022-10-15 14:55:11 -07:00
Mitchell Hashimoto
6c84199b84 fix more stage2 build errors 2022-10-14 10:01:41 -07:00
Mitchell Hashimoto
83c9390ac9 pkg/libuv: workaround stage2 issue 2022-10-14 09:57:52 -07:00
Mitchell Hashimoto
b28b04d710 pkg/libuv: fix stage2 compilation issues 2022-10-14 09:44:22 -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
1cf390729e pkg/macos: bitmap info arg 2022-10-09 16:29:19 -07:00
Mitchell Hashimoto
1b7bc052d4 font: coretext calculate cell metrics 2022-10-09 10:57:19 -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
c9a335646e pkg/macos: some font metrics functions 2022-10-08 11:34:45 -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
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
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
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
c149696f61 redoing some of the baseline calcs, remove from shader 2022-10-04 10:00:32 -07:00
Mitchell Hashimoto
c565c561fd Use Apple Emoji font on Mac 2022-10-02 11:20:55 -07:00
Mitchell Hashimoto
939e6e7a65 pkg/harfbuzz: add coretext compilation on macOS 2022-10-02 11:05:40 -07:00
Mitchell Hashimoto
12c9482d48 Mac Font Discovery with CoreText (#17)
This implements font discovery so the `--font-family` flag works for macOS. Fonts are looked up using the Core Text API so any installed font on the Mac system can be used. 

We still use FreeType for rendering, and CoreText doesn't _quite_ give us all the information we need to build the exact face in FreeType. So a TODO after this is to now implement glyph _rendering_ using Core Text and Core Graphics. Until then, a couple fonts don't quite work (i.e. Monaco, a big one!) but many do!
2022-10-01 22:21:30 -07:00