浏览代码

Added link to new typeface.js converter. See #6519.

Mr.doob 10 年之前
父节点
当前提交
ad9f0dc6e2
共有 4 个文件被更改,包括 16 次插入20 次删除
  1. 2 0
      examples/fonts/README
  2. 13 14
      examples/webgl_geometry_text.html
  3. 0 1
      examples/webgl_geometry_text2.html
  4. 1 5
      src/extras/FontUtils.js

+ 2 - 0
examples/fonts/README

@@ -0,0 +1,2 @@
+Use Facetype.js to generate typeface.js fonts.
+http://gero3.github.io/facetype.js/

+ 13 - 14
examples/webgl_geometry_text.html

@@ -27,7 +27,6 @@
 
 		<div id="info">
 		<a href="http://threejs.org" target="_blank">three.js</a> - procedural 3D text by <a href="http://www.lab4games.net/zz85/blog" target="_blank">zz85</a> &amp; alteredq
-		(fonts from <a href="http://typeface.neocracy.org/">typeface.js</a> and <a href="http://en.wikipedia.org/wiki/Droid_%28font%29">Droid</a>)
 		<br/>type to enter new text, drag to spin the text
 		<br/><span class="button" id="color">change color</span>,
 			<span class="button" id="font">change font</span>,
@@ -276,12 +275,12 @@
 				document.getElementById( "font" ).addEventListener( 'click', function() {
 
 					fontIndex ++;
-					if ( fontIndex >= reverseFontMap.length ) { 
-						
+					if ( fontIndex >= reverseFontMap.length ) {
+
 						fontIndex = 0;
-						
+
 					}
-					
+
 					font = reverseFontMap[fontIndex];
 
 					refreshText();
@@ -386,33 +385,33 @@
 
 			function onDrop( e ) {
 				e.preventDefault();
-				
+
 				var file = e.dataTransfer.files[0],
 				    reader = new FileReader();
-				
+
 				reader.onload = function ( event ) {
 					console.log( event.target );
 					eval( event.target.result );
-				
+
 					var index = 0;
 					for ( f in THREE.FontUtils.faces ) {
-					
+
 						if ( ! fontMap[ f ] ) {
-						
+
 						fontMap[ f ] = reverseFontMap.length;
 						reverseFontMap[ reverseFontMap.length ] = f;
 						font = f;
-				
+
 						}
 					};
-			
+
 					refreshText();
-					
+
 				};
 
 				console.log(file);
 				reader.readAsText(file);
-				
+
 				return false;
 			};
 

+ 0 - 1
examples/webgl_geometry_text2.html

@@ -27,7 +27,6 @@
 
 		<div id="info">
 		<a href="http://threejs.org" target="_blank">three.js</a> - procedural 3D text by <a href="http://www.lab4games.net/zz85/blog" target="_blank">zz85</a> &amp; alteredq
-		(fonts from <a href="http://typeface.neocracy.org/">typeface.js</a> and <a href="http://en.wikipedia.org/wiki/Droid_%28font%29">Droid</a>)
 		<br/>built-in shape triangulation has been replaced with <a href="https://github.com/jahting/pnltri.js">PnlTri.js</a> by <a href="https://github.com/jahting" target="_blank">j ahting</a>
 		<br/>type to enter new text, drag to spin the text
 		<br/><span class="button" id="color">change color</span>,

+ 1 - 5
src/extras/FontUtils.js

@@ -6,10 +6,6 @@
  *
  * It uses techniques used in:
  *
- * 	typeface.js and canvastext
- * 		For converting fonts and rendering with javascript
- *		http://typeface.neocracy.org
- *
  *	Triangulation ported from AS3
  *		Simple Polygon Triangulation
  *		http://actionsnippet.com/?p=1462
@@ -233,7 +229,7 @@ THREE.FontUtils = {
 
 THREE.FontUtils.generateShapes = function ( text, parameters ) {
 
-	// Parameters 
+	// Parameters
 
 	parameters = parameters || {};