安卓设备上如何使用 Times New Roman 字体

13

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

一切似乎都工作得很好,除了安卓设备(手机、平板电脑)。安卓系统没有可用的 Times New Roman 字体。据我所知,你只能使用 Droid Serif 字体,它的外观与 Times 不同。此外,字体大小也不同,会导致许多对齐问题。

有没有办法在 Android 中使用 Times New Roman 字体?我知道 fontface,但没有免费的 webfont 可用于 Times New Roman。也许有一个(可接受的)等效物吗?

提前致谢!


既然你知道@font-face(这是网站的正确方式),问题就只是如何免费获取字体或找到足够相似的免费字体。这类问题在SO上不属于讨论范围。 - Jukka K. Korpela
我并不是在寻找一种字体,而是另一种使用 Times New Roman 的方式/技术。就像 @font-face 一样。 - remyjacobs
1个回答

3

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;
}

下载Liberation Serif .ttf字体,解压并将文件移动到网站根目录。 您可以更改@font-face源URL并将字体移动到任何位置。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接