Commit Graph

479 Commits (main)

Author SHA1 Message Date
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 5698607a1c Clean pkg/fontconfig/build.zig 2024-01-07 20:54:22 +01:00
Krzysztof Wolicki 9964a55d47 Update source for zig-build-macos-sdk for pkg/apple-sdk 2024-01-07 20:48:00 +01:00
Krzysztof Wolicki f917be968d
Merge branch 'mitchellh:main' into main 2024-01-07 19:13:06 +01:00
Krzysztof Wolicki ddebb31b8a Add include paths to more modules in pkg/ 2024-01-07 19:07:16 +01:00
Krzysztof Wolicki 6c7c5eecce Add include paths to freetype module 2024-01-07 18:45:07 +01:00
Krzysztof Wolicki 9e14a7ea62 Add include paths to modules in pkg/ 2024-01-07 17:39:39 +01:00
Mitchell Hashimoto efd196e5c9
pkg/freetype: unknown errors should be reported, not unreachable 2024-01-05 21:08:39 -08: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
Mitchell Hashimoto 3fc5b02d73
pkg/fontconfig: move some dependencies to our own mirror
These are unmodified, so users can still verify the checksum with the
official downloads if they feel unsafe.
2024-01-02 15:27:59 -08: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 489ed57e2f
font/harfbuzz: track x/y offsets 2023-12-11 21:41:13 -08: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
Mitchell Hashimoto ff68c56268
pkg/macos: implement CTRun 2023-12-11 11:12:28 -08:00
Carlos Alexandro Becker 25856d62aa
Remove FiraCode leftovers
from #993

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-12-06 13:36:05 -03:00
Krzysztof Wolicki 0750698b62 Update to latest master,
update libxev dependency,
change mach_glfw to an updated fork until upstream updates
2023-11-30 21:41:33 +01:00
Mitchell Hashimoto 5db002cb12
renderer/metal: underline urls 2023-11-29 15:30:21 -08:00
Mitchell Hashimoto 27585ae18a
pkg/oniguruma: better regex api 2023-11-29 15:29:43 -08:00
Mitchell Hashimoto 364020973c
pkg/oniguruma: search 2023-11-29 15:29:43 -08:00
Mitchell Hashimoto 4d3c7212d8
pkg/oniguruma: init regex object 2023-11-29 15:29:43 -08:00
Mitchell Hashimoto c0a06ab523
pkg/oniguruma: basic build 2023-11-29 15:29:43 -08:00
Mitchell Hashimoto 76c76ce85e
renderer/opengl: upload kitty image textures 2023-11-19 22:08:07 -08:00
Mitchell Hashimoto c8a51a2158
renderer/opengl: create the screen texture 2023-11-17 21:51:06 -08:00
Mitchell Hashimoto 47971e7663
renderer/opengl: setup uniform buffer objects for custom shaders 2023-11-17 21:51:06 -08:00
Mitchell Hashimoto 1fedc912f0
renderer/opengl: create ubos 2023-11-17 21:51:05 -08:00
Mitchell Hashimoto fb0929a11b
renderer/opengl: extract cell program state to dedicated struct 2023-11-17 21:51:05 -08:00
Mitchell Hashimoto 3aa217ad2e
pkg/opengl: add Framebuffer APIs 2023-11-17 21:51:05 -08:00
Mitchell Hashimoto 8576acb89e
renderer/opengl: move opengl API to pkg/opengl 2023-11-17 21:51:04 -08:00
Mitchell Hashimoto 01a73994cb
renderer/metal: setup sampler state 2023-11-17 21:50:53 -08:00
Mitchell Hashimoto dba78b20ca
renderer: shadertoy convert to MSL 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 1bd92619b1
renderer: shadertoy functions 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 3a4aef2dcd
pkg/spirv-cross: correct c header 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 7821e6aa3a
pkg/spirv-cross 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 6634ccc09c
pkg/spirv-cross 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 9715eef388
pkg/glslang: build SPIRV lib 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 54ee8c1e3d
pkg/glslang: complete the API 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 4afaea19d6
pkg/glslang: shader api 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 6ebbea84d5
pkg/glslang: can build 2023-11-17 21:50:35 -08:00
Mitchell Hashimoto 0230222c0d
pkg/macos: add CoreVide for DisplayLink 2023-11-17 21:50:34 -08:00
Krzysztof Wolicki 44a48f62f1 change unmodified `var`s to `const`s in anticipation of zig changes 2023-11-17 15:46:46 +01:00
Mitchell Hashimoto 4781a83e4a
replace utf8proc with ziglyph 2023-11-07 13:17:56 -08: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 55f681a0fd
inspector is scaled to native dpi 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto e62a8bbaae
pkg/cimgui: use freetype for font rendering 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto a6dfad9689
pkg/cimgui: requires libcpp 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto 9fb4497675
pkg/cimgui: add osx backend 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto 3ac6e8392d
pkg/cimgui: add metal backend 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto 869e4133f1
apprt/gtk: can render imgui 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto efddef9d1c
build: add cimgui to build 2023-10-24 15:27:13 -07:00
Mitchell Hashimoto aaa74c40c3
pkg/cimgui 2023-10-24 15:27:13 -07:00
Mitchell Hashimoto cbdf52864a
Merge pull request #704 from der-teufel-programming/windows-test
Get `zig build test` working on Windows
2023-10-23 08:52:43 -07:00
Mitchell Hashimoto b9b33ab25d
pkg/fontconfig: make iconv build param non-windows specific 2023-10-23 08:40:25 -07:00
Mitchell Hashimoto 4cb185c593
pkg/harfbuzz: update to 8.2.2 2023-10-20 09:10:34 -07:00
Krzysztof Wolicki b830deb8a9 pkg/fontconfig: windows check more readable 2023-10-19 17:21:23 +02:00
Krzysztof Wolicki 3936b471a8 Disable iconv on Windows by default (enabled via cli flag).
Skip various tests not implemented on windows.
2023-10-19 09:39:20 +02:00
James Tucker 5007e90ae5
pkg/fontconfig: move defines to fix x86_64-windows targets
Some targets were duplicated in the all-targets definition list that
will not build for a Windows target. They're all moved to the
non-Windows configuration. The target now builds against a mingw64
prefix with the appropriate dependencies installed.

