Forum Bugs

Not defaulting to media=print?

pfurbacher
From the docs and this forum, the default media type is set to print. If so, I would expect that the following CSS declaration would result in Prince using 'Hiragino Kaku Gothic ProN'.
<style type="text/css">
@media print {
    .recycle-symbol {
        font-size: 16px;
        font-family: 'Hiragino Kaku Gothic ProN', 'Apple Symbols', 
                     'Segoe UI Symbol', Arial, sans-serif;
    }
} /* end of media print declaration */
. . .
.recycle-symbol {
    font-size: 24px;
    font-family: 'Apple Symbols', 'Segoe UI Symbol', 
                 'Hiragino Kaku Gothic ProN', Arial, sans-serif;
}
</style>


However, in "--debug mode" from the command-line, note the "font request" list order, and the "used font":
...
prince: debug: font request: Apple Symbols, Segoe UI Symbol, Hiragino Kaku Gothic ProN, Arial, sans-serif
prince: debug: scan fonts: Apple Symbols
prince: debug: found font: Apple Symbols Regular
prince: debug: scan fonts: Hiragino Kaku Gothic ProN
prince: debug: found font: Hiragino Kaku Gothic ProN W3
prince: debug: found font: Hiragino Kaku Gothic ProN W6
prince: debug: scan fonts: Arial
...
prince: used font: Apple Symbols, Regular
prince: used font: Times New Roman, Regular
prince: debug: writing output: xxx.pdf
prince: Finished: success

Prince is using the general declaration, not the one if "@media print". Even if I specify "--media=print", the general declaration is used. This is contrary to what I would think should happen.

Finally, if I add "!important" to the declaration in "@media print",
font-family: 'Hiragino Kaku Gothic ProN', 'Apple Symbols', 'Segoe UI Symbol', 
             Arial, sans-serif !important;

Prince uses the @media print declaration:
prince: debug: font request: Hiragino Kaku Gothic ProN, Apple Symbols, Segoe UI Symbol, Arial, sans-serif
prince: debug: scan fonts: Hiragino Kaku Gothic ProN
prince: debug: found font: Hiragino Kaku Gothic ProN W3
prince: debug: found font: Hiragino Kaku Gothic ProN W6
prince: debug: scan fonts: Apple Symbols
...
prince: used font: Hiragino Kaku Gothic ProN, W3
prince: used font: Times New Roman, Regular
prince: debug: writing output: xxx.pdf


Is this a bug, or am I misunderstanding something?
mikeday
Both will be applied and the later one has higher priority. You can avoid this by wrapping the later one in a @media screen block, or putting it earlier than the @media print block.
pfurbacher
I see. With my current "screen first, print from browser first" design, putting the "@media print" block last is more practical in this case. (I'm still exploring whether to implement printing within my barebones summer swim league software via Prince. The value Prince would bring to it is that some of the meet documents would be much nicer if they had headers and footers, something not possible even in 2016 with any of the major browsers!)

Will have to re-read the CSS spec because I was under the impression that the specific (e.g., @media print) overrode the general, uncategorized declarations.

Thanks.