18

Is there a way to use a google font and have it load only [A-Z] and the & ampersand character?

I would like to do this to reduce size and improve load time, since I will only use basic latin numbers and letters.

I can host the font myself if I must and it is legal to manipulate the font package, but am not sure if self-hosting is necessary and how to manipulate google's font package.

I have specified A-Z like this:

http://fonts.googleapis.com/css?family=Inconsolata&text=ABCDEFGHIJKLMNOPQRSTUVWXYZ

but specifying & is troublesome. Both of these don't work:

<link href='http://fonts.googleapis.com/css?family=Inconsolata&text=ABC&amp;' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Inconsolata&text=ABC&' rel='stylesheet' type='text/css'>
4

2 に答える 2

27

Google フォントを含める場合、文字範囲を指定する方法はありません。これを行う唯一の方法は、次のように各文字を指定することです。

http://fonts.googleapis.com/css?family=Inconsolata&text=ABCDEFGHIJKLMNOPQRSTUVWXYZ
于 2013-09-20T00:25:19.040 に答える