Search code examples
wordpressfontsarabicarabic-supportpolylang

Installing Arabic fonts on Wordpress


I am trying to installed Arabic Fonts on my website. Following are the steps that I have already taken but the fonts are not being changed.

  1. I uploaded the font files (Converted to webfonts and uploaded on website)
  2. Installed the fonts:

@font-face {
    font-family: 'jf_flatregular';
    src:url('fonts/jf-flat-regular-webfont.ttf') format('ttf'), 
	url('fonts/jf-flat-regular-webfont.woff2') format('woff2'),
         url('fonts/jf-flat-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}
html[lang="ar"] body {
    font-family: 'jf_flatregular';
}

The fonts of the website are changed to safe fonts i.e. Open Sans but my uploaded font is not being loaded on the website.

Notes: 1. Using Jupiter theme 2. Using Polylang plugin

Any help is appreciated. Thank you


Solution

  • I installed another plugin "Use any font" and the applied that font on the Arabic website by the following code:

    :lang(ar)   {
    font-family: fontname !Important;
    }
    

    And done!

    I found this solution, not sure if that should be done or not, but solved my issue. :)