Update the documentation & types to show setFontName
See original GitHub issueFYI, for all who want to set separate fonts on the editor, u can do that by providing the font name to
richEditorRef.current?.setFontName('Caveat');
Make sure to supply fonts to the CssText in editorStyle, we can pass fonts as fontFace with base64 encode, so u dont need to keep the font file, instead it can read from base64 code.
<RichEditor
editorStyle={{
cssText: fontFace,
}}/>
where fontFace is similar to something like this
const fontFace = `@font-face {
font-family: 'Allura';
src : base64Code for your font goes here;
}
@font-face {
font-family: 'Caveat';
src : base64Code for your font goes here;
}
`
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top Results From Across the Web
SetFontName Method (IOcrDocumentManager)
Replaces the specific type of font used in the final document. ... Use GetFontName and SetFontName to get/set the fonts used in the...
Read more >Font (POI API Documentation) - Apache POI
Modifier and Type, Field and Description. static byte, ANSI_CHARSET. ANSI character set. static short, COLOR_NORMAL. normal type of black color.
Read more >FAQ Section | Word library
The following code illustrates how to set ligature types for text. ... setFontName("Arial"); //Save and close the document. document.save("Sample.docx", ...
Read more >How to Change Font in HTML
Learn how to use HTML and CSS to change your font type, size, ... In this post, we'll show you how to change...
Read more >Customize or create new styles
Modify a style by updating it to match formatting in your document. If you have text in your document that already has a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m trying to add font by this @Samykills
I have a sample component to test, it look like this
The font file look like this
https://paste.ofcode.org/PiEu7yNrNAbZHLtUHNHUDQ (this too long, i can’t paste here)
Swear i don’t know why it not work !
Please help @Samykills
I work like charm @Samykills