Repository navigation
Conversation
phip1611
marked this pull request as ready for review
December 1, 2026 14:54
Member
Member
|
Nvm, figured I out: The width decreased from 9 to 7. @phip1611 That's expected, right? |
Member
Author
|
that is expected and comes from the new rendering. The policy I used in the crate is to be able to render every possible char without clipping. But I see that this might be not the best policy as some rare non standard characters influence force that onto normal characters..
That is btw compared to v0.3, not v0.2. |
phip1611
marked this pull request as draft
December 1, 2026 21:57
Member
Author
|
To be honest, font rendering is complex and I have no clue. For the v0.4.0 release, I got help from Claude and Opus 5.5. I am pretty confident it does the right thing and that terminals and other software render mono fonts in a similar way. |
phip1611
marked this pull request as ready for review
December 1, 2026 22:04
Version 0.4 renders the mono font the standard way, like terminal emulators and editors do: the raster height is the font's line height, all characters share a common baseline aligned to the pixel grid, and the outlines are hinted. Characters are sharper and no longer cut off. Version 0.2 used a font size that did not fit into the raster. For example, the dots of 'Ä' were squashed into the top row and the descender of 'g' was cut off. With 0.4, the same 16 px raster holds an 11.75 px font instead of a 14 px one, and characters are 7 instead of 9 px wide. A later commit switches to a larger raster. The crate now stores the glyphs as flat byte blobs instead of per-row slices, which drops the per-row pointers. This shrinks the UEFI bootloader by ~24 KiB (-14%) and BIOS stage 4 by ~21 KiB (-14%).
Stage 3 still used version 0.1, whose default `all` feature compiles all 24 font variants (3 weights, 8 sizes). This alone took ~7 s on the critical path of every clean build. We now enable only the variant we use, like `common` does. A clean build of the `bootloader` crate drops from ~25 s to ~19 s and the stage 3 binary shrinks by ~28 KiB (-24%). Only one version of the crate remains in the dependency tree. Version 0.4 has no 14 px raster height anymore, so stage 3 now uses 16 px like the rest of the bootloader. The font size stays about the same (12 px before, 11.75 px now). Latin-1 stays enabled to keep the previous character coverage.
Both `common` and BIOS stage 3 use the crate, so a single version in the workspace keeps them in sync and avoids pulling in two versions again. Each crate still selects its own features, as they need different unicode ranges.
With noto-sans-mono-bitmap 0.4, the raster height is the font's line height, so the font size is ~73% of it. With the 16 px raster, the text became visibly smaller than with 0.2 (an 11.75 px instead of a 14 px font). A 20 px raster holds a 14.7 px font with 9 px wide characters. In `common`, this keeps the number of characters per line from 0.2 and makes the characters slightly larger. Stage 3 uses the same size, so that the text of both stages looks the same. The larger glyphs grow the UEFI bootloader and BIOS stage 4 by ~5.5 KiB and stage 3 by ~12 KiB. All three are still 10-14% smaller than before the bump to 0.4.
The raster of noto-sans-mono-bitmap 0.4 already includes the font's line spacing, so the additional 2 px made the text look loose. Lines are now 20 px apart (18 px with 0.2). Stage 3 already uses no extra spacing.
phip1611
force-pushed
the
bump-noto-sans-mono-bitmap
branch
from
December 1, 2026 22:19
b79789f to
fb638fb
Compare
phip1611
marked this pull request as draft
December 1, 2026 22:22
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR bumps
noto-sans-mono-bitmapto 0.4.0 incommonand BIOS stage 3, and makes it a workspace dependency. Version 0.4 renders the mono font the standard way, like terminals and editors: characters are sharper, share a common baseline, and are no longer cut off. As the raster height is now the font's line height, the text uses a 20 px raster without extra line spacing, so it stays about as large as before (14.7 px instead of 14 px font, same characters per line). Stage 3 previously pulled in 0.1 with all 24 font variants. It now compiles only the one it uses, which cuts clean builds by ~25%.Screenshots
Framebuffer log of the
basic_boottest kernel in QEMU. Before:main(0.2, 16 px raster, 2 px extra line spacing). After: this PR.main)In the zoomed view, the descender of
g("Using") is no longer cut off.Build time (clean builds)
Measured before the switch to the 20 px raster.
bootloadercrate, end-to-endBinary size
.efi)Testing
cargo fmt,cargo check, andcargo clippy(as in CI) pass on every commit.cargo test -- --test-threads 1and theexamples/basicbuild pass on the last commit.