Site logo

Archived topic

Installing own font does not work

7 replies · Started by Michiel on February 4, 2020

Viewing posts 1–8 of 8

Hi there,

I purchased a font (Linotype Didot) and followed all the instructions on
https://docs.generatepress.com/article/adding-local-fonts/

I used FilleZilla to place the fonts in my uploads directory
http://dev2.ontwerppartners.nl/wp-content/uploads/2020/01

(They don't show up in my media library)

Next I changed CSS and added:

@font-face {
font-family: Linotype-Didot;
font-style: normal;
font-weight: 400;
src: url('http://dev1.ontwerppartners.nl/wp-content/uploads/2020/01/3AF15D_0_0.eot');
src: local('Linotype-Didot'), local ('Linotype-Didot'),
url('http://dev2.ontwerppartners.nl/wp-content/uploads/2020/01/3AF15D_0_0.eot') format('embedded-opentype'), /* IE6-IE8 */
url('http://dev2.ontwerppartners.nl/wp-content/uploads/2020/01/3AF15D_0_0.woff2') format('woff2'), /* Super Modern Browsers */
url('http://dev2.ontwerppartners.nl/wp-content/uploads/2020/01/3AF15D_0_0.woff') format('woff'), /* Modern Browsers */
url('http://dev2.ontwerppartners.nl/wp-content/uploads/2020/01/3AF15D_0_0.ttf') format('truetype'), /* Safari, Android, iOS */
}

Next I changed gereate-fonts.php and added:

add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Linotype-Didot';

return $fonts;
} );

Back in the customizer I now can select Linotype-didot.
But... where the font is used (in the header-element on home) there is now a blank space...

i just tried the same - for me the error was in the url. From what i see you have dev1 and dev2 in the urls. Maybe thats a mistake - but you should check. If i remember right i had http instead of https.

Hello Matthias, thanks for this and indeed, I have used both dev1 and dev2. I have adjusted the CSS to dev2, unfortunately this gives no improvement and I don't see the font appearing yet.

Kind regards, Michiel.

Hi there,

could be the font name - try this:

font-family: 'DidotLTStd-Roman';

out of curiosity i checked how the font looks on fonts-adobe. If i looked at the right one - on the bottom it says:
font-family: linotype-didot, serif;
font-style: normal;
font-weight: 400;

So maybe also try the name without capitalization.

Hi David,

We're almost ready, it shows on most of the browser accept in Chrome on my MAC. But when I tell Safari to behave like Chrome on a MAC, it is also shown

Did you update the filter ? ie

add_filter( 'generate_typography_default_fonts', function( $fonts ) {
    $fonts[] = 'DidotLTStd-Roman';

    return $fonts;
} );

And made sure that was selected in the Customizer

david may know this better (i am only a trial and error user) - but this doesn't ring a bell for me. I added it to functions.php of my childtheme.
"Next I changed gereate-fonts.php and added:"

This archived topic is closed to new replies.