19 Commits

Author SHA1 Message Date
Qwerasd
4b33f07b73 font/sprite: Fix U+255D
Double Up and Left '╝' previously had a hole in the bottom, extend line to fill gap.
2024-04-08 23:10:00 -04:00
Mitchell Hashimoto
555f6e159f font/sprite: remove comptime arg for box drawing 2024-04-02 08:38:36 -07:00
Qwerasd
5abc63193e font/sprite: improve rendering of dashed lines
Previous implementation would draw dashes to the edge of the character
cell, which would result in double-wide dashes at the point where they
tiled. This fixes that, and also generally implements it in a cleaner
way than before.
2024-04-01 18:35:34 -04:00
Mitchell Hashimoto
85b40874cf font/sprite: manually determine which box codepoints are unadjusted
Some box codepoints (the cursor) want to use the original font metrics
height but others (corners) want to use the full grid height. I can't
see a better way to do this than manually maintaining a switch here. We
can add codepoints as needed.
2023-12-13 10:32:16 -08:00
Mitchell Hashimoto
3a5f12b8ab font: box sprite use saturated subtraction
Fixes #757

The x/y is unsigned (as it should be, since top-left is 0,0). In the
case of a very small grid size and certain thickness settings, its
possible to overflow. In this scenario, the only reasonable thing to do
is just clamp to 0 because some sprites are going to look weird with
small enough grids anyways.
2023-10-30 09:01:14 -07:00
Mitchell Hashimoto
4ed240515c font/sprite: fix horizontal dash drawing math for cells too small
Fixes #143

There were multiple issues with the previous calculation. First, we
expected dash width COULD be negative and protected against it, but our
dash width calculation type was unsigned! With the proper font metrics,
this led to an underflow safey panic.

Second, as part of the dash width calculation, we are tryign to downstep
the size of the gaps so we can try to fit dashes within a cell. But we
were not using those adjusted gap sizes. With the proper font metrics,
this could lead to an assertion failure seen in #143.

This fixes the calculations. They produce the same numbers, but do so in
a more Zig-idiomatic way while fixing the above two issues.
2023-08-29 11:25:49 -07:00
Mitchell Hashimoto
9300404603 font: block cursor was not taking full cell width 2023-07-10 11:45:35 -07:00
Mitchell Hashimoto
853f15ef19 bar cursor was short by a couple pixels 2023-07-04 13:12:21 -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
97d9157d22 update zig version 2023-05-07 20:50:51 -07:00
Mitchell Hashimoto
cf519bcd75 Use procedurally generated sprites for cursors rather than shaders 2023-03-04 15:14:10 -08:00
Mitchell Hashimoto
c391d0f3de font: web canvas sprite font can composite 2022-12-13 22:17:27 -08:00
Mitchell Hashimoto
ead8610604 font: Box font uses canvas abstraction 2022-12-13 21:08:45 -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
f871630fa4 move Atlas to font 2022-11-28 10:35:46 -08:00
Mitchell Hashimoto
84efd2ac5f font: use Canvas more, Canvas rect 2022-11-27 14:08:15 -08:00
Mitchell Hashimoto
28d386967d font: introduce Canvas, start converting Box 2022-11-27 13:54:43 -08:00
Mitchell Hashimoto
b34e336c5c rearrange box rendering to prepare for more sprite drawing 2022-11-27 10:17:12 -08:00