Created attachment 11598 [details] book with sans-serif font In the attached ePub file, the CSS specifies the body font family as sans-serif: body { font-family: FreeSans, sans-serif; } I’m afraid that mupdf-1.7 simply ignores it.
Created attachment 11637 [details] ePub file with actual font invocation I have discovered that the following code works with current master: .firstfontface { font-family: monospace; } Other font generic names such as "serif" or "sans-serif" work, unless they are preceded by an actual font name. This is the reason why the font selection doesn’t work in the previous ePub: body { font-family: FreeSans, sans-serif; } Even if mupdf cannot find the first typeface, it should try the next one. And font invocation by concrete font name doesn’t work. Either the font is embedded in ePub file or it has to be from OS: @font-face { font-family: myCousine; font-style: normal; font-weight: normal; src:url("Cousine-Regular.ttf"); } .secondfontface { font-family: Cousine; } .thirdfontface { font-family: myCousine; } Could you fix this? Many thanks for your help.
Tor, summarizing the issue, mupdf (your current master c1ecd40) only reads serif, sans-serif or monospace from font-face. Any actual font (from system in X11 or embedded in ePub with @font-face) is simply ignored.
Tor, the following document (http://www.boe.es/buscar/epub/2007/BOE-A-2007-22439-consolidado.epub) contains the CSS code: body { font-family: Arial, sans-serif; } mupdf-x11 current master ignores both fonts (Arial isn’t embedded). It displays the serif font. http://www.boe.es/legislacion/codigos/abrir_epub.php?fich=034_Codigo_Civil_y_legislacion_complementaria.epub embeds the fonts, but mupdf-x11 ignores both fonts again and displays the serif font. Before there is a proper implementation for font-family, would it be possible that mupdf ignores what it cannot handle and displays the fonts that handles? (I mean, Arial should be rejected and sans-serif used for text display in the CSS code above.)
commit f501211e904d2c01e47b03e774ffc6f93faeae25 Author: Tor Andersson <tor.andersson@artifex.com> Date: Fri Jan 22 12:00:55 2016 +0100 epub: Implement @font-face rules.