13 Commits

Author SHA1 Message Date
Qwerasd
c838d3d7d2 font/sprite: remove yHalfs and friends, use Fraction
Introduces `fill`, which fills between two `Fraction`s, use this instead
of `yHalfs` and friends wherever they're used, which also means we can
remove `rect`.

This commit does change alignment of the vertical/horizontal eighths in
certain cell sizes, but the change is for the better IMO. Also changes
the center-point alignment of smooth mosaics for odd cell widths, but
the change is no more than half a pixel at worst and is probably an
improvement ultimately.
2025-07-01 16:00:45 -06:00
Qwerasd
1377e6d225 font/sprite: rework sprite font drawing
This is a fairly large rework of how we handle the sprite font drawing.
Drawing routines are now context-less, provided only a canvas and some
metrics. There is now a separate file per unicode block / PUA area.
Sprites are now drawn on canvases with an extra quarter-cell of padding
on each edge, and automatically cropped when sent to the atlas, this
allows sprites to extend past cell boundaries which makes it possible to
have, for example, diagonal box drawing characters that connect across
cell diagonals instead of being pinched in.

Most of the sprites the code is just directly ported from the old code,
but I've rewritten a handful. Moving forward, I'd like to rewrite more
of these since the way they're currently written isn't ideal.

This rework, in addition to improving the packing efficiency of sprites
on the atlas, and allowing for out-of-cell drawing, will make it a lot
easier to add new sprites in the future, since all it takes now is to
add a single function and an import (if it's a new file).

I reworked the regression/change testing to be more robust as well, it
now covers all sprite glyphs (except non-codepoint ones) and does so at
4 different sizes. Addition/removal of glyphs will no longer create diff
noise in the generated diff image, since the position in the image of
each glyph is now fixed.
2025-06-30 11:16:47 -06:00
Jeffrey C. Ollie
48b6807ac9 nix: fix typos 2025-05-26 11:12:30 -05:00
Jeffrey C. Ollie
5cd8ebdafd update zon2nix
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 01:09:52 -05:00
Mitchell Hashimoto
ef0ff94c75 translations: add German translation (#6601)
This PR adds a translation for German `de_DE`.

Additionally it excludes all `*.po` files from the typos CI action.

Some comments on the decisions I made (open to discuss them):

- I choosed to use `du` instead of `Sie` as this seems appropriate
  to me.
- I added `Window` (`Fenster` in German) to all split commands
  as it appears more naturally to me.
2025-03-13 10:05:27 -07:00
Mitchell Hashimoto
907ed239a1 update typos 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
2e45a4c7a3 fix typos 2025-03-12 11:23:11 -07:00
Robin Pfäffle
7e268b9a43 ci: typos ignore *.po files 2025-03-08 08:11:43 +01:00
Tim Culverhouse
9cb297202b cli: add +boo command
Add a `+boo` command to show the animation from the website. The data
for the frames is compressed during the build process. This build step
was added to the SharedDeps object because it is used in both
libghostty and in binaries.

The compression is done as follows:
- All files are concatenated together using \x01 as a combining byte
- The files are compressed to a cached build file
- A zig file is written to stdout which `@embedFile`s the compressed
  file and exposes it to the importer
- A new anonymous module "framedata" is added in the SharedDeps object

Any file can import framedata and access the compressed bytes via
`framedata.compressed`. In the `boo` command, we decompress the file and
split it into frames for use in the animation.

The overall addition to the binary size is 348k.
2025-02-14 14:46:18 -08:00
Bryan Lee
ac524b6c34 Correct typos and update typos.toml 2025-01-03 09:55:21 +08:00
Mitchell Hashimoto
5a3b942589 typos: ignore lorem 2024-09-27 10:58:33 -07:00
Qwerasd
10b8ca3c69 spelling: normalize grey -> gray 2024-08-11 18:31:01 -04:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00