Carry XDV device advances through packed box scopes

This commit is contained in:
gloamxun committed 2026-11-29 03:42:11 +08:00
1 parent 9da75c82f5
commit 9efededf6d
14 files changed
+252 -83

No files matched your search

+5 -1
View File
@@ -411,7 +411,11 @@ impl TfmMetrics {
/// driver rounds the exact fixword product to a scaled point.
pub(crate) fn xdv_width(&self, slot: u8) -> i64 {
let Some(info) = self.char_info(char::from(slot)) else { return 0 };
let product = i64::from(self.widths[usize::from(info.width_index)]) * self.size;
Self::scale_xdv_fix_word(self.widths[usize::from(info.width_index)], self.size)
}
pub(crate) fn scale_xdv_fix_word(raw: i32, size: i64) -> i64 {
let product = i64::from(raw) * size;
product.signum() * ((product.abs() + (1 << 19)) >> 20)
}