-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to customize fonts #165
Comments
Hi @novikoffav, In general, we are adding fonts through PHP and then assigning it to a variable in LESS. I've never assigned it through import. What code you are trying to use and what errors do you see? |
Today I tried to change fonts in PHP and in LESS as you described, but I still experience problems - it looks that browser applied some defaul fonts instead of provided by me. In particular, I have changed a line and I also specified fonts in Variables.less: Before that I tried to insert the code dirrectly in the beginning of the file typography.less and this also did not work for me : <style> @import url('https://fonts.googleapis.com/css?family=Montserrat:200,200i,400,400i|Open+Sans:300,300i,400,400i,700,700i'); </style> |
After changing the code in PHP and in LESS, what do you see in the browser's console? Are there any errors? Does this font apply? |
Yeah, nothing related. I've tested and except non-adjusted font sizes, new fonts are displayed correctly.
and replaced variable in LESS as:
Did you do this in a core theme files or through a child theme? As per another question, regarding original fonts, I'm not sure why Cyrillic isn't rendered. @sssoz, I don't see |
This is also confusing -- it is possible that the font was once on Google Fonts (I had made sure that they were all taken from there) but the foundry (in this case, Monotype) decided to change the way it distributes it. Since it was once on there, I’m guessing they kept it on the Fonts API. It looks like Monotype has started charging for that font, which was once free. I figured that linking to the Google Fonts API would be useful, since any updates / improvements made to the font files would be propagated on the OJS instances using that theme... but do you think it would be a better idea to load the font files as part of the theme, in the static assets directory, instead? |
Looks like other people have noticed: google/fonts#1223 (comment)
|
@novikoffav You could create a child theme based on health sciences, disable CDNs and add a less file with the appropriate rules to override the fonts used. |
Not related to this theme, but I found the same problem in defining in the child-theme (Immersion Theme) the inclusion of a new google font. Didn't work. My case reported here: [https://forum.pkp.sfu.ca/t/change-fonts-child-theme/67209/2] |
Hi! I tried to customize fonts in typography.less but without success. I tried to combine google fonts Open Sans and Montserrat using @import url, but it does not work for me.
Would you please provide a code or some instruction how to do this?
The text was updated successfully, but these errors were encountered: