View Full Version : media-type


me too
08-07-2012, 12:00 AM
hello all
does any one know the media type of .ttf font file ,i had searched and found 2 such media types, but when i had validated it found as in-valid
thoose media types are
1. application/x-truetype-font
2. application/octet-stream

and i am working on mac,
any help would be regarded thank you

me too
08-07-2012, 01:22 AM
my css file is

@charset "UTF-8";
@namespace "http://www.w3.org/1999/xhtml";
@namespace epub "http://www.idpf.org/2007/ops";

@font-face{
font-family: 'QuicksandLight';
src: url('../fonts/FeENit2.ttf') format('truetype');
font-size:1.5em;
}
body {
font-family: 'QuicksandLight', Gothic, Helvetica, Arial;
background-color: rgb(240,240,240);
font-size: 1.5em;
line-height: 1.8em;

}

@font-face {
font-family:'QuicksandLight';
src: url('../fonts/FeENrm2.ttf');
font-style:italic;
font-size:20px;
}

h3
{
font-style:italic;
font-weight:normal;
}

}
.preamble::first-line
{
font-size:2em;
font-style:normal;
}
h2
{
font-style:italic;
font-weight:normal;
}
.we-the-people
{
color:#900;
font-style:italic;
font-weight:normal;
}
#signing
{
width:58%;
margin:0.5em auto 1em auto;
box-shadow:8px 8px 8px gray;
}

my package.opf is as follows

<manifest>
<item id="font1" href="fonts/FeENrm2.ttf" media-type="application/x-font-ttf"/>
<item id="font2" href="fonts/FeENit2.ttf" media-type="application/x-font-ttf"/>



but when validated i found 2 errors

ERROR: /Users/lrim3/Desktop/fazeela's projects/i did/epub3 font formatting-i did/epub2.epub/EPUB/css/style1.css: Font-face reference EPUB/fonts/FeENit2.ttfto non-standard font type application/x-font-ttf
ERROR: /Users/lrim3/Desktop/fazeela's projects/i did/epub3 font formatting-i did/epub2.epub/EPUB/css/style1.css: Font-face reference EPUB/fonts/FeENrm2.ttfto non-standard font type application/x-font-ttf

thank you
me too....

Toxaris
08-07-2012, 02:08 AM
There are various examples here on the site about font embedding with the correct syntax.

Remember, the @font-face must be the first lines in a stylesheet. The @namespace and @charset are not used. You place that in the xml declaration of the xhtml files.

me too
08-07-2012, 03:11 AM
i had searched with in the forum , i find the answer by replacing the media type as "application/vnd.ms-opentype"

Toxaris
08-07-2012, 03:37 AM
Don't forget my other comments. In general a font is not embedded for the body, since font embedding does not always works and a full font can be quite large.
For certain languages there is no choice though.

JSWolf
08-07-2012, 05:32 PM
Truetype: .ttf = media-type="application/x-font-ttf"

Opentype: .otf = media-type="application/vnd.ms-opentype"