View Single Post
Old 06-27-2017, 11:17 AM   #1
JustinThought
Zealot
JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.JustinThought ought to be getting tired of karma fortunes by now.
 
JustinThought's Avatar
 
Posts: 149
Karma: 3517858
Join Date: May 2016
Location: Monterrey, Mexico
Device: Samsung Tab-3 7"
'Nuther N00Bie Question

I have a question regarding a test epub I created. I was interested in using embedded fonts, and found I could catch all the fish in the Atlantic Ocean with the can of worms that I opened.

First off, I declared the font as such:

@font-face {
font-family: "jour-nal";
font-style: normal;
src: url(../Fonts/blahblahblah.ttf);
}
.journal {
font-family: jour-nal;
font-size: .95em;
}

Then I used the "journal" class in a <div>, and all seemed to be okay--at least in Sigil and Gitden Reader, and also (somewhat) in Calibre. It also verified fine in both FlightCrew as well as EpubCheck.

Now, Calibre didn't like me giving the font-family a name other than the name embedded in the font, and offered to change it; but it wanted to use the same name for the embedded bold font as well as the italic version. So anyway, after checking with W3Cschools, whose example of an embedded font clearly illustrates a font-family name different from the embedded font, I left it alone for now.

Calibre also had a different opinion about the nomenclature in the OPF file, saying,

"The file OEBPS/Fonts/blahblahblah.ttf has its mimetype specified as application/x-font-ttf in the OPF file. The recommended mimetype for files with the extension "ttf" is application/x-font-truetype. You should change either the file extension or the mimetype in the OPF.

Change the mimetype for this file in the OPF to application/x-font-truetype"


So if I make the change, then re-run FlightCrew on the modified file, it says just the opposite:

The element's "media-type" attribute has value of "application/x-font-truetype" but the file's media type is "application/x-font-ttf"

Difference of opinion, or fatal error?

Then, I decided to go out to W3C and ask their opinion. Whoop-whoop-whoop! Danger Will Robinson! "Property font-family doesn't exist in CSS level 2.1 but exists in [css1, css2, css3]".

So I ran the verification check in W3C using the direct upload method from their main webpage--and life came back as rainbows and unicorns. Of course, that validated at CSS level 3, whereas running the check from within Sigil checked it at CSS level 2.1.

Should I just take my bat and ball and go home, never ever again attempting to create a book with any tool more sophisticated than a quill pen?

Toldja it was a N00B question. Thanks for your input, and please be gentle.
JustinThought is offline   Reply With Quote