google fonts on localhost

Problems with the Windows version of XAMPP, questions, comments, and anything related.

google fonts on localhost

Postby CherryRed » 20. May 2016 12:56

A newbie question, grateful for help;

I'm creating a joomla site with purity iii template (from joomlart) and am following joomlart instructions to load googlefonts.
I thought I had succeeded.
Then it occurred to me that I have the 2 fonts required (raleway and dancing script) already installed on my computer, I should check what happens if the fonts are not installed locally - to verify that the google fonts would load properly for anyone viewing the site when it goes live.
So I removed fonts from my local machine - and sadly my test site doesn't display with the google fonts.

So my quick question (if it is quick to answer)

Is it that

1) Does running on localhost in itself mean that trying to use google fonts wouldn't work. (Newbie thinking - google fonts are remote and this site is running locally)
2) I myself have done something incorrect during the process (defining fonts in assets.xml etc.... can detail what I did if it helps someone give an answer)

Thank you.
CherryRed
 
Posts: 9
Joined: 01. September 2011 12:30

Re: google fonts on localhost

Postby Nobbie » 20. May 2016 13:07

You are totally wrong here, as this is a plain Google issue. Here is a useful documentation from Google, how to embed the Google fonts into your own documents:

https://developers.google.com/fonts/doc ... ng_started

Of course all these fonts requires online access for your browser, so if you are working on localhost without internet connection, the fonts wont be displayed correctly.

P.S.: I quickly did a small test, i entered the first example into an editor and saved it to a file googlefont.html into my Xampp htdocs folder. I then entered http://localhost/googlefont.html into my browser (Chrome) and it works as designed! No need to download or install any font on my PC.
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Re: google fonts on localhost

Postby CherryRed » 20. May 2016 13:25

Thank you - then it is option 2 - I have done something wrong.
I'm working on localhost but the machine is connected to internet.

Turns out I have 'done it right' with the raleway font, displays correctly (font not installed locally.)
I have not 'done it right' with the dancing script font (possibly because of the 'space' in the font name) which does not display correctly unless font installed locally

It isn't an apache issue so will search elsewhere, sorry for taking up your time
thank you for replying
CherryRed
 
Posts: 9
Joined: 01. September 2011 12:30


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 141 guests