Skip to content

Commit f7199aa

Browse files
yak32Iakov Sumygin
andauthored
print a console error if a char is missing in the font (playcanvas#2984)
Co-authored-by: Iakov Sumygin <isumygin@snap.com>
1 parent 4e96d2f commit f7199aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/framework/components/element/text-element.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,17 @@ class TextElement {
734734
break;
735735
}
736736
}
737+
738+
// #ifdef DEBUG
739+
if (!json.missingChars) {
740+
json.missingChars = new Set();
741+
}
742+
743+
if (!json.missingChars.has(char)) {
744+
console.warn("Character '" + char + "' is missing from the font " + json.info.face);
745+
json.missingChars.add(char);
746+
}
747+
// #endif
737748
}
738749
}
739750

0 commit comments

Comments
 (0)