The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Some help with Fonts
DaveO
post Nov 1 2022, 04:02 AM
Post #1





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



Hello there and thanks for looking. I am building my online CV which is based on a template. I think i have got it just how I want after modifying it and when i run it locally it looks and works perfectly. When i upload it to my web server here: www.david-oliver.com some of the fonts are missing. For example the body text under 'a few thoughts' section looks to be standard times new roman rather than nice web font which i see locally. Specfically the sentance that starts: 'This must begin with the user or the customer. '

Thank you in advance for any help or suggestions you can offer to make the fonts work on the server.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 04:20 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Have you uploaded the font files? Even if you have, the URLs to them are wrong.

You have this.

CODE
font-family : "librebaskerville-regular";
src : url("../fonts/librebaskerville/librebaskerville-regular-webfont.woff2") format("woff2"), url("../fonts/librebaskerville/librebaskerville-regular-webfont.woff") format("woff");
font-style : normal;
font-weight : normal;


../ means one directory up and there is no directory above the one your base URL leads to. Well, there may be on your server, but seen from outside there isn't.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 1 2022, 04:31 AM
Post #3





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



QUOTE(pandy @ Nov 1 2022, 04:20 AM) *

Have you uploaded the font files? Even if you have, the URLs to them are wrong.

You have this.

CODE
font-family : "librebaskerville-regular";
src : url("../fonts/librebaskerville/librebaskerville-regular-webfont.woff2") format("woff2"), url("../fonts/librebaskerville/librebaskerville-regular-webfont.woff") format("woff");
font-style : normal;
font-weight : normal;


../ means one directory up and there is no directory above the one your base URL leads to. Well, there may be on your server, but seen from outside there isn't.


Thanks yeah i think its correct - that code is in the CSS folder and the fonts are in a 'fonts' folder so the ref is one up - which is how it is all set locally and works fine.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 05:20 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(DaveO @ Nov 1 2022, 10:31 AM) *

Thanks yeah i think its correct - that code is in the CSS folder and the fonts are in a 'fonts' folder so the ref is one up - which is how it is all set locally and works fine.


Yes, but from the web there is no one folder up from http://david-oliver.com/ . That's the top of the file structure as far as the browser is concerned. You may have folders above it on the server, but they aren't accessible from the web. The browser isn't supposed to be able to snoop around the whole server, just what you let it see, and that's the folder your domain lives in and anything below it in the file structure, but nothing above.

If you want your fonts in their own folder, rather create a folder inside your domain's root folder. The URL would then be fonts/librebaskerville/librebaskerville-regular-webfont.woff2 and so on.

See here about relative URLs.
https://htmlhelp.com/faq/html/basics.html#relative-url
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 1 2022, 05:46 AM
Post #5





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



Ok Cool - i understand. I have made the changes (example below) from my fonts.css file and now have a fonts folder both in the root level and in the CSS folder as i wasnt sure where it should go - so i figured wack it in both. Still doesn't seem to work though.

Example from the .css file:

@font-face {
font-family: "montserrat-extralight";
src: url("/fonts/montserrat/montserrat-extralight-webfont.woff2") format("woff2"), url("/fonts/montserrat/montserrat-extralight-webfont.woff") format("woff");
font-style: normal;
font-weight: normal;
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 06:33 AM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



With root folder, do you mean the folder your domain points to, where you have your index.html ? If so it should work.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 06:50 AM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Seems the files aren't where you say they are.

File not found...
http://david-oliver.com/fonts/montserrat/m...ht-webfont.woff

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 1 2022, 09:10 AM
Post #8





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



Hmm - i must be going mad - check this out shows them all sitting there in the fonts folder at the same level as index.html https://www.awesomescreenshot.com/video/121...a89e14831f687c5
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 10:29 AM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Looks right. Hmmm.... blink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 1 2022, 10:35 AM
Post #10





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



since i changed the folder structure it dosent work locally either - i wonder if there is anything i need to change on the server to allow different scripting etc
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 01:19 PM
Post #11


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Did you place them the font files same way on your local machine? Then maybe something is wrong with your CSS after all.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 1 2022, 01:43 PM
Post #12


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



You have errors in main.css- Some of them serious.

https://jigsaw.w3.org/css-validator/validat...ng=&lang=en

Those marked Parse Error will cause the style sheet not to be read after that point. Sad thing is that the styling for the H1 comes before those parse errors, so that can't be it. You should correct the errors anyway.

The styling of the H3 works. So I tried to use the same font for the H1. It didn't work. First I thought that style rule must be overridden by another rule somewhere, but if I type a common font name in, like Verdana, it does work. So that can't be it either.

Wasn't easy this. There's very much of everything there. Not exactly easy to skim through.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 2 2022, 03:38 AM
Post #13





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



Oh wow thank you - ill work through it,
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 2 2022, 05:41 AM
Post #14


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Do that. But alas I don't think it will fix the font problem. I've tried, but I can't figure out what it is.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 2 2022, 09:09 AM
Post #15





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



so just to compare i uploaded the original template instead. All fonts etc look correct so i must have screwed something up. Odd thing is all i did was delete certain divs and modify copy http://david-oliver.com/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 2 2022, 12:31 PM
Post #16


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Haven't you touched the CSS at all?

Well, then I suggest you start over. And change just one thing at the time and check that nothing has screwed up before you change the next thing.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
DaveO
post Nov 3 2022, 03:29 AM
Post #17





Group: Members
Posts: 8
Joined: 1-November 22
Member No.: 28,612



yeah will do, thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 3 2022, 07:36 PM
Post #18


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



Complex templates aren't easy to deal with.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 09:19 PM