facetype.js
facetype.js copied to clipboard
no "unitsPerEm"
18dbc473-e0ee-4a46-be7d-32356ec82272:35 Failure loading font http://localhost:3000/fonts/RobotoMonoBold.json; trying fallback TypeError: Cannot read properties of undefined (reading 'unitsPerEm')
same issue
If you are using r3f, its no need to convert to json type font, you can use ttf or other file type. for example:
<Text font={'/fonts/PangMenZhengDaoBiaoTiTiMianFeiBan-2.ttf'} rotation={[-Math.PI / 3, 0, 0 ]} position={[PLANE_WIDTH / 2 - 20 , PHYS_Y + 2, PLANE_HEIGHT / 2 - 5 ]} fontSize={5} color="#fff">123</Text>