summaryrefslogtreecommitdiff
path: root/src/font/Metrics.zig
AgeCommit message (Collapse)Author
2025-10-03Zig 0.15: zig build test Mitchell Hashimoto
2025-09-29Rewrite constraint code for improved icon scaling/alignmentDaniel Wennberg
2025-09-17Measure ascii height and use to upper bound ic_widthDaniel Wennberg
2025-09-05Fix off-by-one error & adjust overline pos in cell height mod (#8022)Mitchell Hashimoto
I noticed that there was an off-by-one error in cell height adjustment when the number of pixels to add/subtract is odd. The metrics measured from the top would be shifted by one less than they should, so, for example, the underline position would move one pixel closer to the baseline than it had been (or one pixel further away if subtracting). Also noticed that the overline position was missing here, so added that.
2025-08-10Revert "font/Metrics: remove original_cell_width, no longer needed"Qwerasd
This reverts commit 23cc50b12c1b670ff3f96c63437f61742d3b4d3c.
2025-07-25font: clean up Collection api somewhatQwerasd
Move size adjustment logic out of `Entry`, I understand the impulse to put it there but it results in passing a lot of stuff around which isn't great. Rework `add(...)` in to `add(...)` and `addDeferred(...)`, faces are passed directly now instead of passing an entry, and an options struct is used instead of positional arguments for things like style, fallback, and size adjustment. Change size adjustment test back to a half pixel tolerance instead of 5% because the previous commit (allowing fractional pixel sizes) fixed the root cause of large differences.
2025-07-22Rewrite comment for clarityDaniel Wennberg
2025-07-22Fix off-by-one error & adjust overline pos in cell height modDaniel Wennberg
2025-07-17Move face metric fallback estimates to the FaceMetric structDaniel Wennberg
2025-07-07font: add icon height to nerd font constraintsQwerasd
Icons were often WAY too big before because they were filling the whole cell in height, which isn't great lol. This commit adds an `icon_height` metric which is used to constrain glyphs that shouldn't be the size of the entire cell.
2025-07-07font/Metrics: remove original_cell_width, no longer neededQwerasd
2025-07-06fix(font): include line gap in `lineHeight` helperQwerasd
2025-07-06font: adjust fallback font sizes to match primary metricsQwerasd
This better harmonizes fallback fonts with the primary font by matching the heights of lowercase letters. This should be a big improvement for users who use mixed scripts and so rely heavily on fallback fonts.
2025-03-18ci: zig fmt checkMitchell Hashimoto
This adds a CI test to ensure that all Zig files are properly formatted. This avoids unrelated diff noise in future PRs.
2025-03-12Lots of 0.14 changesMitchell Hashimoto
2025-01-06refactor(font): move ownership of `Metrics` to `Collection`Qwerasd
This sets the stage for dynamically adjusting the sizes of fallback fonts based on the primary font's face metrics. It also removes a lot of unnecessary work when loading fallback fonts, since we only actually use the metrics based on the parimary font.
2025-01-06refactor(font): move `Metrics` out of `face`Qwerasd
in preparation to move ownership of metrics from faces to collections