Font.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Font - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">Font</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Class representing a font.</p></div>
  16. </header>
  17. <article>
  18. <div class="container-overview">
  19. <h2>Constructor</h2>
  20. <h3 class="name name-method" id="Font" translate="no">new <a href="#Font">Font</a><span class="signature">( data : <span class="param-type">Object</span> )</span> </h3>
  21. <div class="method">
  22. <div class="description">
  23. <p>Constructs a new font.</p>
  24. </div>
  25. <table class="params">
  26. <tbody>
  27. <tr>
  28. <td class="name"><code>data</code></td>
  29. <td class="description last"><p>The font data as JSON.</p></td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </div>
  34. </div>
  35. <h2 class="subsection-title">Properties</h2>
  36. <div class="member">
  37. <h3 class="name" id="data" translate="no">.<a href="#data">data</a><span class="type-signature"> : Object</span> </h3>
  38. <div class="description">
  39. <p>The font data as JSON.</p>
  40. </div>
  41. </div>
  42. <div class="member">
  43. <h3 class="name" id="isFont" translate="no">.<a href="#isFont">isFont</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  44. <div class="description">
  45. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Methods</h2>
  49. <h3 class="name name-method" id="generateShapes" translate="no">.<a href="#generateShapes">generateShapes</a><span class="signature">( text : <span class="param-type">string</span>, size : <span class="param-type">number</span>, direction : <span class="param-type">string</span> )</span><span class="type-signature"> : Array.&lt;<a href="Shape.html">Shape</a>></span> </h3>
  50. <div class="method">
  51. <div class="description">
  52. <p>Generates geometry shapes from the given text and size. The result of this method
  53. should be used with <a href="ShapeGeometry.html">ShapeGeometry</a> to generate the actual geometry data.</p>
  54. </div>
  55. <table class="params">
  56. <tbody>
  57. <tr>
  58. <td class="name"><code>text</code></td>
  59. <td class="description last"><p>The text.</p></td>
  60. </tr>
  61. <tr>
  62. <td class="name"><code>size</code></td>
  63. <td class="description last"><p>The text size.<br/>Default is <code>100</code>.</p></td>
  64. </tr>
  65. <tr>
  66. <td class="name"><code>direction</code></td>
  67. <td class="description last"><p>Char direction: ltr(left to right), rtl(right to left) &amp; tb(top bottom).<br/>Default is <code>'ltr'</code>.</p></td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. <dl class="details">
  72. <dt class="tag-returns"><strong>Returns:</strong> An array of shapes representing the text.</dt>
  73. </dl>
  74. </div>
  75. <h2 class="subsection-title">Source</h2>
  76. <p>
  77. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/FontLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/FontLoader.js</a>
  78. </p>
  79. </article>
  80. </section>
  81. <script src="../scripts/linenumber.js"></script>
  82. <script src="../scripts/page.js"></script>
  83. </body>
  84. </html>
粤ICP备19079148号