瀏覽代碼

Merge pull request #6403 from Lowfab/feature/typefaceNodeError

Fix undefined self (FontUtils.js)
Ricardo Cabello 10 年之前
父節點
當前提交
38660d3aa5
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      src/extras/FontUtils.js

+ 7 - 2
src/extras/FontUtils.js

@@ -464,5 +464,10 @@ THREE.FontUtils.generateShapes = function ( text, parameters ) {
 } )( THREE.FontUtils );
 
 // To use the typeface.js face files, hook up the API
-self._typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace };
-THREE.typeface_js = self._typeface_js;
+var typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace };
+if ( typeof self !== 'undefined' ){
+	self._typeface_js = typeface_js;
+}
+THREE.typeface_js = typeface_js;
+
+