Hello everyone,
does anybody know if there's a way to upload or embed a font-family locally?
That problem occurs specific for the german market as the GDPR cannot be fulfilled when we just use a link to google fonts to use some fonts.
Unfortunately the link gives some information to google and does not comply with the GDPR.
Is there a way to host the fonts locally as it works for self hosted websites?
Hi @saudali_25, @Fubar,
thanks for your support.
The solution from @saudali_25 works, but I had to change the url a bit.
It seems that the /webfiles/ is not longer needed and supported when using the new power pages.
But that way the font is locally embedded and further GDPR conform. Thanks a lot!
@font-face {
font-family: 'MyCustomFont';
src: url('/customfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
I have used embedded fonts before and as per Saudali's post, you upload the fonts as Web Files, then update the CSS to use the Web Files.
Hi @Lucas001 ,
I have not done it but I'm sure we can do it. Have you tried to upload your font file (e.g., .ttf, .woff, .woff2) in under Web Files? Then in Portal theme or CSS customization, define a @font-face rule to specify the font-family and the URL/relative path of the font files. Here's an example:
@font-face {
font-family: 'MyCustomFont';
src: url('/webfiles/customfont.woff2') format('woff2'),
url('/webfiles/customfont.woff') format('woff'),
url('/webfiles/customfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
You can apply the custom font-family to specific elements or globally in your Power Portals theme or CSS customization. For example:
body {
font-family: 'MyCustomFont', Arial, sans-serif;
}
Thanks,
Saud
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional