H1 Font Weight displays different on WordPress Staging Site - html

There is something that I am not seeing that I could use some help on.
The CSS for the H1 tag on this site: www.californiacounselgroup.com is what I'm trying to put on the staging site. If you look at "Fixed-Fee Legal Service" on the live site, the text is thin (300 weight).
If you look at the same text on the staging site, it is different. http://calcou.01hearts.com/ .
I've cleared cache, tried two browsers and inspected element. I've checked that the "Lato" Google Font is loaded into the theme options the same.
What's am I not seeing here? Any help would be appreciated.
Teresa

Looking at the headers being sent to Google fonts It doesn't appear that you are actually pulling the font weight of 300. I'm only seeing 400, 700 in both regular and italic.
This is how the header parameters are being pulled:
#font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v11/1YwB1sO8YE1Lyjf12WNiUA.woff2) format('woff2');
}
#font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 700;
src: local('Lato Bold'), local('Lato-Bold'), url(http://fonts.gstatic.com/s/lato/v11/H2DMvhDLycM56KNuAtbJYA.woff2) format('woff2');
}
#font-face {
font-family: 'Lato';
font-style: italic;
font-weight: 400;
src: local('Lato Italic'), local('Lato-Italic'), url(http://fonts.gstatic.com/s/lato/v11/PLygLKRVCQnA5fhu3qk5fQ.woff2) format('woff2');
}
#font-face {
font-family: 'Lato';
font-style: italic;
font-weight: 700;
src: local('Lato Bold Italic'), local('Lato-BoldItalic'), url(http://fonts.gstatic.com/s/lato/v11/HkF_qI1x_noxlxhrhMQYEFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
}
Try making sure you're actually pulling font weight 300 from Google.

Related

How do I import local fonts async?

I have recently started hosting the few fonts I use for my website localy. Before I did that I was loading them from google fonts asyn to avoid loading blocking but now I'm not sure how to go about it.
Syntax in HTML before:
<link rel="import" href="//fonts.googleapis.com/css2?family=Titillium+Web:wght#300;400;600&display=swap" async>
Syntax in CSS after:
#font-face {
font-family: "Titillium Web";
src: url("../fonts/titillium-web-300.woff2") format('woff2');
font-weight: lighter;
font-style: normal;
font-display: swap
}
#font-face {
font-family: "Titillium Web";
src: url("../fonts/titillium-web-400.woff2") format('woff2');
font-weight: normal;
font-style: normal;
font-display: swap
}
#font-face {
font-family: "Titillium Web";
src: url("../fonts/titillium-web-600.woff2") format('woff2');
font-weight: bold;
font-style: normal;
font-display: swap
}
Just using swap still causes blocking(chaining critical requests):
so I need to load fully async like before somehow. I haven't found a way to load async in CSS and I'm not sure how to properly define the fonts while using HTML loading. What can I do?

The font is not connected locally

I downloaded the font to my computer Facon
This is how the connection works:
#font-face {
font-family: 'Facon';
src: local('Facon'),
url('../fonts/facon.woff2') format('woff2'),
url('../fonts/facon.woff') format('woff');
font-weight: 700;
font-style: italic;
font-display: swap;
}
But this does not work like this:
#font-face {
font-family: 'Facon';
src: local('Facon'),
local('Facon-Bold-Italic'),
url('../fonts/facon.woff2') format('woff2'),
url('../fonts/facon.woff') format('woff');
font-weight: 700;
font-style: italic;
font-display: swap;
}
Facon has only bold and italic styles in one file
Do I need to use the second line local() or not?
Try this https://www.w3schools.com/css/css_font_google.asp
This might help.
Do not install fonts & try to use google fonts

Can anybody get these two fonts work as Webfont? I use almost webfont generator services but none works

I have tried many times to generate or convert these two fonts into webfont but they are not working. I try almost webfont services found in Google search result but none works. Here are the fonts:
1) NotoSerifLao-Regular https://www.dropbox.com/s/a4e5jfwy5umlj41/NotoSerifLao-Regular.ttf?dl=0
2) NotoSerifLao-SemiBold https://www.dropbox.com/s/2x84v1acibga5iu/NotoSerifLao-SemiBold.ttf?dl=0
This webfont generator service https://www.fontsquirrel.com doesn't work at all but this service https://fontie.pixelsvsbytes.com works only with NotoSerifLao-Regular (the first one) but doesn't work with NotoSerifLao-SemiBold (the second one). I don't understand why it doesn't work with the second one, but the first one. I have these two fonts in my computer and they both work fine in MS Office.
I place the generated/converted fonts in a child theme like this:
-----fonts (folder)
child-theme}
-----css (folder)
So the path in my css looks like this:
#font-face {
font-family:'Noto Serif Lao';
src: url('fonts/Noto Serif Lao Regular.eot');
src: url('fonts/Noto Serif Lao Regular.eot?#iefix') format('embedded-opentype'),
url('fonts/Noto Serif Lao Regular.woff2') format('woff2'),
url('fonts/Noto Serif Lao Regular.woff') format('woff'),
url('fonts/Noto Serif Lao Regular.ttf') format('truetype'),
url('fonts/Noto Serif Lao Regular.svg#Noto Serif Lao Regular') format('svg');
font-weight: 400;
font-style: normal;
font-stretch: normal;
unicode-range: U+0020-00A0;
}
The above code is the example of the first font generated from this service fontie.pixelsvsbytes.com. And it works. As I said, this website works only with the first font, not the second one. The paths are same and correct. No errors found in chrome. I've tried other webfont generator services but they don't work at all. Could you please tell me how to get these two fonts work as webfont? Or if you know other webfont generator websites, please let me know. But I've tried almost all found in Google, none works. I've shared the fonts via Dropbox. You can download and test them.
With webfonts (and really any font in general) the bold and italic and other variations are actually separate files that need to be loaded. So if you're using regular, bold, italic, and bold italic, you would need to load four separate files.
Google fonts
Just like with self-hosted, you have to explicitly tell Google fonts to get all of the weights and variants you want. You do that in the little box where you get the embed code. Click on the 'Customize' tab, and choose the variations you want.
Here are some examples. I'm using the #import option here, which you'd just drop into your stylesheet, but the pattern is the same for the standard link tag.
By default, it only includes the regular weight:
#import url('https://fonts.googleapis.com/css?family=Noto+Serif');
If you want regular and bold, it looks like this:
#import url('https://fonts.googleapis.com/css?family=Noto+Serif:400,700');
And if you want italics for both of those, you'd add those too:
#import url('https://fonts.googleapis.com/css?family=Noto+Serif:400,400i,700,700i');
Self-Hosted
In your code above it looks to me like you need to define the semibold font. If the CSS above is complete, it only defines the regular weight. The paths to the semibold versions need to be defined in another #font-face directive, with the font-weight set differently. It should probably look something like this:
#font-face {
font-family:'Noto Serif Lao';
src: url('fonts/Noto Serif Lao Regular.eot');
src: url('fonts/Noto Serif Lao Regular.eot?#iefix') format('embedded-opentype'),
url('fonts/Noto Serif Lao Regular.woff2') format('woff2'),
url('fonts/Noto Serif Lao Regular.woff') format('woff'),
url('fonts/Noto Serif Lao Regular.ttf') format('truetype'),
url('fonts/Noto Serif Lao Regular.svg#Noto Serif Lao Regular') format('svg');
font-weight: 400;
font-style: normal;
font-stretch: normal;
}
#font-face {
font-family:'Noto Serif Lao';
src: url('fonts/Noto Serif Lao Semibold.eot');
src: url('fonts/Noto Serif Lao Semibold.eot?#iefix') format('embedded-opentype'),
url('fonts/Noto Serif Lao Semibold.woff2') format('woff2'),
url('fonts/Noto Serif Lao Semibold.woff') format('woff'),
url('fonts/Noto Serif Lao Semibold.ttf') format('truetype'),
url('fonts/Noto Serif Lao Semibold.svg#Noto Serif Lao Semibold') format('svg');
font-weight: 700;
font-style: normal;
font-stretch: normal;
}
Working versions
Google Fonts
This one only uses regular and bold, without the italics. But you can set the #import directive to bring in whatever you need for the project. Just be careful to only load what you need, since lots of font files can slow down your site.
#import url('https://fonts.googleapis.com/css?family=Noto+Serif:400,700');
#import url(//fonts.googleapis.com/earlyaccess/notosanslao.css);
#import url(//fonts.googleapis.com/earlyaccess/notoseriflao.css);
h1 { font-family: sans-serif; margin: 0; }
h1.noto { font-family: 'Noto Serif', sans-serif; font-weight: 400; }
h1.bold { font-weight: 700; }
h1.lao { font-family: 'Noto Serif Lao'; font-weight: 400; }
h1.lao-bold { font-family: 'Noto Serif Lao'; font-weight: 700; }
h1.sans-lao { font-family: 'Noto Sans Lao'; font-weight: 400; }
h1.sans-lao-bold { font-family: 'Noto Sans Lao'; font-weight: 700; }
<h1 class="lao">ຕົວອັກສອນລາວ</h1>
<h1 class="lao-bold">ຕົວອັກສອນລາວ</h1>
<h1 class="sans-lao">ຕົວອັກສອນລາວ</h1>
<h1 class="sans-lao-bold">ຕົວອັກສອນລາວ</h1>
<h1 class="noto">Noto Serif Lao</h1>
<h1 class="noto bold">Noto Serif Lao Semibold</h1>
Self-hosted
For the self-hosted I only specified the TTF version since that's what you supplied above. I just used the Dropbox links for this demo, but you can swap them out for your specific paths. If you want to include other font formats (.woff, .svg, etc) you'll need to make sure you have separate files for all of those, for both weights.
font-face {
font-family:'Noto Serif Lao';
src: url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-regular-webfont.woff2') format('woff2'),
url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
font-stretch: normal;
unicode-range: U+0E80-0EFF;
}
#font-face {
font-family:'Noto Serif Lao';
src: url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-bold-webfont.woff2') format('woff2'),
url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-bold-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
font-stretch: normal;
unicode-range: U+0E80-0EFF;
}
.lao {
font-family: 'Noto Serif Lao';
font-weight: 400;
}
.lao-bold {
font-family: 'Noto Serif Lao';
font-weight: 700;
}
<h1>No font: ຕົວອັກສອນລາວ</h1>
<h1 class="lao">Regular: ຕົວອັກສອນລາວ</h1>
<h1 class="lao-bold">Bold: ຕົວອັກສອນລາວ</h1>
I've worked on this some more and I found a couple of things.
It looks like the unicode ranges you were using are wrong. Lao characters have a unicode range of 0E80-0EFF.
Some of the font converters like to strip out non-latin characters, so that could be causing some issues as well. You need to make sure there's no subsetting, or that you've specified the Lao characters in the subset. I converted these with FontSquirrel and chose the Expert option with no subsetting. A similar issue was discussed in this question.
It looks like there may still be some spacing issues, but you'd be a better judge of that.
#font-face {
font-family: 'Noto Serif Lao';
src: url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-regular-webfont.woff2') format('woff2'),
url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
font-stretch: normal;
unicode-range: U+0E80-0EFF;
}
#font-face {
font-family: 'Noto Serif Lao';
src: url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-bold-webfont.woff2') format('woff2'),
url('https://nwalton3.github.io/fonts/noto/noto-serif-lao/notoseriflao-bold-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
font-stretch: normal;
unicode-range: U+0E80-0EFF;
}
.lao {
font-family: 'Noto Serif Lao', sans-serif;
font-weight: 400;
}
.lao-bold {
font-family: 'Noto Serif Lao', sans-serif;
font-weight: 700;
}
<h1 class="lao">Regular: ຕົວອັກສອນລາວ</h1>
<h1 class="lao-bold">Bold: ຕົວອັກສອນລາວ</h1>

How do I specify that "bold" should be "Avenir Heavy" not "Avenir Black"?

I need to send HTML-formatted email using the Avenir font (if it's present in the OS). Two of this font's weights are Heavy and Black (the latter being the heaviest weight). I want mail clients to use Avenir Heavy for bold text, but they're using Avenir Black instead.
In my HTML I have a <style type="text/css"> tag with:
body {
font-family: Avenir, Helvetica, Arial, sans-serif;
}
.font_h1 {
font-weight: bold;
}
When I open my HTML file in a desktop browser (Firefox, Chrome, or Safari), it uses Avenir Heavy as the bold font. But when I email it and view it in Mac Outlook 2016 or in iOS 10's Mail client, those display the bold font with Avenir Black, which is a much heavier font. Same thing happens if I specify the font-weight as bolder.
Oddly, if I say:
body {
font-family: Avenir Heavy;
}
then the page is still rendered by desktop browsers with Avenir Medium, with Avenir Heavy used for bold.
I don't think that #font-face is my answer, because I'm not loading a font from a URL.
How can I tell the browser or mail client to specifically use Avenir Heavy as the bold weight?
I declare Avenir like this:
#font-face {
font-family: 'Avenir';
font-weight: 300;
font-style: normal;
src: local('Avenir Book'), local('Avenir-300'),
url('../../assets/fonts/Avenir-Book/Avenir-Book.eot') format('embedded-opentype'),
url('../../assets/fonts/Avenir-Book/Avenir-Book.woff') format('woff'),
url('../../assets/fonts/Avenir-Book/Avenir-Book.ttf') format('truetype');
}
#font-face {
font-family: 'Avenir';
font-weight: 500;
font-style: normal;
src: local('Avenir Medium'), local('Avenir-500'),
url('../../assets/fonts/Avenir-Medium/Avenir-Medium.eot') format('embedded-opentype'),
url('../../assets/fonts/Avenir-Medium/Avenir-Medium.woff') format('woff'),
url('../../assets/fonts/Avenir-Medium/Avenir-Medium.ttf') format('truetype');
}
#font-face {
font-family: 'Avenir';
font-weight: 700;
font-style: normal;
src: local('Avenir Heavy'), local('Avenir-700'),
url('../../assets/fonts/Avenir-Heavy/Avenir-Heavy.eot') format('embedded-opentype'),
url('../../assets/fonts/Avenir-Heavy/Avenir-Heavy.woff') format('woff'),
url('../../assets/fonts/Avenir-Heavy/Avenir-Heavy.ttf') format('truetype');
}
#font-face {
font-family: 'Avenir';
font-weight: 900;
font-style: normal;
src: local('Avenir Black'), local('Avenir-900'),
url('../../assets/fonts/Avenir-Black/Avenir-Black.eot') format('embedded-opentype'),
url('../../assets/fonts/Avenir-Black/Avenir-Black.woff') format('woff'),
url('../../assets/fonts/Avenir-Black/Avenir-Black.ttf') format('truetype');
}
And then in CSS:
body {
font-family: Avenir, Helvetica, Arial, sans-serif;
}
h1 {
font-weight: 900; // black
}
h2 {
font-weight: 700; // heavy
}
h3 {
font-weight: 500; // medium
}
...
I think you need to explicitly open the font (using a font processing app, such as fontforge) and check which family it belongs to. Then use that family name and you'll be home safe. Also, if you want to be precise about your weights, use numbered values such as
400 for normal
700 for bold
900 for black
etc.

Why is the text sometimes showing, sometime not in the webpage?

I have this layout i'm working on, and the text sometime doesn't show. But if i refresh it a few times, it shows.
The Chrome console output is:
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
And only this, so, no 404, no 503, no 500, no errors at all.
So, i'm using some web fonts, still, they're local, here is my font-face:::
#font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(../font/OpenSans.woff) format('woff');
}
#font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(../font/OpenSans-Bold.woff) format('woff');
}
And i have absolutely no idea why this is happening, someone might have run into something like this already... so...