android - Android 设备上的 Times New Roman

标签 android css webfonts

我正在为我的客户构建一个使用 Times New Roman 字体的网站。

除 Android 设备(手机、平板电脑)外,一切似乎都运行良好。 Android 没有可用的 Times New Roman 字体。据我所知,您只能使用 Droid Serif 字体,它的外观与 Times 不同。除此之外,字体大小也不同并导致很多对齐问题。

有什么方法可以使用 Times New Roman for Android 吗?我知道 fontface,但没有任何可用于 Times New Roman 的免费网络字体。也许有一个(可接受的)等价物?

提前致谢!

最佳答案

CSS

@font-face {
    font-family: 'Times New Roman';
    src: url(LiberationSerif-Regular.ttf) format('truetype');
}
@font-face {
    font-family: 'Times New Roman';
    src: url(LiberationSerif-Italic.ttf) format('truetype');
    font-style: italic;
}
@font-face {
    font-family: 'Times New Roman';
    src: url(LiberationSerif-Bold.ttf) format('truetype');
    font-weight: bold;
}
@font-face {
    font-family: 'Times New Roman';
    src: url(LiberationSerif-BoldItalic.ttf) format('truetype');
    font-style: italic;
    font-weight: bold;
}

Download the Liberation Serif .ttf font ,解压缩并将文件移动到 webroot。 您可以更改@font-face 源网址并将字体移动到任何您想要的位置。

关于android - Android 设备上的 Times New Roman,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19447990/

相关文章:

html/css 网格匹配每列的内容宽度

android - 广告错误 "required xml attribute adsize was missing"的 admob xlmns 设置

android - 时代广场和今天的约会

android - 向 VR 窗口指向的方向移动

javascript - 如何在 Open Layers 3 中使用一个不透明度 slider 为三层创建不透明度?

css - 添加 margin-left :10px; 后文本被推离屏幕

android - InetAddress.getByName 导致 NetworkOnMainThreadException

html - Google Web Fonts 如何决定向我的浏览器提供哪个版本的字体?

javascript - 如何在未安装在客户端计算机但在服务器计算机上的网站中显示字体

html - 当代码看起来正确时 Webfonts 不工作