INNER CODE UNIT · Rust
x
free-explorers/veshell · src/embedder/backend/render/mod.rs:569
let x = pen_x + metrics.xmin;
let y = ((canvas_height - box_height) / 2) + (box_height - metrics.height as i32) / 2;
placed.push((x, y, metrics.width as i32, metrics.height as i32, bitmap));
pen_x += metrics.advance_width.round() as i32;
}
// Right-align the drawn text at the chip's right edge inset.
const TEXT_RIGHT_INSET: f64 = 6.0;
let text_width = pen_x;
let text_start_x =
canvas_width - (TEXT_RIGHT_INSET * integer_scale).round() as i32 - text_width;
let shift_x = text_start_x;
// Anti-aliased coverage is brightened with a wide gamma so the thin
// glyph strokes of a small font render at full white against the
// black chip instead of fading to gray.
static WHITE_GAMMA: LazyLock<[u8; 256]> = LazyLock::new(|| {
let mut table = [0u8; 256];