Commit Graph
45 Commits
Author SHA1 Message Date
Mitchell Hashimoto daeed25b37 font/coretext: creation functions can return null, handle OOM
Catch NULL results from CoreFoundation/CoreText creation functions and
return error.OOM rather than null derefs later. I verified that this is
possible but didn't verify the behavior when it happens, this is just
defensive based on the report here: #13671 because it costs us nothing
really.
2026-08-06 13:47:06 -07:00
Mitchell Hashimoto 7ec57aeebd Zig 0.15: zig fmt 2025-10-03 07:10:43 -07:00
Qwerasd 371d62a82c renderer: big rework, graphics API abstraction layers, unified logic
This commit is very large, representing about a month of work with many
interdependent changes that don't separate cleanly in to atomic commits.

The main change here is unifying the renderer logic to a single generic
renderer, implemented on top of an abstraction layer over OpenGL/Metal.

I'll write a more complete summary of the changes in the description of
the PR.
2025-06-20 15:18:41 -06:00
Jeffrey C. Ollie e8c845b758 core: fixup callconv(.C) -> callconv(.c)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:41:09 -05:00
Mitchell Hashimoto 5ad8ea6b22 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl
Fixes #6727

The major change in this commit is to consolidate all the C imports in
a single decl in main.zig. This is required for Zig 0.14. Without it,
the problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:02:53 -07:00
Mitchell Hashimoto f5234e286a pkg/macos: copyAttribute should return optional 2024-08-24 20:35:41 -07:00
Mitchell Hashimoto 2f578a0b97 pkg/macos: foundation yeet usingns 2024-08-16 16:33:47 -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 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 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
Krzysztof Wolicki 44a48f62f1 change unmodified vars to consts in anticipation of zig changes 2023-11-17 15:46:46 +01: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 fb0f80f9ca macos: add necessary functions for variation axes querying 2023-08-28 07:25:09 -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 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 314f9287b1 Update Zig (#164)
* update zig

* pkg/fontconfig: clean up @as

* pkg/freetype,harfbuzz: clean up @as

* pkg/imgui: clean up @as

* pkg/macos: clean up @as

* pkg/pixman,utf8proc: clean up @as

* clean up @as

* lots more @as cleanup

* undo flatpak changes

* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto 56f8e39e5b Update zig, mach, fmt 2023-06-25 11:08:20 -07:00
Mitchell Hashimoto da2942e083 font: specific codepoint lookup in internals 2022-11-17 15:49:14 -08:00
Mitchell Hashimoto b91cd8e41c pkg/macos: character set in range 2022-11-17 15:15:09 -08:00
Mitchell Hashimoto 843dc8ae14 pkg/macos: support CFCharacterSet 2022-11-17 15:09:53 -08:00
Mitchell Hashimoto 6c84199b84 fix more stage2 build errors 2022-10-14 10:01:41 -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 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 d0e269df6a macos: data 2022-10-08 10:20:48 -07:00
Mitchell Hashimoto 175ff0f777 macos: url from path 2022-10-08 10:13:30 -07:00
Mitchell Hashimoto 791739de9c pkg/macos: font initializes, get glyphs 2022-10-01 21:49:02 -07:00
Mitchell Hashimoto decbaafc6a pkg/macos: add mutable dictionaries, flesh out font descriptor 2022-10-01 20:50:51 -07:00
Mitchell Hashimoto 7eb466959a macos/foundation: number, dict get value 2022-10-01 15:49:05 -07:00
Mitchell Hashimoto 3eeef74315 pkg/macos: import headers instead of doing externs manually 2022-10-01 15:24:22 -07:00
Mitchell Hashimoto 57c1d8d329 macos/text: more APIs 2022-10-01 11:25:21 -07:00
Mitchell Hashimoto 88ae3be9ef pkg/macos: CFURL 2022-10-01 11:13:44 -07:00
Mitchell Hashimoto 49c9c21d52 macos: test listing fonts 2022-10-01 11:06:07 -07:00
Mitchell Hashimoto cb02bab89e macos/text: font descriptors 2022-10-01 10:50:09 -07:00
Mitchell Hashimoto 92d564a246 macos/foundation: more string funcs 2022-10-01 10:32:54 -07:00
Mitchell Hashimoto 2440b0ec67 pkg/macos: dictionary create 2022-10-01 09:53:48 -07:00
Mitchell Hashimoto 93f2a99b64 macos: CFArray 2022-09-30 15:10:11 -07:00
Mitchell Hashimoto f9e1127317 pkg/macos: add CoreText 2022-09-30 14:48:06 -07:00
Mitchell Hashimoto b0d9933249 macos: add another string API to test it really works 2022-09-30 14:12:15 -07:00
Mitchell Hashimoto ab4491a45d pkg/macos: start core foundation bindings 2022-09-30 14:03:37 -07:00