How to use the FontLoader function from three

Find comprehensive JavaScript three.FontLoader code examples handpicked from public code repositorys.

129
130
131
132
133
134
135
136
137
138


var sim = {} //used to store sim "global" vars
sim.hi_rez = true

//var THREE_font_loader = new THREE.FontLoader();
var init_simulation_done = false
function init_simulation_maybe(){
    if(init_simulation_done) {}
    else {
fork icon24
star icon38
watch icon12

152
153
154
155
156
157
158
159
160
161
        position[2]*boxSize[2] - deltaZ
    ]
}

// R1 lights
var fontLoader = new THREE.FontLoader();

const materials = [
    new THREE.MeshBasicMaterial( { color: 0x00ff00 } )
];
fork icon26
star icon28
watch icon0

+ 2 other calls in file

203
204
205
206
207
208
209
210
211
212
// eslint-disable-next-line
const { objUrl, mtlUrl, container, obj3d, text3d } = config;
if (obj3d) {
  applyObj3d(obj3d);
} else if (text3d) {
  new THREE.FontLoader().load('https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/fonts/helvetiker_regular.typeface.json',
    (font) => {
      const geometry = new THREE.TextGeometry(text3d, {
        font,
        size: 100,
fork icon1
star icon5
watch icon2

1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
    this.position.set(lx, ly, lz);
    this.lookAt(app.camera.position);
}
// app.scene.add(cube);

var loader = new THREE.FontLoader();
// console.log('loader start');

loader.load('./fonts/helvetiker_regular.typeface.json', function (font) {
    // console.log('loader finished');
fork icon1
star icon1
watch icon0

14
15
16
17
18
19
20
21
22
  canvas: canvas,
});
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera();
const clock = new THREE.Clock();
const loader = new THREE.FontLoader();

camera.far = 50000;
camera.setFocalLength(24);
fork icon0
star icon0
watch icon0

-3
fork icon0
star icon0
watch icon1

+ 3 other calls in file

58
59
60
61
62
63
64
65
66
67
 * @param  {[type]} position [description]
 * @return {[type]}          [description]
 */
export const createLabel = (text, position) => {
        // 暂时不用loader,因为地址本地不好弄
        // var loader = new THREE.FontLoader();
        // 这里模拟loader后的数据
        let font = new THREE.Font(fontData, true);
        let geometry = new THREE.TextBufferGeometry(text, {
                font: font,
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)