Updates #437
2023-10-17 23:24:20 -07:00
Mitchell Hashimoto eda0e8ad04
pkg/apple-sdk: update to not have any broken symlinks 2023-10-17 13:11:27 -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 01a8013533
pkg/harfbuzz: remove accidentally committed archive file 2023-10-09 16:05:55 -07:00
Mitchell Hashimoto 17032632cf
pkg/apple-sdk: do not git clone anymore 2023-10-07 15:31:17 -07:00
Mitchell Hashimoto 8ec6828713
pkg/harfbuzz: download source using zig package manager 2023-10-07 14:51:25 -07:00
Mitchell Hashimoto 6e550bbd6b
pkg/libxml2: download using zig package manager 2023-10-07 14:48:41 -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 f0d4e9c7c3
pkg: remove all old build.zig files 2023-10-01 18:35:31 -07:00
Mitchell Hashimoto 4e1b3b3224
fix failing test, freetype needs libpng 2023-10-01 18:33:37 -07:00
Mitchell Hashimoto d71197dc59
no more system_sdk 2023-10-01 17:38:30 -07:00
Mitchell Hashimoto 3a4842a0a5
fix build on linux 2023-10-01 17:32:59 -07:00
Mitchell Hashimoto d1c993b093
pkg/tracy 2023-10-01 17:11:40 -07:00
Mitchell Hashimoto 8395bb7470
pkg/tracy 2023-10-01 17:11:04 -07:00
Mitchell Hashimoto ec26fb7cee
pkg/macos 2023-10-01 17:02:12 -07:00
Mitchell Hashimoto fefbd7afbe
pkg/pixman, utf8proc 2023-10-01 16:59:24 -07:00
Mitchell Hashimoto 2237b43df0
pkg/freetype, harfbuzz modules 2023-10-01 16:57:45 -07:00
Mitchell Hashimoto bc0f5c3012
pkg/fontconfig module 2023-10-01 16:52:36 -07:00
Mitchell Hashimoto 3ed6a02176
pkg/utf8proc 2023-10-01 16:45:39 -07:00
Mitchell Hashimoto 5d52a94792
pkg/apple-sdk: set sysroot 2023-10-01 16:39:19 -07:00
Mitchell Hashimoto b9cc763a3a
pkg/harfbuzz needs to use apple sdk for coretext 2023-10-01 15:33:40 -07:00
Mitchell Hashimoto 5feeac66b2
pkg/pixman 2023-10-01 15:04:55 -07:00
Mitchell Hashimoto 5f8dbb498f
pkg/fontconfig: depend on libxml2 2023-10-01 14:55:47 -07:00
Mitchell Hashimoto 7a27228660
pkg/libxml2 2023-10-01 12:56:20 -07:00
Mitchell Hashimoto 7edb86f9e1
pkg/fontconfig 2023-10-01 12:43:36 -07:00
Mitchell Hashimoto 2312c465c6
use package manager for font stack 2023-10-01 12:32:17 -07:00
Mitchell Hashimoto 6aef48288a
pkg/harfbuzz 2023-10-01 12:23:38 -07:00
Mitchell Hashimoto 7dc3fcc41e
pkg/freetype 2023-10-01 12:12:05 -07:00
Mitchell Hashimoto 6e2b7c607e
pkg/libpng, pkg/zlib use package manager 2023-10-01 11:25:18 -07:00
Jonathan Marler a0911c954e windows: fix fontconfig into libxml runtime crash from implicit func decl
Fixes the next issue on windows.  The fontconfig library is calling
the function xmlCreatePushParserCtxt from libxml2, however, the function
declaration was being omitted because fontconfig was not defining
the LIBXML_PUSH_ENABLED preprocessor symbol.  However, instead of a
compile error, C's support for implicit function declrations allows it
to happily call the function anyway, with the wrong ABI.  The main issue
was the return type being implicitly declared as "int" instead of a
pointer.  On my system this was causing the return pointer to be
truncated to 32 bits and then sign-extended which caused a segfault
once it was dereferenced.

