105 Commits

Author SHA1 Message Date
Mitchell Hashimoto
097b978052 pkg/macos: animation yeet usingns 2024-08-16 16:35:07 -07:00
Mitchell Hashimoto
2f578a0b97 pkg/macos: foundation yeet usingns 2024-08-16 16:33:47 -07:00
Mitchell Hashimoto
14a42fcdb7 renderer/metal: load shaders from precompiled lib 2024-08-06 15:05:10 -07:00
Mitchell Hashimoto
a30e791c85 begin 0.13 update process -- very broken 2024-06-24 15:16:22 -07:00
Qwerasd
626ec2b5ac perf: introduce CFReleaseThread for running CoreFoundation releases
Some CoreFoundation objects, such as those produced by CoreText, have
expensive callbacks that run when they are released. By offloading the
CFRelease calls to another thread, we can avoid important threads being
blocked by unexpectedly expensive callbacks.

This commit also changes the way that the coretext shaper's run iterator
builds its string. Rather than using a CFMutableString, an ArrayList of
unichars is built which is passed to CFStringCreateWithCharactersNoCopy,
which is a lot more efficient since it avoids all the CoreFoundation
overhead.
2024-06-14 01:43:02 -04:00
Mitchell Hashimoto
1a7cde9e3e font/coretext: can read font tables 2024-05-27 20:23:10 -07:00
Mitchell Hashimoto
9f4d4d3c61 font: treated fonts with mixed color/non-color glyphs as text
Related to #1768 but doesn't fix it properly.

This is a temporary hack to avoid some issues with fonts that have mixed
color/non-color glyphs. If there are mixed presentations and the font
does not have emoji codepoints, then we assume it is text. This fixes
the typical scenarios.

This is not a long term solution. A proper long term solution is to
detect this scenario and on a per-glyph basis handle colorization (or
the lack thereof) correctly. It looks like to do this we'll have to
parse some font tables which is considerably more work so I wanted to do
this first.
2024-05-26 10:17:20 -07:00
Mitchell Hashimoto
1cb70d6e40 font/coretext: force LTR shaping 2024-05-08 10:11:57 -07:00
Mitchell Hashimoto
eeb7f7aa02 pkg/macos: add more text APIs 2024-05-08 09:49:16 -07:00
Mitchell Hashimoto
1189817dd8 pkg/macos: CTFontCreateForString 2024-05-05 21:38:19 -07:00
Mitchell Hashimoto
a29a0a1e5c pkg/macos: add more CoreText APIs 2024-05-05 21:01:44 -07:00
Mitchell Hashimoto
cc72e6de23 pkg/macos: display link callback slightly more typesafe 2024-05-04 14:49:49 -07:00
Mitchell Hashimoto
f76af48613 pkg/macos: add CVDisplayLinkSetCurrentCGDisplay 2024-05-04 14:49:49 -07:00
Gordon Cassie
abd782a7aa Fix typo. 2024-04-30 10:20:31 -07:00
Mitchell Hashimoto
61d3da1bf6 font/coretext: respect quirks fonts for shaper 2024-04-04 12:02:43 -07:00
Mitchell Hashimoto
290496d7fe pkg/macos: add missing functions to macos/foundation 2024-04-04 11:25:34 -07:00
Mitchell Hashimoto
7b3deb13d8 renderer/metal: apply layerContentsPlacement on macOS to fix stretching
Fixes #42
2024-02-02 08:39:08 -08:00
Mitchell Hashimoto
3360a008cd build: build produces a broken object file for iOS
This gets `zig build -Dtarget=aarch64-ios` working. By "working" I mean
it produces an object file without compiler errors. However, the object
file certainly isn't useful since it uses a number of features that will
not work in the iOS sandbox.

