Registry / RepositoryTypeScriptRustPython
Rollpie
ReadmeFiles
Versions
Info
Download
0.2.0579.9 KB2026-09-150.1.1576.6 KB2026-09-12
Version
0.1.1
Copyright
Rollpie, Irohabook
Publisher
math
Published
2026-09-12
Size
576.6 KB
Downloads
4
Checksum
8e0181e42f4abdc9f91c1ff48b058761bf1940be8d2d4747e5e74bd3014f4322
Dependencies
None

have.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//! 指定した文字を書体が持っているかを見る

use suki::font;

fn main() {
    let path = std::env::args().nth(1).unwrap_or_else(|| "font/latinmodern-math.otf".to_string());
    let loaded = font::load(std::fs::read(&path).unwrap()).unwrap();
    println!("{}", font::family(&loaded));

    let wanted = "ℝℤℂℕℚℍℙ𝔸𝔹𝔻𝔼𝕏𝕐𝕫𝟙ABRZ";

    for character in wanted.chars() {
        match font::glyph_of(&loaded, character) {
            Some(glyph) => {
                let drawn = font::outline_of(&loaded, glyph);
                println!(
                    "  {character} U+{:04X} 字形 {glyph} 線 {} 送り {:.3}",
                    character as u32,
                    drawn.segment.len(),
                    font::advance(&loaded, glyph)
                );
            }
            None => println!("  {character} U+{:04X} 持っていない", character as u32),
        }
    }
}