在GWT应用程序中包含谷歌字体的正确方法

时间:2016-11-29 14:25:47

标签: css gwt fonts

我在我的机器上安装了谷歌字体roboto,我也包括

<link href='http://fonts.googleapis.com/css?family=Roboto:regular,medium,bold,thin' rel='stylesheet' type='text/css'>

在welcome.html文件的标记中。

在css文件中我使用的是CSS

.mycss{
font-family: "robotoregular","sans-serif","arial";
font-size: 13px;
}

它在开发模式下工作正常,但是当我在tomcat上部署它时,字体大小比开发模式大2-3px。我不知道它为什么会来。有人可以帮我摆脱这个吗?另外如何在gwt中导入Google字体。

谢谢,

1 个答案:

答案 0 :(得分:2)

首先,它应该是:

font-family: "Roboto", sans-serif;

您可以在GWT html文件中包含Google字体,方法与welcome.html相同。这是Google推荐的链接(当然,您可以选择自己的字体权重):

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
相关问题