typefaces icon indicating copy to clipboard operation
typefaces copied to clipboard

Create a React hook for more easily working with the typeface API and react-three-fiber

Open johno opened this issue 4 years ago • 0 comments

The hook would automatically request typeface data from the API, return fonts from the font loader, and a text component:

const Demo = () => {
  const { fonts, Text } = useTypeface('recursive')

  return (
    <Canvas>
      <ambientLight />
      <pointLight position={[10, 10, 10]} />
      <Text style="normal" weight={400} color="tomato">Hello, world!</Text>
    </Canvas>
  )
}

johno avatar May 05 '21 17:05 johno