Archived topic
Sorry, you are not allowed to upload this file type.
7 replies · Started by Hywel on October 31, 2022
Hi, was following your guide to adding fonts locally and I keep getting this message...
“life-savers-v18-latin-regular.ttf” has failed to upload.
Sorry, you are not allowed to upload this file type.
Any advice?
Thanks
Hi there,
we provide a snippet in this doc to allow those additional mime types :
https://docs.generatepress.com/article/adding-local-fonts/#uploading-our-font
But ... unless you're doing some custom development with the font, you don't require TTF versions of a google font.
So don't bother uploading them, and remove them from your @font-face CSS.
Hi, I used the snippet provided in that document but it still gives the error.
add_filter( 'upload_mimes', function( $mimes ) {
$mimes['woff'] = 'application/x-font-woff';
$mimes['woff2'] = 'application/x-font-woff2';
$mimes['ttf'] = 'application/x-font-ttf';
$mimes['svg'] = 'image/svg+xml';
$mimes['eot'] = 'application/vnd.ms-fontobject';
return $mimes;
} );
Anyway I uploaded this without the ttf line...
/* life-savers-regular - latin */
@font-face {
font-family: 'Life Savers';
font-style: normal;
font-weight: 400;
src: url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.woff') format('woff'), /* Modern Browsers */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.svg#LifeSavers') format('svg'); /* Legacy iOS */
}
I can see the font under Typography Manager but when I select it it does nothing.
Hi Hywel,
To clarify, when you use Life Saver as a font in the Typography, it doesn't work?
If so, can you provide admin login credentials so we can take a closer look at the issue?
Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
Hi,
To clarify, when you use Life Saver as a font in the Typography, it doesn’t work?
Yes that's correct.
Thanks
Thank you. The links in your @font-face rules seem to be incorrect. Can you go to Media > Library, and re-copy and paste the links of the fonts from there?
Hi,
I have redone the process and It's now working. Which is odd considering it didn't work the previous 4 times I tried! Thanks for your help anyway.
You're welcome Hywel! Glad it's working now!