![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48
Karma: 41612
Join Date: Jan 2015
Location: Poland, Warsaw
Device: Kindle 3G
|
Using PRE tag
Hi!
I'm building some books (Gamebooks). One of the book uses ASCII Art ("Sąsiedzi Lonesbury"). I would like to do it the way author made it, so want to include those ASCII arts. Nevertheless, by using <pre> (to be accurate <pre class="pre-styl">) tags, i get something far from what i want - letters are too big, so lines splits into two - it makes images unreadable. I wanted to make those letters smaller by including Code:
.pre-styl { page-break-inside: avoid; vertical-align: middle; font-size: 30%; line-height: 30%; } Code:
Info(cssparser):I10004: @rules other than @import, @charset and @font-face are not supported. Best regards! |
![]() |
![]() |
![]() |
#2 |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Is that the entire CSS file? I don't see an @ rule there.
BTW, Kindle restricts the line-height CSS property to a minimum of 120% of the font size. And you probably don't want the line height to be 30% of your font size anyway. Last edited by dgatwood; 06-14-2015 at 02:28 AM. |
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48
Karma: 41612
Join Date: Jan 2015
Location: Poland, Warsaw
Device: Kindle 3G
|
Entire CSS*:
Code:
@font-face { font-family: "EB Garamond RG"; src: url('. $adres_czcionek. $nazwa_czcionki. '-Regular.ttf); } @font-face { font-family: "EB Garamond RG"; src: url('. $adres_czcionek. $nazwa_czcionki. '-Bold.ttf); font-weight: bold; } @font-face { font-family: "EB Garamond RG"; src: url('. $adres_czcionek. $nazwa_czcionki. '-Italic.ttf); font-style: italic; } @font-face { font-family: "EB Garamond RG"; src: url('. $adres_czcionek. $nazwa_czcionki. '-Bold-Italic.ttf); font-style: italic; font-weight: bold; } body { font-family: "EB Garamond RG"; } .pre-styl { page-break-inside: avoid; vertical-align: middle; font-size: 30%; line-height: 30%; } Yes, i do belive that i do not want line-height at 30%, it works for epub at 70%, but i just wanted to make sure it is not working. |
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48
Karma: 41612
Join Date: Jan 2015
Location: Poland, Warsaw
Device: Kindle 3G
|
So no i'm using:
Code:
.pre-linia { font-size: 12px; vertical-align: middle; page-break-before: avoid; font-family: monospace; margin: -10px; white-space: pre; } But still can not force spacing between lines to be thicker. |
![]() |
![]() |
![]() |
#5 | |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Quote:
span.smallcap { font-size: 90%; font-weight: bold; } The 90% instruction is ignored in the DX emulation, but I can live with that. (I think the boldface instruction is also ignored.) |
|
![]() |
![]() |
![]() |
#6 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
The Kindle Publishing Guidelines have this to say about monospace:
3.1.6 Text Guideline #6: Monospaced Font Is Supported Kindle uses a default font for content if none is specified; it also supports a monospaced font. Kindle uses the monospaced font to render content in the following tags: <pre>, <code>, <samp>, <kbd>, <tt>, <font face="courier">, <font face="monospace">. With the exception of <pre>, the tags listed above do not change the text alignment. If the content in these tags should be left-aligned, wrap the tags listed above in a <div> styled with CSS using textalign:left. Publishers can include their own font for their content. Amazon has a quality assurance process to ensure that these fonts display well on e Ink-based devices and do not impair the reading experience. Do not include the Charis font; it is replaced with a higher quality font in the Kindle Readers. |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48
Karma: 41612
Join Date: Jan 2015
Location: Poland, Warsaw
Device: Kindle 3G
|
Thanks everyone for help!
I made it somehow like this: PHP Code:
Code:
.pre-linia { page-break-before: avoid; vertical-align: middle; font-size: 6px; white-space: pre; font-family: monospace; margin-top: -2px; margin-bottom: -2px; } |
![]() |
![]() |
![]() |
#8 | |
Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Quote:
Because you didn't specify the line-height property, the reader uses the default value of 1.2 (120%). If your reader uses a base font size of 12 pt, then the CSS above specifies a roughly 10.8 point font size, which is a little over 14 pixels. When you multiply that by 1.2, you find that the baseline of each line is about 17 pixels below the baseline of the line before it, resulting in roughly a three pixel spacing between the bottom of a typical descender and the top of a typical ascender in the next line (assuming the font metrics are correct). |
|
![]() |
![]() |
![]() |
#9 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Ah, I didn't understand your comment! (That happens with distressing frequency in these forums.) Sorry!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
suggestion: tag groups should use Calibre tag hierarchy | comox | Calibre Companion | 53 | 05-25-2015 07:22 PM |
Sorting tag values in tag browser | mcam | Library Management | 15 | 08-25-2013 05:50 AM |
Conversionproblems from HTML to ePub with the <pre>-Tag | matthias2011 | Conversion | 16 | 07-29-2011 08:47 AM |
Adding an Owner tag to tag list? | Fangles | Library Management | 1 | 02-25-2011 02:32 AM |
<pre> tag issue while conveting to epub | Colaveare | Calibre | 8 | 10-09-2010 12:02 AM |