Docs.rs
shields-0.1.0
shields 0.1.0
Docs.rs crate page
MIT
Links
Homepage
Repository
crates.io
Source
Owners
Jannchie
Dependencies
lru ^0.12
normal
once_cell ^1
normal
serde ^1
normal
serde_json ^1
normal
ttf-parser ^0.19
normal
reqwest ^0.12
dev
sha2 ^0.10
dev
tokio ^1
dev
urlencoding ^2
dev
Versions
46.15%
of the crate is documented
Go to latest version
Platform
i686-pc-windows-msvc
i686-unknown-linux-gnu
x86_64-apple-darwin
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
Feature flags
docs.rs
About docs.rs
Badges
Builds
Metadata
Shorthand URLs
Download
Rustdoc JSON
Build queue
Privacy policy
Rust
Rust website
The Book
Standard Library API Reference
Rust by Example
The Cargo Guide
Clippy Documentation
shields
0.1.0
shields
Function
get_text_width
Copy item path
Source
pub fn get_text_width(text: &
str
) ->
f64
Expand description
计算文本在 Verdana 11px 下的宽度(像素)
仅需传入 text,内部自动加载并复用宽度表
高效惰性初始化,避免重复 IO
可直接用于 SVG 徽章等场景