Mitchell Hashimoto
ef16ba263f
16 more
2022-11-25 10:40:33 -08:00
Mitchell Hashimoto
58292e5930
16 more
2022-11-24 12:01:15 -08:00
Mitchell Hashimoto
dcd16c4d95
16 more
2022-11-24 11:49:17 -08:00
Mitchell Hashimoto
d8561ba23a
16 more
2022-11-24 11:27:32 -08:00
Mitchell Hashimoto
8033a4a665
more
2022-11-24 11:16:22 -08:00
Mitchell Hashimoto
fc8f36a59e
more glyphs for the glyph god
2022-11-24 10:21:28 -08:00
Mitchell Hashimoto
6e30238d36
more... more...
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
fbd5eba11a
font: more box glyphs
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
cb8f55229b
remove test code
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
6b2ca86ed8
fix offset for box glyphs
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
b9f97217ab
font: shaper handles special fonts
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
9bc8d85d67
test rendering box glyphs, looks OKAY
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
4b8b5c5fc1
font: skeleton for box drawing and hook up to Group
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
ca97c63a65
font: detect box glyphs, start littering stuff to denote special fonts
2022-11-24 10:21:27 -08:00
Mitchell Hashimoto
08bca077b2
search for unknown codepoints in any available font face
...
If an unknown codepoint is rendered, we now will query the OS for ANY
font that can satisfy the codepoint (rather than rendering `?`).
2022-11-17 16:09:33 -08:00
Mitchell Hashimoto
da2942e083
font: specific codepoint lookup in internals
2022-11-17 15:49:14 -08:00
Mitchell Hashimoto
8f9da82754
Embed nerd fonts into our default font
2022-11-17 14:16:50 -08:00
Mitchell Hashimoto
371a7f79cb
coretext: implement resizing
2022-11-15 20:29:58 -08:00
Mitchell Hashimoto
6218792710
font: GroupCache supports resize
2022-11-15 15:54:57 -08:00
Mitchell Hashimoto
24167d0d59
font: Group supports resize
2022-11-15 15:48:52 -08:00
Mitchell Hashimoto
d759c7fb25
font: freetype face supports resize
2022-11-15 15:37:16 -08:00
Mitchell Hashimoto
1c4552de3b
font: freetype eliminate some duplicated work on init
2022-11-15 15:23:28 -08:00
Mitchell Hashimoto
d1718e6cbf
use libc memcpy/memmove instead of std.mem if available
2022-11-08 19:01:45 -08:00
Mitchell Hashimoto
8dd9e7b325
Fix memory leak forgetting to clean up fontconfig
2022-10-24 15:55:57 -07:00
Mitchell Hashimoto
79f69885ca
update to latest zig which renames @min/@max
2022-10-19 10:42:31 -07:00
Mitchell Hashimoto
fa0028f104
coretext: rasterize glyph with a padding to prevent artifacting
2022-10-18 14:57:44 -07:00
Mitchell Hashimoto
c00c8f52b5
coretext: render glyph on its own bounding box, calculate bearings
2022-10-18 14:49:23 -07:00
Mitchell Hashimoto
38e0c258d0
coretext: we do want to smooth and anti-alias glyphs
2022-10-18 12:56:02 -07:00
Mitchell Hashimoto
4669032e56
face: coretext zero the bitmap before render
2022-10-18 12:52:37 -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
a39fe6baed
Use scalable check rather than fixed size check for setting char size
2022-10-16 20:55:06 -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
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
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
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
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
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
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