Created
February 12, 2016 20:31
-
-
Save pjanik/49c03c02c66341a26904 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load font file to string. | |
import fontDef from 'raw!three/examples/fonts/helvetiker_regular.typeface.js'; | |
// Load font in a sync way, using webpack raw-loader. Based on async THREE JS loader: | |
// https://github.com/mrdoob/three.js/blob/ddab1fda4fd1e21babf65aa454fc0fe15bfabc33/src/loaders/FontLoader.js#L20 | |
let font = new THREE.Font(JSON.parse(fontDef.substring(65, fontDef.length - 2))); | |
let geometry = new THREE.TextGeometry(txt, { | |
size: 50000000 * c.SF, | |
height: 1000000 * c.SF, | |
font: font | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment