Taking Requests: Get your preferred Google Font in the Fordson theme!

Taking Requests: Get your preferred Google Font in the Fordson theme!

Chris Kenniburg發表於
Number of replies: 10
Plugin developers的相片

Hello All,

I am busy prepping the next release of the Fordson theme and need your help.  A brand new feature will be a drop-down for Google Fonts.  If you would like a certain font from the list at google please let me know before the end of the week.  

https://fonts.google.com/

Please reply with the link to the font such as " https://fonts.google.com/specimen/Krona+One "

I'll be checking back here and try to include all the fonts in the drop-down as long as it doesn't get to be too long of a list!

附件 Moodle 3 4  Administration  Appearance  Themes  Fordson.png
評比平均分數:Useful (1)
In reply to Chris Kenniburg

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Gareth J Barnard發表於
Core developers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片

Hi Chris,

I rather like Cabin: https://fonts.google.com/specimen/Cabin.

G

In reply to Chris Kenniburg

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Richard Oelmann發表於
Core developers的相片 Plugin developers的相片 Testers的相片

Hi Chris,

In the past (flexibase) I've done this kind of thing as a free text entry for the font name and another one for the weights/styles where needed, then used that to construct the URL (and the font-family css rule) so that the user - or at least the site administrator as it is a theme setting - can choose any Google font they wanted to and if the font lists (or design tastes) change, I wouldn't have to update the theme every time.

I haven't tried it with Boost yet, but I think it worked quite well in Flexibase

https://developers.google.com/fonts/docs/getting_started#a_quick_example

https://github.com/roelmann/moodle-theme_flexibase

In reply to Richard Oelmann

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Chris Kenniburg發表於
Plugin developers的相片

This would provide the ultimate in flexibility but could also cause some issues if it isn't put in the text field correctly.  I think I had something similar in Pioneer but it was clunky.  

I am stumped on how to add the second part of the font such as serif, sans-serif, cursive, monospace, etc.  

Any ideas on this?


In reply to Chris Kenniburg

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Richard Oelmann發表於
Core developers的相片 Plugin developers的相片 Testers的相片

If you are providing them as a drop down list, then you could use a keyed array as you will know all the variables

$fontsarray(
    fontname1 => fonttypeA,
    fontname2 => fonttypeA,
    fontname3 => fonttypeB,
    fontname4 => fonttypeA,
)

Then you use that as 

$fonttypeforurl = $fontsarray['userselectedfont']
In reply to Chris Kenniburg

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Richard van Iwaarden發表於
Particularly helpful Moodlers的相片

Awwww... you missed my request for PT Sans 傷心


Any hopes for the next realease? 微笑

In reply to Richard van Iwaarden

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Chris Kenniburg發表於
Plugin developers的相片

Hey Richard,

It's still experimental. Some fonts worked well and others seemed to have no impact and I believe that is because of the way I bring them into the theme.   

So, in short... I'm still learning how to best do this. 

Chris

In reply to Chris Kenniburg

Re: Taking Requests: Get your preferred Google Font in the Fordson theme!

Richard van Iwaarden發表於
Particularly helpful Moodlers的相片

OK Thanks! It's not really a problem for me, when I add one line of html to the head section and one line of CSS, I still have the PT Sans.

If I can help with anything just let me know.