Skip to content
Discussion options

You must be logged in to vote

Wow that took some digging into the source code but I was finally able to dynamically load the font. Here's my code snippet:

import { Asset } from "expo-asset";

const assets = await Asset.loadAsync(
  QuranFontAssets.Madinah["QCF4604"] // asset (local/remote) URI
);
const data = await Skia.Data.fromURI(assets[0].localUri!!);
const typeface = Skia.Typeface.MakeFreeTypeFaceFromData(data);
customFontMgr.registerFont(typeface!!, "QCF4604");
const fontx = Skia.Font(typeface!!, 32);
setF(fontx);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BasselAshi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant