google-font-api

locally installed TTF overrides Google fonts

半城伤御伤魂 提交于 2019-11-29 18:16:07
问题 I'm using the Ubuntu font from Google Fonts: <link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,300italic,400italic,500,500italic,700,700italic' rel='stylesheet' type='text/css' /> My stylesheet: body { font-family: 'ubuntu',arial; } It works, but if install a font with the same name (Ubuntu), it overrides the one from Google Fonts. Is it possible to force the browser to use the one from Google Fonts? 回答1: The answer lies not in your code, but in Google's. Here's part of the

Font Weight with Google Fonts Roboto, normal (400) and bold (700) work, light (300) does not

馋奶兔 提交于 2019-11-29 18:07:53
Link: https://50.62.213.246/gktest/ The placeholder text and input text in the search bar will not respond to font-weight: 300; If I try font-weight: 700; the text is bold. normal = 400, light = 300, bold = 700, etc So my question is why does the text not appear light with font-weight: 300; ? Your link uses the https protocol. http vs https - for a protocol agnostic reference, use //fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700|Roboto:400,300,700,500,100 Basically your link uses https but you're referencing the http version of the font. So if you use https - it's a secure

google font make page load very slow in china

懵懂的女人 提交于 2019-11-29 13:16:23
I am using google font on my site. Some clients in china said that the site load very slow. I checked it, it is causing by the google fonts. I looked the google font faq, they said it will download the font file to the customer's computer before loading the site. Are there any way to fixed this slow loading issue? This was a known issue... Google Fonts were slow loading in China. Previously you could serve mirrors of the fonts through Qihoo 360 CDN servers in China. However, as of August 2016 the problem has been fixed . At the same time Qihoo 360 has stopped fonts.useso.com and all mirrored

Does -webkit-font-smoothing only work on Mac browsers, Not windows?

落花浮王杯 提交于 2019-11-29 09:22:31
Does -webkit-font-smoothing properties only work on Mac browsers, Not windows? I'm using a Google font and try to make it smooth in Google Chrome for Windows. I found -webkit-font-smoothing: antialiased; is the solution in Google search but it's not giving any difference on my Google Chrome (Windows) It only works on mac, not windows because windows has a different font rendering method. Source: http://christophzillgens.com/en/articles/-webkit-font-smoothing-reloaded 来源: https://stackoverflow.com/questions/8519768/does-webkit-font-smoothing-only-work-on-mac-browsers-not-windows

CSS: Disable font ligatures in all browsers

萝らか妹 提交于 2019-11-29 09:19:06
As google fonts are blocked in China I had to download them and use FontSquirrel for conversion. The problem: fi/ff/etc are ugly I did all of the steps here Prevent ligatures in Safari (Mavericks/iOS7) via CSS but no cigar. How can I disable ligatures at once? -webkit-font-variant-ligatures: no-common-ligatures; Doesn't work Despite no-common-ligatures you can try values like none , unset or no-contextual . See MDN for all possible values. Also it should be supported in all modern browsers. Essentially the same answer that andreas offered, but here's the full CSS for easy reference: * { font

How can I only use Latin subset with Google Fonts WOFF2 files?

落爺英雄遲暮 提交于 2019-11-29 09:13:51
I wanted to add a font with Google Fonts, and I have noticed an odd behavior. I want to add a font with only the latin subset, I do not want latin-ext, cyrillic or cyrillic-ext subset, in order to lighten the code. I understand that's the default behavior, so I've done like this: <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Philosopher"> In Firefox (and the other browsers that do not support WOFF2), I get a correct output: @font-face { font-family: 'Philosopher'; font-style: normal; font-weight: 400; src: local('Philosopher'), url(http://fonts.gstatic.com/s/philosopher

Google fonts: Define custom name in CSS

匆匆过客 提交于 2019-11-29 07:52:38
Is it possible to define a custom name for Google fonts? Eg. <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> How to use 'Open Sans' with custom name? div { font-family: 'custom'; // to be same as 'Open Sans' } Using @font-face as answered here is not possible, since I don't have url to source files (ttf, eot, woff, ...). Links to source files on Google cdn would solve this issue. This code will work in your case: <style type="text/css"> @font-face { font-family: 'MyCustomOpenSans'; font-style: normal; font-weight: 400; src: local('Open Sans'),

Google Fonts giving: No 'Access-Control-Allow-Origin' header is present on the requested resource

夙愿已清 提交于 2019-11-29 06:54:29
I'm trying to use a google font 'Oswald'. When i embed it into my page in the recommended way : <link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'> Chrome throws the following error: XMLHttpRequest cannot load http://fonts.googleapis.com/css?family=Oswald:400,300,700. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://<<redacted>>' is therefore not allowed access. Is this just a mistake on google's part or am i doing something wrong? Turns out it was a conflict with prefixfree Solution was to add

Does -webkit-font-smoothing only work on Mac browsers, Not windows?

孤街醉人 提交于 2019-11-28 02:50:20
问题 Does -webkit-font-smoothing properties only work on Mac browsers, Not windows? I'm using a Google font and try to make it smooth in Google Chrome for Windows. I found -webkit-font-smoothing: antialiased; is the solution in Google search but it's not giving any difference on my Google Chrome (Windows) 回答1: It only works on mac, not windows because windows has a different font rendering method. Source: http://christophzillgens.com/en/articles/-webkit-font-smoothing-reloaded 来源: https:/

How can I only use Latin subset with Google Fonts WOFF2 files?

那年仲夏 提交于 2019-11-28 02:38:00
问题 I wanted to add a font with Google Fonts, and I have noticed an odd behavior. I want to add a font with only the latin subset, I do not want latin-ext, cyrillic or cyrillic-ext subset, in order to lighten the code. I understand that's the default behavior, so I've done like this: <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Philosopher"> In Firefox (and the other browsers that do not support WOFF2), I get a correct output: @font-face { font-family: 'Philosopher'; font