fix(engine): silence usvg font-substitution warn spam
The bundled hayeah card SVGs declare font-family="Arial" for rank/suit text. usvg matches family names exactly, so on systems without Arial installed (every Linux distro by default) every text node bridged a log::warn! into our tracing output — 50+ lines per launch. Two-part fix: - svg_loader now populates a process-wide fontdb with system fonts (lazy via OnceLock) so substitution actually has faces to fall through to. usvg::Options::default() ships an empty fontdb, which meant text glyphs had nothing to fall back on at all. - LogPlugin extends DEFAULT_FILTER with usvg::text=error so the residual "no match" warns drop. The substitution itself works; the message is purely informational because Arial truly isn't installed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,19 @@ fn main() {
|
||||
.set(bevy::asset::AssetPlugin {
|
||||
file_path: "../assets".to_string(),
|
||||
..default()
|
||||
})
|
||||
// The bundled hayeah card SVGs declare `font-family="Arial"`
|
||||
// for rank/suit text. usvg compares family names exactly,
|
||||
// so on systems without Arial installed (every Linux
|
||||
// distro by default) it bridges a `log::warn!` per text
|
||||
// node into our tracing output — 50+ lines per game on
|
||||
// launch. The substitution path in `svg_loader::shared_fontdb`
|
||||
// already resolves the glyphs to whatever sans-serif the
|
||||
// user does have; the warn is purely informational and
|
||||
// dropping it leaves real errors visible.
|
||||
.set(bevy::log::LogPlugin {
|
||||
filter: format!("{},usvg::text=error", bevy::log::DEFAULT_FILTER),
|
||||
..default()
|
||||
}),
|
||||
)
|
||||
.add_plugins(AssetSourcesPlugin)
|
||||
|
||||
Reference in New Issue
Block a user