Rye
import { useRef, useState, useEffect, Fragment } from 'react' import { Canvas, useFrame, useThree } from '@react-three/fiber' import { Stage } from '@react-three/drei' import * as THREE from 'three' import typefaceData from '@compai/font-rye/data/typefaces/normal-400.json' const font = new THREE.FontLoader().parse(typefaceData) export const RyeText = ({ bevelEnabled, bevelOffset, bevelSegments bevelSize, bevelThickness, clearcoat, clearcoatRoughness, color, curveSegments, font, fontSize, height, metalness, reflectivity, roughness, position, text, wireframe, ...props }) => { const mesh = useRef() return ( <mesh {...props} position={position} ref={mesh}> <textGeometry args={[ text, { bevelEnabled, bevelOffset, bevelSize, bevelSegments, bevelThickness, curveSegments, font, height, size: fontSize, }]} /> <meshPhysicalMaterial color={color} clearcoat={clearcoat} clearcoatRoughness={clearcoatRoughness} metalness={metalness} reflectivity={reflectivity} roughness={roughness} wireframe={wireframe} /> </mesh> ) } const Component = () => { return ( <Canvas> <Stage contactShadow={true } contactShadowOpacity={0.2} contactShadowBlur={1.5} environment="city" intensity={1} preset="rembrandt" > <RyeText bevelEnabled={true} bevelOffset={0} bevelSegments={32} bevelSize={1} bevelThickness={4} clearcoat={0.2} clearcoatRoughness={0.2} color="#f325f6" curveSegments={32} font="Rye" fontSize={16} height={0.2} metalness={0.2} reflectivity={0.5} roughness={1} position={[0,0,0]} text="Rye" wireframe={false} /> </Stage> </Canvas> ) } export default Component
Typeface data
Installation
yarn add @compai/font-rye
Category
display
Font stack CSS
body { fontFamily: "rye", display; }
Variants
Font source
Source code
/docs/typefaces/tree/main/packages/font-ryeAPI endpoint
/api/v1/typefaces/ryeCopyright
{
"font": {
"name": "Rye",
"category": "display",
"lastModified": "2022-04-27",
"subsets": [
"latin",
"latin-ext"
],
"unicodeRange": {
"latin": "U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",
"latin-ext": "U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF"
},
"version": "v13",
"fontStack": "\"rye\", display",
"source": "google"
},
"variants": {
"normal": {
"400": {
"local": [],
"url": {
"eot": "https://fonts.gstatic.com/s/rye/v13/r05XGLJT86YzH57p.eot",
"svg": "https://fonts.gstatic.com/l/font?kit=r05XGLJT86YzH57q&skey=18b6854fa95116ab&v=v13#Rye",
"ttf": "https://fonts.gstatic.com/s/rye/v13/r05XGLJT86YzH57o.ttf",
"woff": "https://fonts.gstatic.com/s/rye/v13/r05XGLJT86YzH57r.woff",
"woff2": "https://fonts.gstatic.com/s/rye/v13/r05XGLJT86YzEZ7t.woff2",
"json": "https://components.ai/api/v1/typefaces/rye/normal/400"
}
}
}
}
}