12-10-2013, 10:07 AM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2013
Device: none
|
Sans-serif generic family in mobigen generated .mobi files
Hi everyone.
I am working on a book that needs to have some of its sections displayed in sans-serif font. I have set the following rule for these kind of sections; nice and generic. {font-family: sans-serif;} The epub version of the book works as intended. When I preview the file in the Kindle Previewer, however, everything is in serif font (except for some other parts of the book, that needed to be in monospace({font-family: monospace;}) , which are, curiously, displaying correctly) What is the deal with kindlegen generated .mobi files and the sans-serif font family? Do they simply not work or is there some trick to make the kindlegen not disregard the CSS rule when it compiles the book from .epub? .mobi files in question are generated using the up-to-date Kindle Previewer's built in kindlegen functionality. Thanks |
12-10-2013, 10:52 AM | #2 | |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
12-10-2013, 10:57 AM | #3 |
Grand Sorcerer
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
There's only so many generic font-families that are supported with kindle devices (out of the box). Monospace or tt will work on all devices (mobi or KF8), but I don't know about any others for sure. You may have to embed a font to get anything else to work (and even then it will only work on devices/apps that support the KF8 format).
|
12-10-2013, 11:23 AM | #4 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2013
Device: none
|
Quote:
I am not aware however which of the devices available in the Previewer are supposed to be new (as in "use .kf8") and which are old To answer you, I tried all of them and since sans-serif works in none of them I just assumed it works to neither new or old. Just to be sure we are on the same page (no pun intended) here is the list of the available devices I see: -Kindle e-ink |-Kindle Paperwhite |-Kindle DX -Kindle Fire |-Kindle Fire HD |-Kindle Fire HDX |-Kindle Fire HDX 8.9" -Kindle for iOS |-iPhone |-iPad As a side note, monospace is not working on Kindle Paperwhite. |
|
12-10-2013, 11:27 AM | #5 |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2013
Device: none
|
|
12-10-2013, 02:11 PM | #6 |
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Maybe you are doing something wrong. I used this code without any issue:
Code:
h1 { font-family: "Arial", sans-serif; text-align: center; margin-bottom: 1em; } h2 { width: 70%; font-family: serif; font-style: italic; text-align: center; margin: 0 auto 1em auto; padding: 1em; border: 7px double black; -webkit-border-radius: 25px; } p { text-indent: 0; text-align: justify; font-family: serif; } .boldss { font-family: "Arial", sans-serif; font-weight: bold; } Code:
<h1>This title in sans-serif</h1> <h2>Subtitle in serif</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, <span class="boldss">this text in bold sans-serif</span> massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula. Praesent orci dui, pulvinar id convallis a, faucibus non mauris. Donec tellus augue, tempus sed facilisis sed, fringilla quis leo. Mauris vulputate, leo ac facilisis vulputate, enim orci interdum augue, in blandit quam turpis quis dui.</p> This is how it looks in my K4NT: Below you can check the respective epub. Regards Rubén Last edited by RbnJrg; 12-10-2013 at 02:20 PM. |
12-10-2013, 02:50 PM | #7 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Dec 2013
Device: none
|
Quote:
Apparently, you must specify at least one font for sans-serif to work. If you just use the generic {font-family: sans-serif;} , as I did in my case, it gets disregarded. After seeing your code, I specified Arial as the to-go-first font, and now sans-serif is working. At least that's how it works on the Previewer. Out of curiosity, I see you have an actual device, so would you mind testing whether just declaring {font-family: sans-serif;} would work on that? Thanks again |
|
12-10-2013, 03:47 PM | #8 | ||
Wizard
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Quote:
|
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serif, and sans-serif fonts | SamL | ePub | 5 | 07-21-2011 06:00 PM |
Which typeface should use for ebook, Serif or Sans-serif | droople | Workshop | 8 | 06-13-2010 07:20 AM |
Serif or Sans Serif for readability? | kilofox | Amazon Kindle | 19 | 02-20-2009 02:22 PM |
Serif and Sans-Serif fonts in Libprs500 | benong | Calibre | 1 | 02-06-2008 04:43 AM |
Do you prefer the Reader's serif or its sans serif font? (poll) | Alexander Turcic | Sony Reader | 9 | 11-25-2006 12:15 PM |