Fonts 用CSS嵌入字体族

Fonts 用CSS嵌入字体族,fonts,font-family,Fonts,Font Family,我目前正在尝试将TTF字体嵌入到我的页面中,然后显然会提供一个备份字体。由于某种原因,它似乎没有嵌入,我曾经在许多浏览器中查看我的页面,但似乎没有一个浏览器选择嵌入的字体 我的字体是: @font-face { font-family: 'Tw Cen MT'; src: url('tw.ttf') format('truetype'); font-weight: normal; font-style: normal; } 这包含在我所有的CSS文档中,我如何实现字体的示例如下: p.top

我目前正在尝试将TTF字体嵌入到我的页面中,然后显然会提供一个备份字体。由于某种原因,它似乎没有嵌入,我曾经在许多浏览器中查看我的页面,但似乎没有一个浏览器选择嵌入的字体

我的字体是:

@font-face 
{
font-family: 'Tw Cen MT';
src: url('tw.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
这包含在我所有的CSS文档中,我如何实现字体的示例如下:

p.toptext
{
font-size:17px;
font-family:"Tw Cen MT";
font-weight:bold;
color:#d5d3d3;
letter-spacing:0.5ex;
}
现在,链接是否需要添加“../tw.ttf”../才能找到字体

与此相关的另一个问题是,我可以将备份字体放在字体系列代码中,还是每次将字体系列链接到段落和锚定时都必须手动添加它


提前感谢,非常感谢。

试试这个全字体字体

@font-face {
    font-family: 'Tw Cen MT';
    src: url('tw.eot');
    src: url('tw.eot?#iefix') format('embedded-opentype'),
         url('tw.woff') format('woff'),
         url('tw.ttf') format('truetype'),
         url('tw.svg#helveticaregular') format('svg');
    font-weight: normal;
    font-style: normal;

}
请试试这个css

@font-face {

font-family: 'fontscorecomttwcenmt';
src: local('fontscorecomttwcenmt'),url('./fontscorecomttwcenmt.woff') format('woff'), url('./fontscorecomttwcenmt.ttf') format('truetype');

}

/* use this class to attach this font to any element i.e. <p class="fontsforweb_fontid_13141">Text with this font applied</p> */

 .fontsforweb_fontid_13141
        {
        font-family: 'fontscorecomttwcenmt' !important;
        }

/* Font downloaded from FontsForWeb.com */

“我的路径”试图在CSS文件夹中定位字体,因为@Font-face代码放在我的CSS中,更改字体的路径并将“../”添加到开头可以修复它

固定的:

@font-face {
    font-family: 'Tw Cen MT';
       src: url('../tw.eot');
       src: url('../tw.eot?#iefix') format('embedded-opentype'),
            url('../tw.woff') format('woff'),
            url('../tw.ttf') format('truetype'),
            url('../tw.svg#helveticaregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

我添加了字体系列:Tw Cen MT,Helvetica;在我的CSS中,我的大多数字体系列标签似乎已经完成了备份字体的工作,代码很长,但我不能说嵌入字体是否有效是非常无用的。不,只是下载了firefox和一些附加组件,在其他浏览器中查看,它仍然不会嵌入,我确信firefox至少允许嵌入TTF文件。将我的字体系列代码更改为上述内容,然后将我的所有字体系列CSS更改为fontscorecomttwcenmt,但不起作用,也没有加载字体。我想它应该可以从我自己的服务器嵌入字体,而不是从下载的服务器检索字体。我的网站是:www.crokedcartoon.co.uk/print.html。