Use custom local fonts on Android

Hi, I’m trying to use local fonts on the Android app (Android 10). I have searched a lot to no succes for Android. I have tried to define a @font-face in custom.css with relative path and that work on desktop but not android

 @font-face {
     font-family: "Alegreya Sans";
     src: url("../fonts/Alegreya-sans-webfonts/AlegreyaSans-Medium.woff2") format('woff2');
     font-display: swap;
 }

with a fonts directory in the graph directory I also tried absolute path with not more succes but I’m not sure to do it right since I’not a dev.

I try to use the font defined with something like:

 :root {
   --ct-text-size: 17px;
   --ct-line-height: 1.75;
   --ls-font-family: "Alegreya Sans", sans-serif ;
   --ct-page-title-font-family: var(--ls-font-family);
   --ct-code-font-family: "Victor Mono" , monospace  ;
 }

If I change the font style or size it change on the app but it keep the standard font. If use Inter as a font it use it, but it is built-in as I have seen in the source.

So any ideas on what is wrong or how to do that? Do you use custom font on android and how?

1 Like

I do, but they’re not local files… Following to find a solution too.

@ioth, have you managed to do it?