Warn when glyphs cannot fit the atlas
This commit is contained in:
1 parent
2026e5d088
commit
80b28fff1a
4 files changed
+14
-1
No files matched your search
Generated
+1
@@ -1189,6 +1189,7 @@ dependencies = [
|
|||||||
"bytemuck",
|
"bytemuck",
|
||||||
"fxhash",
|
"fxhash",
|
||||||
"image",
|
"image",
|
||||||
|
"log",
|
||||||
"parley",
|
"parley",
|
||||||
"swash",
|
"swash",
|
||||||
"wgpu",
|
"wgpu",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ image = "0.25.6"
|
|||||||
parley = "0.11.1"
|
parley = "0.11.1"
|
||||||
swash = "0.2.10"
|
swash = "0.2.10"
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
|
log = "0.4.29"
|
||||||
arboard = "3.6.1"
|
arboard = "3.6.1"
|
||||||
iris-core = { path = "core" }
|
iris-core = { path = "core" }
|
||||||
iris-macro = { path = "macro" }
|
iris-macro = { path = "macro" }
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ image = { workspace = true }
|
|||||||
parley = { workspace = true }
|
parley = { workspace = true }
|
||||||
swash = { workspace = true }
|
swash = { workspace = true }
|
||||||
fxhash = { workspace = true }
|
fxhash = { workspace = true }
|
||||||
|
log = { workspace = true }
|
||||||
@@ -76,10 +76,20 @@ impl GlyphAtlas {
|
|||||||
let w = image.placement.width;
|
let w = image.placement.width;
|
||||||
let h = image.placement.height;
|
let h = image.placement.height;
|
||||||
if w == 0 || h == 0 {
|
if w == 0 || h == 0 {
|
||||||
|
log::warn!(
|
||||||
|
"glyph {} in font {} rasterized at {w}x{h}; skipping it",
|
||||||
|
key.glyph,
|
||||||
|
key.font,
|
||||||
|
);
|
||||||
self.entries.insert(key, None);
|
self.entries.insert(key, None);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
if w + PAD * 2 > PAGE || h + PAD * 2 > PAGE {
|
if w > PAGE - PAD * 2 || h > PAGE - PAD * 2 {
|
||||||
|
log::warn!(
|
||||||
|
"glyph {} in font {} rasterized at {w}x{h}, too large for the {PAGE}x{PAGE} atlas; skipping it",
|
||||||
|
key.glyph,
|
||||||
|
key.font,
|
||||||
|
);
|
||||||
self.entries.insert(key, None);
|
self.entries.insert(key, None);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user