浏览代码

Merge pull request #19255 from Mugen87/dev49

TTFLoader: Migrate completely to modules.
Mr.doob 5 年之前
父节点
当前提交
6ed29ec8e4
共有 4 个文件被更改,包括 21 次插入2 次删除
  1. 19 0
      examples/jsm/libs/opentype.module.min.js
  2. 1 0
      examples/jsm/loaders/TTFLoader.js
  3. 0 1
      examples/webgl_loader_ttf.html
  4. 1 1
      utils/modularize.js

文件差异内容过多而无法显示
+ 19 - 0
examples/jsm/libs/opentype.module.min.js


+ 1 - 0
examples/jsm/loaders/TTFLoader.js

@@ -12,6 +12,7 @@ import {
 	FileLoader,
 	Loader
 } from "../../../build/three.module.js";
+import { opentype } from "../libs/opentype.module.min.js";
 
 var TTFLoader = function ( manager ) {
 

+ 0 - 1
examples/webgl_loader_ttf.html

@@ -7,7 +7,6 @@
 		<link type="text/css" rel="stylesheet" href="main.css">
 	</head>
 	<body>
-		<script src="js/libs/opentype.min.js"></script>
 		<div id="info">
 			<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> - TTFLoader using opentype by gero3
 			<br/>type to enter new text, drag to spin the text

+ 1 - 1
utils/modularize.js

@@ -101,7 +101,7 @@ var files = [
 	{ path: 'loaders/SVGLoader.js', dependencies: [], ignoreList: [ 'Color' ] },
 	{ path: 'loaders/TDSLoader.js', dependencies: [], ignoreList: [] },
 	{ path: 'loaders/TGALoader.js', dependencies: [], ignoreList: [] },
-	{ path: 'loaders/TTFLoader.js', dependencies: [], ignoreList: [ 'Font' ] },
+	{ path: 'loaders/TTFLoader.js', dependencies: [ { name: 'opentype', path: 'libs/opentype.module.min.js' } ], ignoreList: [ 'Font' ] },
 	{ path: 'loaders/VRMLLoader.js', dependencies: [ { name: 'chevrotain', path: 'libs/chevrotain.module.min.js' } ], ignoreList: [] },
 	{ path: 'loaders/VRMLoader.js', dependencies: [ { name: 'GLTFLoader', path: 'loaders/GLTFLoader.js' } ], ignoreList: [] },
 	{ path: 'loaders/VTKLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' } ], ignoreList: [] },

部分文件因为文件数量过多而无法显示