Tagged: add font, custom font, font
-
AuthorPosts
-
April 14, 2016 at 4:09 pm #614058
Hi.
Please read this carefully!i have read all topics about adding custom font to enfold theme. adding Google font or Custom self hosted font. i am familiar with Font face and i can generate font face from my self hosted font and use it in quick css or add it to custom.css but in this way i have a problem that is described as below:
my second language of website is Persian and ENFOLD theme support persian language files (.po, .mo) but google fonts added to enfold are arabic and there is a few standard Persian fonts for web. in the above method i must change any header, menu. shortcode and anything that use default fonts to my self hosted font that is not Good way!!! so when i used layout builder to make pages i need to add qustom css codes to load my owned fonts in layout builder elements such as icon list, captions and etc.
in this way i must setup new css file for all of the font-families that is used in original enfold theme.i need a method to add my self hosted font into font selection dropdown in enfold settings to change fonts to any desired section simply.
if there is not any method can i send the fonts for enfold team to add them into Enfold for all persian users.what is your solution?
thank you.
April 18, 2016 at 9:19 am #616197Hi Bahar!
Thank you for using Enfold.
Set the font family in the body tag:
html[lang="fa-IR"] body { font-family: 'Custom Font', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif; }
It will affect almost any elements in the theme excluding the heading tags. And it will only affect pages in the persian language.
Regards,
IsmaelApril 18, 2016 at 9:51 am #616225Hi Ismael,
thank you for your reply.
i will add this to custom.css style sheet. and everything was ok. but i need a few changes.
i want to load Persian fonts only in the Persian language. this means custom.css will load my fonts if the site language is another. how can i load or make any css file to load only in Persian language? same as RTL.css behavior.
and second: if i want to set font family to headings and etc how can i use [lang=”fa-IR”] in my styles to exclude other languages from change effects?
for example can i use this code:html[lang=”fa-IR”] h1,h2,h3 {
font-family: ‘Custom Font’, ‘HelveticaNeue’, ‘Helvetica Neue’, Helvetica, Arial, sans-serif;
}thank you
April 19, 2016 at 3:59 pm #617506September 10, 2016 at 5:51 am #684419Hi Bahar,
Page body in RTL languages have an “rtl” class so you can use ‘rtl’ class for element parents in css.
But guys my client wants to change fonts in admin panel enfold settings anytime he wants, is there any solution to do this?September 11, 2016 at 9:14 am #684697 -
AuthorPosts
- You must be logged in to reply to this topic.