font-weight rendering differently on desktop browsers vs. iOS browsers - css

I'm using a Google Webfont called Open Sans with font-weight:800 specified for h1 tags. When I view this page on iOS browsers (Chrome and Safari on iPhone or iPad), the font renders more thinly than it renders in desktop browsers. You can see the difference in this screenshot.
I want the font-weight to render the same on all devices, can anyone help me?
My code:
h1 {
font-weight: 800;
font-family: 'OpenSans'
}
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400,600,800' rel='stylesheet' type='text/css'>

I believe you're missing a space here:
font-family: 'Open Sans'

Related

Roboto font in bold weight is invisible

I have a website for internal use that uses the Roboto google font. Here is the code that includes it.
<link href="//fonts.googleapis.com/css?family=Roboto:500" rel="stylesheet" type="text/css">.
&
body {
font-family: "Roboto";
}
b, strong {
font-weight: 700;
}
I've found someone at my company who's Chrome can't render this font when it is bold. I could replicate it by going to Youtube and making Roboto text bold with the inspect element. This problem does not occur on any other computers. The Chrome is up to date and has no extensions installed. I've tried closing and reopening Chrome as well as several hard refreshes. Forcing the browser to repaint with resize, CSS, or JS does not fix the issue either.
This does not dupe question Font Weight with Google Fonts Roboto, normal (400) and bold (700) work, light (300) does not. The problem occurs on both http and https versions of the site, the font is loaded with //, and I get no insecure content warnings from Chrome.
What is causing this, and is there anything I can do on the website or on the persons computer to further troubleshoot or fix this?
If you use Google Fonts
<link href="//fonts.googleapis.com/css?family=Roboto:500" rel="stylesheet" type="text/css">
without a fallback font like;
body {
font-family: "Roboto";
}
b, strong {
font-weight: 700;
}
You should provide that font-weight in your Google Fonts link like;
<link href="//fonts.googleapis.com/css?family=Roboto:500,700" rel="stylesheet" type="text/css">
Or, you should provide a fallback font;
body {
font-family: "Roboto", sans-serif;
}
By doing so, if your browser can't find the font-weight: 700; Roboto font, it can use a suitable sans-serif font from your system.
In ideal situations, using a font-family to support all possible computer systems like;
body {
font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
will solve all of these problems.

#fontface chrome rendering to high

I have some problem with #fontface in Google Chrome. The font is rendered too high.
When I change the font to Arial, the button is allright in all browsers. When I change it to the #fontface font the text jumps up.
Below are 2 images that show the difference between Firefox and Chrome.
What can I do?
I've tried:
-webkit-font-smoothing: antialiased;
Also I added the following for all the fonts right after the font declaration:
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: 'Museo-Sans-Rounded-100-Regular';
src: url('../fonts/Museo-Sans-Rounded-100-Regular.svg') format('svg');
}
}
Both didn't help.
What can I do? All the help is very welcome!
Thanks to Vira for pointing to the right post. The solution can be found here:
#font-face svg not working properly in Chrome?

SVG Web Font Vertical Alignment in Google Chrome

As many of you will be aware when using windows + Chrome + Google fonts they can appear very distorted and choppy. I have implemented a fix which overrides the font with the SVG version of the font hosted on my site's server. So we have something like this:
<link href='http://fonts.googleapis.com/css?family=Oswald:400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css">
The style file containing:
#media screen and (-webkit-min-device-pixel-ratio:0) {
#font-face {
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
src: url('fonts/oswald-regular-webfont.svg#oswaldregular') format('svg');
}
}
This works well for making the font appear smooth and clean like it should. However I have noticed a problem when it comes to the spacing around the font. If I add a background colour and padding to an element using the font, for example:
HTML:
<h1>Oswald Font Test</h1>
CSS:
h1 {
background: purple;
color: #fff;
font-family: 'Oswald';
font-style: normal;
font-weight: 400;
padding: 5px;
}
Then I find that the font in Chrome is not vertically central but instead closer to the top edge of the box. Whereas all the other browsers using the font-styles from Google are centrally aligned.
Question: Can anything be done to correct the alignment of my Google override?
I think the answer may lie in modifying the svg file's attributes, i.e:
<font-face units-per-em="2048" ascent="1638" descent="-410" />

IE 11 doesn't process font declaration correctly

The following font declaration is not working in Internet Explorer 11.
font:300 28px/1.1em 'Lora', arial, sans-serif;
The text is displayed in arial instead of Lora. Lora is a Google Font.
It's working however in Mozilla Firefox, QupZilla and Google Chrome.
But when I change the declaration to
font:300 28px/1.1em 'Lora';
it's working in IE 11.
What could be the problem?
It gets even stranger: When I save the website as an *.html file to my local disc, the font is displayed correctly. :-(
Embed Google font on <head>.
<link href='http://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
and then try below css
.class{
font-family: 'Lora', Arial, sans-serif;
font-weight:400;
font-size:28px/1.1em;
}

Pixel font renders incorrectly in firefox

http://i.stack.imgur.com/zl3iE.png
Can anyone tell me why this pixel web-font is becoming blurred in Firefox? I'm using #font-face to render it using CSS. The font-size is 8px, which is identical to 50%, and it renders perfectly in Chrome; no blurry artifacts. But in Firefox, every other word is blurry.
EDIT: Here is the relevant code snippet:
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css">
<style type="text/css">
#font-face {
font-family: 'pokemon_rbyregular';
src: url('pokemon_rby-webfont.eot');
src: url('pokemon_rby-webfont.eot?#iefix') format('embedded-opentype'),
url('pokemon_rby-webfont.woff') format('woff'), url('pokemon_rby-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-size: 8px;
text-rendering: optimizeSpeed;
}
This works in every other browser except Firefox (incl. Opera, IE8, and Chrome). I am just wondering if there is some sort of CSS text-rendering setting I could implement that would fix this. I have a feeling it is related to how Firefox implements spacing, as it is only every other word. If I have a long paragraph of jumbled letters, they're all rendered perfectly until I put some spaces in-between them.

Resources