2
0
Эх сурвалжийг харах

Merge pull request #4981 from gero3/patch-22

Throw a decent error on missing font.
Mr.doob 11 жил өмнө
parent
commit
5369c0408a

+ 9 - 1
src/extras/FontUtils.js

@@ -33,7 +33,15 @@ THREE.FontUtils = {
 
 	getFace: function () {
 
-		return this.faces[ this.face ][ this.weight ][ this.style ];
+		try {
+
+			return this.faces[ this.face ][ this.weight ][ this.style ];
+
+		} catch (e) {
+
+			throw "The font " + this.face + " with " + this.weight + " weight and " + this.style + " style is missing."
+
+		};
 
 	},