google-font-api

How do I 'leverage browser caching' for Google fonts?

妖精的绣舞 提交于 2019-11-27 10:07:54
问题 I tested my site via Pingdom and got this: I searched but couldn't find a solution to this. Does anyone know how I can get this 14 to 100? 回答1: Since you cannot control Googles headers (including expiration headers), I can see only one solution – download these two stylesheets and fonts to your own hosting server, change HTML tags accordingly. Then, you can set expiration headers (what Pingdom called 'lifetime') as you wish. For example, open the first link: /* latin */ @font-face { font

Adding google font api to select menu

吃可爱长大的小学妹 提交于 2019-11-27 08:53:16
问题 I am making a select box with all the fonts in google fonts API. I have referred this https://developers.google.com/webfonts/docs/developer_api link to learn more about API but till now i was not able to make it. I am adding this Fiddle which i made for this. HTML <select id="styleFont"> <option value="0">Myraid Pro</option> <option value="1">Sans ref</option> <option value="2">Times New Roman</option> <option value="3"> Arial</option> </select> <br> <textarea id="custom_text"></textarea> CSS

Google Web Fonts and PDF generation from HTML with wkhtmltopdf

耗尽温柔 提交于 2019-11-27 06:13:55
I am using wkhtmltopdf to convert HTML files in PDF format; it gives surprisingly good results, rendering the PDF exactly as WebKit would do. I am using Google Web Fonts to give users the possibility to customize the appearence of the document they edited, offering them the possibility to choose between a few fonts. It also works perfectly in a browser . Problem is, I don't get the Google Fonts working when converting such HTML files to PDF with wkhtmltopdf. I read other people had the same issue . Could anyone please help me fixing this? EDIT : declaring @font-face directly in the CSS does

Google fonts URL break HTML5 Validation on w3.org

孤街醉人 提交于 2019-11-27 02:38:53
I load 3 fonts in different sizes using this HTML tag: <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif"> Till ~1/2 weeks ago this was supported by w3.org validator for HTML5; now it gives this error: Line 14, Column 163: Bad value http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif for attribute href on element link: Illegal character in query: not a URL code point. What's the things the W3C Markup Validator does not like now

How to use Google fonts in React.js?

依然范特西╮ 提交于 2019-11-27 01:17:16
问题 I had built a website with React.js and webpack . I want to use Google fonts in the webpage, so I put the link in the section. Google Fonts <link href="https://fonts.googleapis.com/css?family=Bungee+Inline" rel="stylesheet"> And set CSS body{ font-family: 'Bungee Inline', cursive; } However, it does not work. How can I solve this problem? 回答1: In some sort of main or first loading CSS file, just do: @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:regular,bold,italic

Google Web Fonts and PDF generation from HTML with wkhtmltopdf

两盒软妹~` 提交于 2019-11-26 11:55:23
问题 I am using wkhtmltopdf to convert HTML files in PDF format; it gives surprisingly good results, rendering the PDF exactly as WebKit would do. I am using Google Web Fonts to give users the possibility to customize the appearence of the document they edited, offering them the possibility to choose between a few fonts. It also works perfectly in a browser . Problem is, I don\'t get the Google Fonts working when converting such HTML files to PDF with wkhtmltopdf. I read other people had the same

Google fonts URL break HTML5 Validation on w3.org

家住魔仙堡 提交于 2019-11-26 10:09:47
问题 I load 3 fonts in different sizes using this HTML tag: <link rel=\"stylesheet\" type=\"text/css\" href=\"http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif\"> Till ~1/2 weeks ago this was supported by w3.org validator for HTML5; now it gives this error: Line 14, Column 163: Bad value http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,800,700,400italic|PT+Serif:400,400italic|Bree+Serif for attribute href on element link:

How to host google web fonts on my own server?

守給你的承諾、 提交于 2019-11-26 09:04:45
问题 I need to use some google fonts on an intranet application. The clients may or may not have internet connection. Reading the license terms, it appears that its legally allowed. 回答1: Please keep in mind that my answer has aged a lot. There are other more technically sophisticated answers below, e.g.: neverpanic/google-font-download google-webfont-helper localfont so don't let the fact that this is the currently accepted answer give you the impression that this is still the best one. You can