Graphics Reference
In-Depth Information
Parameter
Description
If you've set
bevelEnabled
to
true
, it defines how high the
bevel is.
bevelSize
This is the weight of the font (normal or bold).
weight
This is the name of the font to be used.
font
When an array of materials is provided, this should contain
the index of the material to be used for the front.
material
extrudeMaterial
When an array of materials is provided, this should contain
the index of the materials to be used for the side.
When you create
THREE.TextGeometry
, Three.js internally uses
THREE.ExtrudeGeometry
to create the 3D shapes.
THREE.ExtrudeGeometry
works by taking a 2D shape and extrudes it along the
Z
axis to make it 3D. To
create a 2D shape from a text string, Three.js uses the JavaScript files that we in-
cluded in the
Getting ready
section of this recipe. These JavaScript files, based on
http://typeface.neocracy.org/fonts.html
,
allow you to render text as 2D paths, which
we then can convert to 3D.
There's moreā¦
If you want to use a different font, you can convert your own fonts at
ht-
tp://typeface.neocracy.org/fonts.html
.
All you need to do to use these fonts is include
them on your page and pass in the correct
name
and
style
values as parameters
to
THREE.TextGeometry
.