I've gone ahead and added the -Werror=implicit-function-declaration
to fontconfig to avoid these issues in the future.  However, this
flag didn't compile on linux so I've left it as Windows only for now.

I also needed to add the LIBXML_STATIC define because not defining it
causes some functions on windows to be declared with
`__declspec(dllimport)` which results in linker errors since we are
actually statically linking libxml2.
2023-09-18 01:12:56 -06:00
Jonathan Marler a2e881ff4e windows: initial support for zig build test
Makes progress getting "zig build test" to work on windows.  Mostly
fixed issues around build configuration and added some branches throughout
the Zig code to return/throw errors for unimplemented parts.

I also added an initial implementation for getting the home dir.
2023-09-14 03:15:40 -06:00
Mitchell Hashimoto 1ee5b7f91c
font: freetype supports font variation settings 2023-08-28 07:25:09 -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 ea3b957bc7
quirks: Menlo/Monaco should disable ligatures by default (#331)
* font: disable default font features for Menlo and Monaco

Both of these fonts have a default ligature on "fi" which makes terminal
rendering super ugly. The easiest thing to do is special-case these
fonts and disable ligatures. It appears other terminals do the same
thing.
2023-08-25 09:29:15 -07:00
Mitchell Hashimoto ec69644de6
move stb to src/stb, add stb_image for png decoding 2023-08-20 22:03:20 -07:00
Mitchell Hashimoto 7ccf86b175
remove imgui and devmode
imgui has been a source of compilation challenges (our fault not theirs)
and devmode hasn't worked in awhile, so drop it.
2023-08-20 08:50:24 -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
Kevin Hovsäter 22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto dd18eaab5d
fix various build scripts 2023-08-02 15:06:24 -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
Mitchell Hashimoto 2a1cbb4f21
coretext: calculate units per em/point 2023-07-01 09:23:39 -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 7116ce0806
update zig version 2023-05-29 08:24:12 -07:00
Mitchell Hashimoto b196e43ee4
fix some issues for future Zig update 2023-05-19 08:34:07 -07:00
Mitchell Hashimoto 97d9157d22
update zig version 2023-05-07 20:50:51 -07:00
Mitchell Hashimoto 5dc98da9a0
build compiles at least 2023-03-24 19:39:50 -07:00
Mitchell Hashimoto 2b73fbaa0d
iterating on the new for loop syntax 2023-02-27 21:53:09 -08:00
Mitchell Hashimoto 8db30107ae
pkg: fmt 2023-02-27 21:46:59 -08:00
Mitchell Hashimoto ff9af8a07b
lots of progress running a surface but still crashes 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto be75109a1d
new build system 2023-02-14 20:58:33 -08:00
Mitchell Hashimoto 18f20add34
pkg/libuv: delete 2023-02-06 13:07:47 -08:00
Mitchell Hashimoto e9bf2a5680
pkg/objc: extract to zig-objc repo 2023-01-02 21:35:32 -08:00
Mitchell Hashimoto 6f3bc5186d
update to latest zig 2022-12-21 18:30:21 -08:00
Mitchell Hashimoto e210c91d10
update zig version, update @call for newer zig version 2022-12-16 22:34:54 -08:00
Mitchell Hashimoto b21e18a9e6
font: start converting Box font to our abstract canvas interface 2022-12-13 16:16:56 -08:00
Mitchell Hashimoto c8252133a3
update zig version 2022-12-12 22:10:52 -08:00
Mitchell Hashimoto 6ad45f0237
update zig 2022-11-30 16:54:04 -08:00
Mitchell Hashimoto abfffdcabe
pkg/pixman: more getters 2022-11-27 13:54:30 -08:00
Mitchell Hashimoto 120dfb4043
more wedges 2022-11-25 15:12:34 -08:00
Mitchell Hashimoto 2c9b3e2f9b
wedge triangles 2022-11-25 15:02:12 -08:00
Mitchell Hashimoto 88ff221d6d
pkg/pixman: fill rects 2022-11-25 14:10:25 -08:00
Mitchell Hashimoto f1a052640c
pkg/pixman: rasterize trapezoids 2022-11-25 13:36:17 -08:00
Mitchell Hashimoto 336d2c4e13
pkg/pixman: more image APIs 2022-11-25 11:34:31 -08:00
Mitchell Hashimoto 433d41fa9a
pkg/pixman: add more types 2022-11-24 10:21:27 -08:00
Mitchell Hashimoto ac4a45bdf3
pkg/pixman: fix math for bpp calculation 2022-11-24 10:21:27 -08:00
Mitchell Hashimoto 5f77ac145c
pkg/pixman: some drawing 2022-11-24 10:21:27 -08:00
Mitchell Hashimoto 699370bd4a
pkg/pixman: starting API 2022-11-24 10:21:27 -08:00
Mitchell Hashimoto ef65b261de
vendor/pixman and basic building 2022-11-24 10:21:27 -08:00
Mitchell Hashimoto 9b0fbde838
put some config in the devmode UI 2022-11-21 09:09:25 -08:00
Mitchell Hashimoto 1bce3d8e72
pkg/objc: make ptrcast var so that LLVM backend sees sig 2022-11-20 08:19:50 -08:00
Mitchell Hashimoto 2100523822
pkg/objc: correct objc_msgSend call on x86_64 depending on return type
On x86_64, we have to use specialized forms of `objc_msgSend` depending
on the return type (and the byte size of the return type). If we don't
do this, the calling convention is wrong and we'll get a segfault when
objc_msgSend tries to read a register that is [rightly] not set.

On aarch64, we do not have this issue because the calling convention is
different and objc_msgSend handles all cases.
2022-11-19 21:45:38 -08: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 7703873142
pkg/fontconfig: charset can add chars 2022-11-17 14:37:36 -08:00
Mitchell Hashimoto 69b91a951b
pkg/objc: autorelease pools 2022-11-14 09:59:09 -08:00
Mitchell Hashimoto 46a9998762
tracy: support naming threads 2022-11-07 07:33:36 -08:00
Mitchell Hashimoto 7b94153458
libuv: Prepare handles 2022-11-07 07:33:29 -08:00
Mitchell Hashimoto afd4800da4
pkg/imgui: support context current 2022-11-06 16:03:03 -08:00
Mitchell Hashimoto 9e3bbc1598
macos: send logs to unified logging 2022-10-31 15:16:29 -07:00
Mitchell Hashimoto 7608d7921f
pkg/macos: OS Log support 2022-10-31 14:47:10 -07:00
Mitchell Hashimoto c1b70cb788
metal: devmode 2022-10-31 09:44:37 -07:00
Mitchell Hashimoto 090bab6798
metal: setup the render loop, draw the background color 2022-10-31 09:44:36 -07:00
Mitchell Hashimoto 6d0b8a24d9
pkg/objc: shortcut for set/get property 2022-10-28 14:38:50 -07:00
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
Mitchell Hashimoto 791739de9c
pkg/macos: font initializes, get glyphs 2022-10-01 21:49:02 -07:00
Mitchell Hashimoto 0f34617eab
pkg/macos: fix crash when no fonts are found 2022-10-01 21:20:15 -07:00
Mitchell Hashimoto 8292e925fc
pkg/macos: fix invalid constant 2022-10-01 21:03:51 -07:00
Mitchell Hashimoto decbaafc6a
pkg/macos: add mutable dictionaries, flesh out font descriptor 2022-10-01 20:50:51 -07:00
Mitchell Hashimoto c6dc2a3529
macos/text: create collection from descriptors 2022-10-01 16:10:50 -07:00
Mitchell Hashimoto 623e7f5916
macos/text: FontTraits 2022-10-01 16:00:52 -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 d79c8fab39
macos/text: matching font descriptors 2022-09-30 15:13:29 -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
Mitchell Hashimoto 68786814f8
-Dtest-exe flag to build and install test executables
This will be used to copy tests to other platforms.
2022-09-30 13:05:23 -07:00
Mitchell Hashimoto fdbf40d3ee
pkg/freetype: disable ubsan 2022-09-29 11:39:09 -07:00
Mitchell Hashimoto 88a4cb65f3
src/font: working on initiaizing deferred fonts from fc 2022-09-23 14:12:38 -07:00
Mitchell Hashimoto 53f5739eca
use meta.FnPtr to prep for stage2 2022-09-23 13:20:43 -07:00
Mitchell Hashimoto 3bd9ed5952
Fix invalid c types with fontconfig 2022-09-23 13:14:08 -07:00
Mitchell Hashimoto 72105fc6cd
update to the latest stage2 compiler we can 2022-09-23 12:08:06 -07:00
Mitchell Hashimoto 57a82a26e7
pkg/fontconfig: const pointers 2022-09-17 09:19:00 -07:00
Mitchell Hashimoto 9750ac87fd
pkg/fontconfig: pattern get 2022-09-17 09:04:40 -07:00
Mitchell Hashimoto 86f7d0e04e
pkg/fontconfig: add some error handling 2022-09-17 08:58:42 -07:00
Mitchell Hashimoto 0d80225977
fontconfig: charset and langset apis 2022-09-16 15:12:02 -07:00
Mitchell Hashimoto d69f8397f3
pkg/fontconfig: add weights/slants enum 2022-09-16 10:08:49 -07:00
Mitchell Hashimoto 5b215409c6
pkg/fontconfig: pattern.add 2022-09-16 09:55:45 -07:00
Mitchell Hashimoto 77851b30a2
Revert "update to latest Zig nightly"
This reverts commit f3f2c3df26.
2022-09-14 19:39:10 -07:00
Mitchell Hashimoto f3f2c3df26
update to latest Zig nightly 2022-09-14 19:34:19 -07:00
Mitchell Hashimoto e4ea27ec37
fontconfig: more APIs 2022-09-14 14:30:18 -07:00
Mitchell Hashimoto aca36ba79b
fontconfig: fc-match 2022-09-14 14:26:42 -07:00
Mitchell Hashimoto 03ab1bedd4
fontconfig: fc-match 2022-09-14 12:49:43 -07:00
Mitchell Hashimoto eb2ce495b3
fontconfig: font list 2022-09-14 10:14:09 -07:00
Mitchell Hashimoto ce899dca11
fontconfig: font sets 2022-09-14 10:05:09 -07:00
Mitchell Hashimoto 382f569d65
fontconfig: object sets and patterns 2022-09-14 09:54:48 -07:00
Mitchell Hashimoto b4d571e018
pkg/fontconfig: disable ubsan (reported upstream) 2022-09-14 09:23:02 -07:00
Mitchell Hashimoto 59191b05cd
build fontconfig 2022-09-13 14:34:40 -07:00
Mitchell Hashimoto d422d1ee78
pkg/fontconfig: starting, not working 2022-09-13 13:53:20 -07:00
Mitchell Hashimoto 57725cf3a4
cache row iterator max value 2022-09-01 22:05:42 -07:00
Mitchell Hashimoto 953f1aeb29
pkg/harfbuzz: fixing some APIs 2022-08-30 10:02:40 -07:00
Mitchell Hashimoto 39376feae0
font: shape API, calls shape and outputs some debug 2022-08-29 20:15:29 -07:00
Mitchell Hashimoto 5a232e0c3e
utf8proc: add grapheme break API 2022-08-29 20:13:13 -07:00