Font.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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">
  29. <strong>data</strong>
  30. </td>
  31. <td class="description last">
  32. <p>The font data as JSON.</p>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. </div>
  39. <h2 class="subsection-title">Properties</h2>
  40. <div class="member">
  41. <h3 class="name" id="data" translate="no">.<a href="#data">data</a><span class="type-signature"> : Object</span> </h3>
  42. <div class="description">
  43. <p>The font data as JSON.</p>
  44. </div>
  45. </div>
  46. <div class="member">
  47. <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>
  48. <div class="description">
  49. <p>This flag can be used for type testing.</p>
  50. <p>Default is <code>true</code>.</p>
  51. </div>
  52. </div>
  53. <h2 class="subsection-title">Methods</h2>
  54. <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>
  55. <div class="method">
  56. <div class="description">
  57. <p>Generates geometry shapes from the given text and size. The result of this method
  58. should be used with <a href="ShapeGeometry.html">ShapeGeometry</a> to generate the actual geometry data.</p>
  59. </div>
  60. <table class="params">
  61. <tbody>
  62. <tr>
  63. <td class="name">
  64. <strong>text</strong>
  65. </td>
  66. <td class="description last">
  67. <p>The text.</p>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class="name">
  72. <strong>size</strong>
  73. </td>
  74. <td class="description last">
  75. <p>The text size.</p>
  76. <p>Default is <code>100</code>.</p>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td class="name">
  81. <strong>direction</strong>
  82. </td>
  83. <td class="description last">
  84. <p>Char direction: ltr(left to right), rtl(right to left) &amp; tb(top bottom).</p>
  85. <p>Default is <code>'ltr'</code>.</p>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> An array of shapes representing the text.</dt>
  92. </dl>
  93. </div>
  94. <h2 class="subsection-title">Source</h2>
  95. <p>
  96. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/FontLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/FontLoader.js</a>
  97. </p>
  98. </article>
  99. </section>
  100. <script src="../scripts/linenumber.js"></script>
  101. <script src="../scripts/page.js"></script>
  102. </body>
  103. </html>
粤ICP备19079148号