This question is answered.


Permlink Replies: 4 - Pages: 1 - Last Post: 09-Jun-2019 00:44 Last Post By: Roadhouse Threads: [ Previous | Next ]
Roadhouse

Posts: 105
Registered: 22-Dec-2016
Is it possible to add Google fonts to my albums?
Posted: 08-Jun-2019 23:23
 
  Click to reply to this thread Reply
Hi again.

I'm back - and I hope you're all fine!

I have made an attempt to make a website (https://guldberg-lassen.dk) and all the albums are made in jAlbum.

The website template I've found and that I love, is using this font:

"<link href="https://fonts.googleapis.com/css?family=Pathway+Gothic+One&display=swap" rel="stylesheet">"

I would like all fonts to be the same, so when people click on a link that leads them to one of my jAlbums, then it is the same font there. Is it in any way possible embed the Google Pathway font in my albums?

I have one more question, but start a seperate thread about this so it doesn't confuse the topic.

Kind regards

Frank
jGromit

Posts: 7,479
Registered: 31-Jan-2006
Re: Is it possible to add Google fonts to my albums?
Posted: 08-Jun-2019 23:59   in response to: Roadhouse in response to: Roadhouse
 
  Click to reply to this thread Reply
It's possible, but I suspect there's a hidden trap or two lurking in there.

There are two pieces to the puzzle. First, you have to get the album page to load the Google font. So, under Photoblogger > Site > Custom code > HEAD, enter this:
<link href='https://fonts.googleapis.com/css?family=Pathway+Gothic+One&display=swap' rel='stylesheet'>
Then comes the tricky part - getting Photoblogger to use that font for all elements on the page. By default, Photoblogger uses quite a collection of fonts and fallback font stacks. Trying to deal with each of them separately would be laborious, to say the least. So, my instinctive reaction is to force the issue. Under Photoblogger > Site > Custom code > CSS, enter this:
* {font-family: 'Pathway Gothic One', sans-serif !important;}
For now, I've just used "sans-serif" as the fallback font, but you might want to specify a more robust font stack.

What's the catch? I'm not sure about this, but I think that Laza has used fonts in some cases to render things like icons, and this global, forced override will break those. But I may be thinking of another skin....
Roadhouse

Posts: 105
Registered: 22-Dec-2016
Re: Is it possible to add Google fonts to my albums?
Posted: 09-Jun-2019 00:18   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
EDIT: Yes it should - it works too :-) Thank you a lot :)

"It doesn't seem to change the font, but I have to say that I'm definately not a code-guy :-)

Should the * in the "* {font-family: 'Pathway Gothic One', sans-serif !important;}" string be included?"

Edited by: Roadhouse on 09-Jun-2019 00:20
jGromit

Posts: 7,479
Registered: 31-Jan-2006
Re: Is it possible to add Google fonts to my albums?
Posted: 09-Jun-2019 00:28   in response to: Roadhouse in response to: Roadhouse
Correct
  Click to reply to this thread Reply
Roadhouse wrote:
Should the * in the "* {font-family: 'Pathway Gothic One', sans-serif !important;}" string be included?"

Absolutely required. That's a wildcard that says, "Use this font for every CSS selector on the page." The alternative would be to list every one of the selectors that Photoblogger uses, and they're numerous and complicated.
Roadhouse

Posts: 105
Registered: 22-Dec-2016
Re: Is it possible to add Google fonts to my albums?
Posted: 09-Jun-2019 00:44   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I learn something new every time I'm in this fantastic forum - thanks :)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums