[Resolved] Adding Custom Fonts to the Theme

Home Forums Support Adding Custom Fonts to the Theme

  • This topic has 3 replies, 2 voices, and was last updated 4 months ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1300383
    Kumari

    Hi There

    I am trying to add custom fonts to my theme.
    I should mention that I am not using a child theme.
    I did read and follow instructions as set out here: https://docs.generatepress.com/article/adding-local-fonts/

    I am using a custom font which I’ve converted online:
    /* font converted using font-converter.net. thank you! */
    @font-face {
    font-family: “Baseticatrial-Thin”;
    src: url(“./fonts/BaseticaTrial-Thin.eot”); /* IE9 Compat Modes */
    src: url(“./fonts/BaseticaTrial-Thin.eot?#iefix”) format(“embedded-opentype”), /* IE6-IE8 */
    url(“./fonts/BaseticaTrial-Thin.otf”) format(“opentype”), /* Open Type Font */
    url(“./fonts/BaseticaTrial-Thin.svg”) format(“svg”), /* Legacy iOS */
    url(“./fonts/BaseticaTrial-Thin.ttf”) format(“truetype”), /* Safari, Android, iOS */
    url(“./fonts/BaseticaTrial-Thin.woff”) format(“woff”), /* Modern Browsers */
    url(“./fonts/BaseticaTrial-Thin.woff2”) format(“woff2”); /* Modern Browsers */
    font-weight: normal;
    font-style: normal;
    }

    I’ve downloaded all the font files and uploaded to:
    public_html/wp-content/themes/generatepress/fonts

    My question is do I use the above css from font-face and which url should I use?

    Thanking you in advance

    #1300512
    David
    Staff
    Customer Support

    Hi there,

    that CSS looks correct.
    I would suggest you include the FULL URL for each of the font types.

    #1300893
    Kumari

    That worked perfectly! Thank you so much

    #1301532
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.