|
@@ -12,10 +12,10 @@
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
<p class="desc">
|
|
|
- 使用JSON格式中加载字体的一个类。返回font, 返回值是表示字体的[page:Shape Shape]类型的数组。
|
|
|
+ 一个用于加载JSON格式的字体的类。。返回font, 返回值是表示字体的[page:Shape Shape]类型的数组。
|
|
|
其内部使用[page:FileLoader]来加载文件。 <br /><br />
|
|
|
|
|
|
- 你可以使用[link:https://gero3.github.io/facetype.js/ facetype.js]在线转换字体。
|
|
|
+ 你可以使用[link:https://gero3.github.io/facetype.js/ facetype.js]来在线转换字体。
|
|
|
</p>
|
|
|
|
|
|
<h2>代码示例</h2>
|
|
@@ -68,18 +68,18 @@
|
|
|
<h3>[method:undefined load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
|
|
|
<p>
|
|
|
[page:String url] — 文件的URL或者路径,也可以为
|
|
|
- [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
|
|
|
- [page:Function onLoad] — 加载完成时将调用。回调参数是将要被加载的[page:Texture texture].<br />
|
|
|
- [page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,实例包含[page:Integer total]和[page:Integer loaded]字节。<br />
|
|
|
- [page:Function onError] — 在加载错误时被调用。<br /><br />
|
|
|
+ [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]。<br />
|
|
|
+ [page:Function onLoad] — 将在加载完成时调用。参数是将要被加载的font。<br />
|
|
|
+ [page:Function onProgress] — 将在加载过程中调用。参数是包含[page:Integer total]和[page:Integer loaded]字节的XMLHttpRequest实例。如果server没有设置header的Content-Length,则[page:Integer total]值为0。<br />
|
|
|
+ [page:Function onError] — 将在加载错误时调用。<br /><br />
|
|
|
|
|
|
- 从URL中进行加载,并将被加载的[page:Texture texture]传递给onLoad。
|
|
|
+ 开始加载url,并将加载的font传递给onLoad。
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Font parse]( [param:Object json] )</h3>
|
|
|
<p>
|
|
|
- [page:Object json] — The <em>JSON</em> structure to parse.<br /><br />
|
|
|
- 以<em>JSON</em>格式进行解析,并返回一个font.
|
|
|
+ [page:Object json] — 用于解析的<em>JSON</em>>格式的对象。<br /><br />
|
|
|
+ 解析一个<em>JSON</em>>格式的对象,并返回一个font。
|
|
|
</p>
|
|
|
|
|
|
<h2>源</h2>
|