I'm using react-reader npm and I cant put my custom font-family in my project. Does anyone know the answer of this ?
Asked
Active
Viewed 282 times
1 Answers
2
import React, { useState,useRef } from "react"
import { ReactReader } from "react-reader"
const App = () => {
const [location, setLocation] = useState(null)
const renditionRef = useRef(null);
return (
<div style={{ height: "100vh" }}>
<ReactReader
location={location}
locationChanged={ (epubcifi)=>setLocation(epubcifi)}
url="https://gerhardsletten.github.io/react-reader/files/alice.epub"
getRendition={(rendition) => {
renditionRef.current = rendition;
renditionRef.current.themes.register('custom', {
p: {
'font-family': `Helvetica`,
},
});
renditionRef.current.themes.select('custom');
}}
/>
</div>
)
}
export default App

Shubham
- 41
- 6
-
what about google fonts? – fatemeh kazemi Nov 23 '21 at 06:47
-
You can use those too. You have to import them first. – Shubham Nov 25 '21 at 14:31