Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 02-09-2020, 09:11 PM   #31
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by joe 1 View Post
Ok, I'm almost there. My tables are now showing up with borders! But now I'm having a problem with fonts.

If I use calibre to generate a MOBI from my original epub, I am seeing monospace fonts where I have used "font-family: monospace". But if I use any of the Amazon tools with my epub, I do not get any monospace fonts.

Is there a trick to specifying monospace fonts in CSS so that it gets set properly by Kindle Create / Previewer?
When you say that you are "seeing monospace fonts," what, exactly, do you mean and on what device(s) or software?

Hitch
Hitch is offline   Reply With Quote
Old 02-09-2020, 11:38 PM   #32
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,072
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by joe 1 View Post
If I use calibre to generate a MOBI from my original epub, I am seeing monospace fonts where I have used "font-family: monospace". But if I use any of the Amazon tools with my epub, I do not get any monospace fonts.
In my testing "font-family: monospace;" works properly in most situations. However there are two cases I have encountered where Kindle software incorrectly displays a proportional font instead of a monospace one. This problem occurs in the Kindle Previewer and Kindle for PC apps for books that support Enhanced Typesetting.

Quote:
Originally Posted by joe 1 View Post
Is there a trick to specifying monospace fonts in CSS so that it gets set properly by Kindle Create / Previewer?
A work around for the Kindle Previewer is to use "font-family: 'Source Code Pro', monospace;" instead. I don't know of any fix for Kindle for PC.

I am not sure how Kindle Create comes into this. Could you explain further?
jhowell is offline   Reply With Quote
Advert
Old 02-10-2020, 01:13 PM   #33
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
FWIW, I have always used a belt & suspenders approach to monospace, e.g.:

p.block {
font-family: courier, monospace;
text-indent: 1em;
text-align:left;
margin:0em 0em 0em 1em;
}

I don't recall where this originated, but it was the conventional wisdom on the KDP forums some years ago, say 2012.
Notjohn is offline   Reply With Quote
Old 02-10-2020, 03:40 PM   #34
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Hitch View Post
When you say that you are "seeing monospace fonts," what, exactly, do you mean and on what device(s) or software?

Hitch
When converting from EPUB to MOBI, is there a way to format it so that it only displays something you've added if it's displaying the MOBI7 format? Some sort of debugging thing you can add to verify that you're seeing the MOBI7 format and not the AZW3 format if/when it's a dual MOBI (or whatever might use AZW3). That's assuming you don't have an old Kindle that only handles the old MOBI; if you're on a PC you could use the Mobi Pocket viewer.
hobnail is offline   Reply With Quote
Old 02-10-2020, 03:52 PM   #35
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,787
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by hobnail View Post
When converting from EPUB to MOBI, is there a way to format it so that it only displays something you've added if it's displaying the MOBI7 format? Some sort of debugging thing you can add to verify that you're seeing the MOBI7 format and not the AZW3 format if/when it's a dual MOBI (or whatever might use AZW3). That's assuming you don't have an old Kindle that only handles the old MOBI; if you're on a PC you could use the Mobi Pocket viewer.
You can use kindleunpack -s
to split out the mobi7 and azw3 files and compare how all three look.
j.p.s is offline   Reply With Quote
Advert
Old 02-10-2020, 04:10 PM   #36
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hobnail View Post
When converting from EPUB to MOBI, is there a way to format it so that it only displays something you've added if it's displaying the MOBI7 format? Some sort of debugging thing you can add to verify that you're seeing the MOBI7 format and not the AZW3 format if/when it's a dual MOBI (or whatever might use AZW3). That's assuming you don't have an old Kindle that only handles the old MOBI; if you're on a PC you could use the Mobi Pocket viewer.
If you have a dual format eBook and your device supports KF8, that's what you will see. There is no way to make it see the Mobi part. You can load the eBook into Calibre (if it's not already) and use the KindleUnpack plugin to split into Mobi, KF8, and it will generate an ePub (but that ePub needs to be verified with epubcheck and then the errors fixed).
JSWolf is offline   Reply With Quote
Old 02-10-2020, 07:24 PM   #37
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,072
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by hobnail View Post
When converting from EPUB to MOBI, is there a way to format it so that it only displays something you've added if it's displaying the MOBI7 format? Some sort of debugging thing you can add to verify that you're seeing the MOBI7 format and not the AZW3 format if/when it's a dual MOBI (or whatever might use AZW3).
You can use media queries to have CSS that varies by format. Use this to selectively apply the "display" property to text in order to have the content vary by format.

