• Resolved Damyan90

    (@damyan90)


    Me again – filling up this forum. ??

    Is there a way to add a custom font to the theme? I am interested in a font called Appetite – it is not part of the standard pack of fonts. I downloaded the font pack and I uploaded it to my database. Then I tried to boot the font with @font-face, but unfortunately it didn’t work.

    Is there some friendly plugin maybe that combines well with the theme? Or maybe I am doing something wrong…

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Archimidis Mertzanos

    (@archimidism)

    Hello @damyan90! No worries that you are asking many thing ,that shows that you are really interested in using and extending our Atlast Business theme.

    Well this question is a really tricky one. Thats because that theme has some Google Fonts embedded and also the stylesheet is written in SASS languange (and then converted to CSS).
    As far as I know there is not plugin to embed a really custom font.

    Embedding a custom webfont is a difficult thing even in the most “professional” -so called- themes. However I could maybe help you.

    I will investigate how to add a custom font even if you are not a developer and write an article at the documentation section. I will be notify you here ok?

    I think in the next 2 days max you will have the tutorial ready.
    Really Kind regards

    ArchimidisM

    Thread Starter Damyan90

    (@damyan90)

    I fixed this myself! First, you need to upload the font file in a folder on your server (I believe it doesn’t matter which folder exactly) Here is the code I used to install a font:

    
    @font-face {
        font-family: 'whatever you want the font to be called';
        src: url( 'the URL of the font e.g. where you uploaded it. ) format('truetype');
        font-weight: normal;
    }
    After you do this, you can use css to boot the font you installed on whatever element you want by using the name you put in font-family.
    So, after installing the font with the code I gave, if you want to change the font in the header menu you do this:
    
    

    selector of the header {
    font-family: ‘the name you used when installing the font’;
    }

    So, here how it all looked for me with both codes:

    
    @font-face {
        font-family: 'Appetite-Italic';
        src: url('https://haha.bg/wp-content/themes/haha-bg-child-theme/fonts/appetite/appetite.ttf') format('truetype');
        font-weight: normal;
    }
    

    to install the font. And then…

    
    body > div.header-image-container > div > h2 {
    	font-family: 'Appetite-Italic'
    }
    

    !!NB!! When putting the font file(s) in your database it needs to be either .ttf or .otf
    Make sure the name of the file is with small letters only. This is why my code didn’t run initially.

    Theme Author Archimidis Mertzanos

    (@archimidism)

    Dear damyan90 you are awesome. I was about to write today a tutorial, and you did it. Kudos!

    Cheers and thanks again!
    ArchimidisM

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Fonts’ is closed to new replies.