This is just an experiment more than anything to see how hard it would be to
get libghostty working within iOS to render a terminal. Note iOS doesn't
support ptys so this wouldn't be a true on-device terminal. The
challenge right now is to just get a terminal rendering (not usable).
2024-01-13 21:38:58 -08:00
Mitchell Hashimoto
22648d60e7 pkg/apple-sdk: detect apple sdk based on target 2024-01-09 22:24:34 -08:00
Mitchell Hashimoto
829776bebd pkg/apple-sdk: always require a module 2024-01-09 22:11:03 -08:00
Mitchell Hashimoto
fde52e9eca pkg/macos: only link apple paths on darwin target 2024-01-09 21:58:56 -08:00
Mitchell Hashimoto
c0722b3652 build: use Xcode for the macOS SDK 2024-01-09 21:53:01 -08:00
Krzysztof Wolicki
3c78df70fb Maybe this will help macos 2024-01-07 21:39:53 +01:00
Krzysztof Wolicki
b27fc44837 Link frameworks to macos module conditionally 2024-01-07 21:22:09 +01:00
Krzysztof Wolicki
2f5bcf2e27 Attempt to fix building on macos 2024-01-07 21:17:17 +01:00
Krzysztof Wolicki
1913243c35 WIP: Update to new build module API after Zig PR #18160
Temporarily change dependency sources to forks until they update
2024-01-03 21:50:32 +01:00
Kyaw
22d631942c font/coretext: use CTFontCopyFamilyName
Use `CTFontCopyFamilyName` instead of `CTFontCopyDisplayName` to get
the font name to match the behavior of how it's done on freetype
backend.
2023-12-15 02:26:47 +06:30
Mitchell Hashimoto
cc0b615552 pkg/macos: more APIs 2023-12-11 20:48:45 -08:00
Mitchell Hashimoto
0137f5b0d3 pkg/macos: add many more text APIs 2023-12-11 11:12:29 -08:00
Mitchell Hashimoto
ff68c56268 pkg/macos: implement CTRun 2023-12-11 11:12:28 -08:00
Mitchell Hashimoto
0230222c0d pkg/macos: add CoreVide for DisplayLink 2023-11-17 21:50:34 -08:00
Krzysztof Wolicki
44a48f62f1 change unmodified vars to consts in anticipation of zig changes 2023-11-17 15:46:46 +01:00
Mitchell Hashimoto
cb684e35cc font/coretext: discovery scoring should take into account symb. traits
Fixes #707

Our scoring algorithm previously did not take into account symbolic
traits, so when `bold = false and italic = false`, regular, bold, italic
would all be equally likely to appear first.

This modifies our scoring algorithm to prioritize matching symbolic
traits. Further, we have a special case for no symbolic traits to
prioritize "Regular" named styles. We can expand this to other styles
too but we do not do this here.

We also modified the algorithm to always prefer fonts with more glyphs
over fonts with less, hopeful that we can load fewer fonts for other
glyphs later.
2023-11-03 22:21:34 -07:00
Mitchell Hashimoto
1411015038 font: fallback search should search full discovery chain
Fixes #668

We were previously only checking the first font result in the search.
This also fixes our CoreText scoring algorithm to prioritize faces that
have the codepoint we're searching for.
2023-10-13 12:25:27 -07:00
Mitchell Hashimoto
1127330b3a font/coretext: score discovered fonts 2023-10-03 09:17:41 -07:00
Mitchell Hashimoto
fda56fd11f pkg/macos: MutableArray, sorting 2023-10-02 22:26:47 -07:00
Mitchell Hashimoto
0021b290cf pkg: add test targets 2023-10-01 18:43:25 -07:00
Mitchell Hashimoto
ec26fb7cee pkg/macos 2023-10-01 17:02:12 -07:00
Mitchell Hashimoto
2237b43df0 pkg/freetype, harfbuzz modules 2023-10-01 16:57:45 -07:00
Mitchell Hashimoto
9d0729f17c font/coretext: ability to set variation axes 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
fb0f80f9ca macos: add necessary functions for variation axes querying 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
7659a2a733 build: fix linking bugs for macos test 2023-08-18 08:23:58 -07:00
Mitchell Hashimoto
3d23f26326 input, macos: initial work on keymapper and macos usage of it 2023-08-11 12:01:58 -07:00
Mitchell Hashimoto
d649b3f6d4 update zig 2023-08-02 14:39:19 -07:00
Mitchell Hashimoto
4bf8a0d149 font: support skew transform for auto-italics 2023-07-03 15:54:50 -07:00
Mitchell Hashimoto
0a718ec3eb pkg/macos: do not use bitCast through a function
workaround Zig issue: https://github.com/ziglang/zig/issues/16290
2023-07-01 13:38:10 -07:00
Mitchell Hashimoto
d39e3f5428 coretext: improved baseline calculation 2023-07-01 09:23:40 -07:00
Mitchell Hashimoto
a74e49833b coretext: colored glyph rendering 2023-07-01 09:23:40 -07:00
Mitchell Hashimoto
552a1b51d0 coretext: rasterization looking cleaner 2023-07-01 09:23:39 -07:00
Mitchell Hashimoto
45da58188c fix up for new zig 2023-07-01 09:23:39 -07:00