Skip to main content

get_vector_string_width_family

Function get_vector_string_width_family 

Source
pub fn get_vector_string_width_family(
    s: &str,
    size_px: u32,
    family_list: &str,
    bold: bool,
    ls: i32,
    ws: i32,
) -> u32
Expand description

font-family を考慮した文字列幅(draw::draw_string_family と同じ書体選択で測る)。

【2026-09-26 バグ修正】行の組み立て(web_engine::layout の折り返し)は内蔵フォントの 幅で測り、描画は Web フォント(Noto Sans JP 等)で描いていた。書体によって文字幅が違うため 行が実際より短く見積もられ、描画時に窓の右端を超えた分が描画関数の中で勝手に改行されて、 次の行と重なっていた(sugi-lab.net/profile.htm の研究概要)。 登録済みの family が無ければ内蔵フォントの幅(従来どおり)。