I have attached a sample EPUB that will show which Kindle format is used to display it.
Attached Files
File Type: epub what-format.epub (1.8 KB, 247 views)
jhowell is offline   Reply With Quote
Old 02-10-2020, 08:47 PM   #38
joe 1
Junior Member
joe 1 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2020
Device: Kindle
Quote:
Originally Posted by Hitch View Post
When you say that you are "seeing monospace fonts," what, exactly, do you mean and on what device(s) or software?

Hitch
Yeah, sorry, I should have clarified. I'm doing testing with the IOS Kindle app. I created a simple epub in calibre, and included the following block of text:
Test
iiii
OOOO
TEST

The second and third lines are formatted as monospace, so it's easy to tell visually if it really is being rendered in a monospace font. I converted my epub to mobi, and emailed it to my Kindle account. The doc looks fine -- I see my monospace fonts where they should be.

Next, I used kindlegen to convert my epub to mobi, and again emailed it to my Kindle acocunt. Now, all the text is the same proportional font -- no monospace anywhere.

I tried opening both mobi files with Kindle Previewer and saw the same result as on my iPhone -- monospace fonts correctly display in the mobi created by calibre, but no monospace fonts in the one created by kindlegen.

This is the css for my monospace section:
Code:
.class_s {
    display: block;
    font-family: "Source Code Pro", monospace
    }
Quote:
Originally Posted by jhowell View Post
A work around for the Kindle Previewer is to use "font-family: 'Source Code Pro', monospace;" instead. I don't know of any fix for Kindle for PC.

I am not sure how Kindle Create comes into this. Could you explain further?
That's exactly the font-family value I'm using..

Whoops, I meant to say kindlegen, not Kindle Create.
joe 1 is offline   Reply With Quote
Old 02-10-2020, 10:12 PM   #39
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,072
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by joe 1 View Post
I converted my epub to mobi, and emailed it to my Kindle account. The doc looks fine -- I see my monospace fonts where they should be.

Next, I used kindlegen to convert my epub to mobi, and again emailed it to my Kindle acocunt. Now, all the text is the same proportional font -- no monospace anywhere.
You found another failure case that I had not tested. Emailing a MOBI file created by either calibre or kindlegen will result in MOBI7 format being delivered to the Kindle for iOS app since it does not support KF8 format.

The reason for the failure is that in MOBI7 format only the first font family name is retained by kindlegen, "Source Code Pro" in this case. But the MOBI7 renderer does not handle that font name, only "monospace" or "courier". It will work properly if you use "font-family: monospace" alone. (As NotJohn indicated using "font-family: courier, monospace;" also works.)

The reason that calibre conversion works in this case is that, unlike kindlegen, it converts any monospace font family to the HTML <tt> tag which is rendered in MOBI7 with a monospace font.

Last edited by jhowell; 02-10-2020 at 10:18 PM.
jhowell is offline   Reply With Quote
Old 02-10-2020, 10:19 PM   #40
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by joe 1 View Post
Yeah, sorry, I should have clarified. I'm doing testing with the IOS Kindle app. [snip]

Well, as jhowell told you, you've wasted all that time.

Emailing or sideloading a MOBI to your iOS device doesn't give you the correct file. You have to build an AZK file and then sideload it, hardwired via a USB cable, through iTunes, to the device.

Once you've done that, the coding probably works or you can fix it as per the coding that you've been given in this thread. This--the iOS--is exactly why I asked what I asked. We once had a ridiculously long thread on this forum, with someone driving us and himself insane, about embedded fonts--until I noticed something he had said, and it turned out he was viewing the file on KCR--which displays ZERO embedded fonts. {sigh}.

