• Resolved tedieka

    (@tedieka)


    Hi, is there a tutorial on how to use the local font feature in AMPforWP? I’ve tried uploading the font on the server, and adding a css font face in a custom css like this.

    @ font-face {
      font-family: 'Poppins';
      font-display: swap;
      font-style: normal;
      font-weight: 400;
     src: url ('https://www.urlweb.com/wp-content/uploads/2021/05/poppins-v15-latin-regular.eot');
      src: local (''),
           url ('https://www.urlweb.com/wp-content/uploads/2021/05/poppins-v15-latin-regular.eot?#iefix') format ('embedded-opentype'),
           url ('https://www.urlweb.com/wp-content/uploads/2021/05/poppins-v15-latin-regular.woff2') format ('woff2'),
           url ('https://www.urlweb.com/wp-content/uploads/2021/05/poppins-v15-latin-regular.woff') format ('woff'),
           url ('https://www.urlweb.com/wp-content/uploads/2021/05/poppins-v15-latin-regular.ttf') format ('truetype'),
    }
    body,.cntn-wrp{font-family: 'poppins', sans-serif;}

    But the font still doesn’t load (I tested it through network developer tools and GTMetrix. Am I wrong?

    Thank you in advance

    • This topic was modified 5 years ago by tedieka.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    This tutorial will help you to add local fonts in AMP. Do refer to the following tutorial and let us know back if you need any assistance. https://ampforwp.com/tutorials/article/how-to-add-local-fonts-in-amp/

    Thread Starter tedieka

    (@tedieka)

    Hi, thanks for the tutorial. I’ve followed the tutorial and deleted the css font that I added earlier in the custom css. But it still doesn’t work. Image: https://ibb.co/YhXFfPJ

    The css font-face does appear, but the css font for Body remains unchanged and also no font-display: swap parameter.
    Image:
    https://ibb.co/7YJ4R4G
    https://ibb.co/xz5K2pn

    Any suggestions on this matter?

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    We only add the font-face and if you need to change any font then you need to add css like my-title{font-family=”LOCAL FONT NAME”} and then only it will be added.

    Thread Starter tedieka

    (@tedieka)

    Thanks a lot problem solved now. Turns out I mistyped the font name, it should have been a capital initial but I typed it in lowercase.

    • This reply was modified 4 years, 11 months ago by tedieka.
    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Glad to hear the issue has been resolved. If you have any other queries or the issue, please create a new topic.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Local Fonts’ is closed to new replies.