Thread: Embedding fonts
View Single Post
Old 02-24-2014, 05:25 AM   #1
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,019
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
Question Embedding fonts

Kovid, I tried to embed in some documents a TTF font and got mix results with my ref in the stylesheet resulting in the font not being found.

I expected the font to be found in "src: url(../Fonts/<font>.ttf)", but it turned out to be placed after importing (function: "Import files into book") in a different location "src: url(../../fonts/<font>.ttf)". The next time I imported the same font in another document, it was not even located in a sub-folder "fonts", but at the same hierarchy level as "mimetype" so I had to change the ref into "src: url(../../<font>.ttf);" for it to be found.
Using the "Arrange into folders" function to force the font into sub-folder "Fonts" so it could be found via ref "src: url(../Fonts/<font>.ttf)" also failed as this function created the sub-folder "fonts" in lower-case.

As my results seems to differ each time, I currently import the font with the "Import files into book" function, open then the resulting zipped epub to look where it happens to be situated and then manually update the ref in the stylesheet.

Apparently I have the wrong font location expectations, but can you provide me a pointer on how it is supposed to be to cure my confusion?
DrChiper is offline   Reply With Quote