Browse Source

Merge pull request #4981 from gero3/patch-22

Throw a decent error on missing font.
Mr.doob 11 years ago
parent
commit
5369c0408a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/extras/FontUtils.js

+ 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."
+
+		};
 
 	},