19 Commits

Author SHA1 Message Date
Qwerasd
8a5d484729 font: more robust extraction of vertical metrics from tables
Previously always assuming the typo metrics were good caused some fonts
to have abnormally short cell heights.
2024-12-13 13:00:03 -05:00
Qwerasd
bd18452310 font: unify metrics calculations & separate sprite metrics
Unify grid metrics calculations by relying on shared logic mostly based
on values directly from the font tables, this deduplicates a lot of code
and gives us more control over how we interpret various metrics.

Also separate metrics for underlined, strikethrough, and overline
thickness and position, and box drawing thickness, so that they can
individually be adjusted as the user desires.
2024-12-11 16:55:52 -05:00
Mitchell Hashimoto
915ec029ee font/freetype: synthetic bold 2024-08-25 09:51:09 -07:00
Mitchell Hashimoto
5f0daa23b9 font/freetype: synthetic italic 2024-08-24 21:03:54 -07:00
Mitchell Hashimoto
91431a90a1 pkg/freetype: remove usingns 2024-08-16 15:34:46 -07:00
Mitchell Hashimoto
a205e1e2c1 pkg/freetype: use c_ulong which isn't 64-bit on windows 2024-05-28 20:49:21 -07:00
Mitchell Hashimoto
adaeffb2b5 font/freetype: CBDT/CBLC tables imply color 2024-05-28 20:40:46 -07:00
Mitchell Hashimoto
4daa49fe27 font/freetype: update to new presentation APIs 2024-05-28 20:25:49 -07:00
Mitchell Hashimoto
8920f45fd8 font/freetype: API to load font table 2024-05-28 09:48:01 -07:00
Mitchell Hashimoto
1ee5b7f91c font: freetype supports font variation settings 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
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
e493a722a3 fix some issues that fail nightly stage2 compiler 2022-10-13 10:54:30 -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
f1abca51f7 convert src/font to use new pkg/freetype 2022-08-28 22:22:16 -07:00
Mitchell Hashimoto
8ef3018189 pkg/freetype: loading glyphs 2022-08-28 21:02:39 -07:00
Mitchell Hashimoto
a2b06d7705 pkg/freetype: more face APIs 2022-08-28 17:18:23 -07:00