Hitch
Hitch is offline   Reply With Quote
Old 02-11-2020, 07:31 PM   #41
joe 1
Junior Member
joe 1 began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2020
Device: Kindle
Quote:
Originally Posted by Hitch View Post
Emailing or sideloading a MOBI to your iOS device doesn't give you the correct file. You have to build an AZK file and then sideload it, hardwired via a USB cable, through iTunes, to the device.
Ok, but I replicated the behavior with Kindle Previewer:
1. Save epub with calibre
2. Use kindlegen to convert epub to mobi
3. Open mobi with Kindle Previewer

I don't see my monospace fonts this way, but if I:
1. Save epub with calibre
2. Convert epub to mobi with calibre
3. Open mobi with Kindle Previewer

then it works.

Quote:
Originally Posted by jhowell View Post
The reason that calibre conversion works in this case is that, unlike kindlegen, it converts any monospace font family to the HTML <tt> tag which is rendered in MOBI7 with a monospace font.
That would explain the behavior I'm seeing. So am I just out of luck in hoping to get monospace fonts? Or is it possible to replace the mobi7 portion of the kindlegen-generated file with one I create in calibre?

Thank you both very much for your assistance.
joe 1 is offline   Reply With Quote
Old 02-11-2020, 09:55 PM   #42
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,072
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by joe 1 View Post
That would explain the behavior I'm seeing. So am I just out of luck in hoping to get monospace fonts? Or is it possible to replace the mobi7 portion of the kindlegen-generated file with one I create in calibre?
You can’t mix and match parts of files created by calibre and kindlegen.

You can fix the problem with devices and apps that use MOBI7 format by just dropping “Source Code Pro” from your font selection and going with just “monospace” or “courier, monospace”. That fails to display properly in the Kindle Previewer, but works in actual customer devices and apps except Kindle for PC.
jhowell is offline   Reply With Quote
Old 02-12-2020, 08:15 AM   #43
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by jhowell View Post
You can’t mix and match parts of files created by calibre and kindlegen.

You can fix the problem with devices and apps that use MOBI7 format by just dropping “Source Code Pro” from your font selection and going with just “monospace” or “courier, monospace”. That fails to display properly in the Kindle Previewer, but works in actual customer devices and apps except Kindle for PC.
IME, The courier call always works. Calling "Source Code Pro" isn't going to work, obviously, on the myriad devices that don't have it.

Hitch
Hitch is offline   Reply With Quote
Old 02-12-2020, 02:01 PM   #44
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Hitch View Post
IME, The courier call always works. Calling "Source Code Pro" isn't going to work, obviously, on the myriad devices that don't have it.
Hitch
Which devices come with Source Code Pro?
hobnail is offline   Reply With Quote
Old 02-12-2020, 02:17 PM   #45
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,787
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by joe 1 View Post
That would explain the behavior I'm seeing. So am I just out of luck in hoping to get monospace fonts? Or is it possible to replace the mobi7 portion of the kindlegen-generated file with one I create in calibre?
You seem to be confusing specifying some specific font not working with not being able to get monospace at all.
j.p.s is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre suddenly not transferring AZW3 or MOBI with page numbers talkingdog Calibre 1 06-25-2017 05:25 PM
Problem with one book transferred from calibre (azw3 and mobi format) lordofazeroth Amazon Kindle 7 04-26-2016 03:02 PM
Converted to .azw3 - but KDP won't accept? Austruck Calibre 3 12-20-2015 04:23 PM
Calibre sends Newsfeeds as mobi instead of AZW3 to Kindle syntaxis Calibre 2 06-07-2014 02:25 AM
Why does Calibre open my AZW3 file as a MOBI? Julius Caesar Calibre 1 08-27-2013 02:43 PM


All times are GMT -4. The time now is 12:42 AM.


MobileRead.com is a privately owned, operated and funded community.