All Credits by wxik.
fixed issue with onChange handler wxik#141
const iOSCustomFontFace = `@font-face {
font-family: 'SFPro';
src: url('https://your-web-server.com/assets/fonts/SFPro/sf-pro-text-regular.ttf?raw=true'),
url('https://your-web-server.com/assets/fonts/SFPro/sf-pro-text-regular.ttf?raw=true');
}
@font-face {
font-family: 'SFProSemi';
src: url('https://your-web-server.com/assets/fonts/SFPro/sf-pro-text-semibold.ttf?raw=true'),
url('https://your-web-server.com/assets/fonts/SFPro/sf-pro-text-semibold.ttf?raw=true');
}`;
<RichEditor
editorStyle={{
initialCSSText: iOSCustomFontFace,
customFontFamily: 'SFPro',
}}
/>;
The Richeditor does not support to add your local font files. But there is a workaround for that.
You can convert your font file to base 64 css style. Just go to https://transfonter.org/.
Important enable Base 64 Encode.