Is this possible? Fonts in percentages and ems?

Request new features or suggest modifications to existing features of Atlantis.
Post Reply
cjseasyaspie
Posts: 34
Joined: Tue Jul 03, 2012 9:10 am
Contact:

Is this possible? Fonts in percentages and ems?

Post by cjseasyaspie »

A fairly recent requirement for Amazon's Kindle is the feature of allowing the user to select the "font face" (or "type face").

The purpose is to make ebooks easier for the "visually challenged".

The best I can figure out, the Amazon Kindle software will add this new feature... but ONLY if font sizes and line height sizes, etc., are expressed in percentage or ems, instead of fixed sizes.

Here are pertinent paragraphs Amazon's specs:

Kindle Publishing Guidelines Amazon.com
http://kindlegen.s3.amazonaws.com/Amazo ... elines.pdf

3.1 Text Guidelines
3.1.1 Text Guideline #1: Body Text Must Use Defaults
The body text in a reflowable Kindle book must be all defaults. Amazon encourages content creators to use creative styles for headings, special paragraphs, footnotes, tables of contents, etc., but not for body text. The reason for this is that any styling on body text in the HTML will override the user’s preferred default reading settings. Users report such behavior as a poor reading experience. Here are the most important points:
• Body text must not have a forced alignment (such as left aligned or justified).
• Body text must use the default font size. Body text should not use the <font size=”…”> tag or its equivalent in CSS.
• Body text should not be bold or italicized. Selected parts of the text can be bold or italicized. This guideline only prohibits a book that would be entirely bold, for example.
• Body text should not have an imposed font color.
• Body text must not have a white font color. Customers report this as a bad user experience.
• Body text must not have a black background color. Customers report this as a bad user experience.
3.1.2 Text Guideline #2: Use CSS for Page Breaks
Do not insert blank lines of text to create empty pages. Use the CSS page-break-before and page-break-after attributes.
3.1.3 Text Guideline #3: Formatting Paragraphs
KindleGen automatically indents the first line of every paragraph by default. To change this behavior, use the text-indent style on the <p> tag. For example:
• <p style=”text-indent:0"> - no indentation of the first line
• <p style=”text-indent:10%"> - positive indent, 10% of the width of the page
• <p style=”text-indent:5em"> - positive indent, 5 em
To change the space before each paragraph, use the margin-top style on the <p> tag.
3.1.4 Text Guideline #4: Other Encodings Are Supported
The source of a Kindle book can be encoded in many different ways. All encodings are supported, provided that:
• The encoding of the HTML files is clearly stated in the HTML; and
• The computer used for compiling the sources supports the encoding and knows how to convert it to UNICODE.
Amazon recommends specifying the encoding of the HTML files in the HTML itself by using the <meta> tag in the <head> section.
Example
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=iso-
8859-1">

3.1.5 Text Guideline #5: Spaces and Unicode Characters
The only supported spaces are the normal space, the non-breakable space (&nbsp;) and the zero-width non-joiner (&zwnj;). Use of any other space can break the selection, dictionary lookup, and line-wrap algorithms.
Do NOT use Unicode format characters, as they may cause problems.
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 align="left"> block.
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.
3.1.7 Text Guideline #7: CSS Support
The earlier Kindle platform offered very basic support for Cascading Style Sheets (CSS). This has been significantly enhanced in KF8 with support for CSS 2/CSS 3. (See section 11.2 for the list of supported CSS attributes/selectors). To verify that your use of CSS elements displays the way you intended, preview your Kindle book on different devices before publishing it.
Avoid using fixed values such as points and pixels for CSS properties such as font-size, width, height, margin, padding, text-indent, and line-height. To enable rendering across various screen sizes and resolutions, specify these values in percentages.
When using the margin and padding CSS properties, specify the values in percentage (%) instead of em units. This ensures that the margins do not grow wide with large font sizes.
To ensure pagination, the Kindle Reader does not honor line-height value less than 1.2 em or 120%.
Elements such as drop caps should be specified using percentages or relative units (positive or negative) instead of fixed values such as points and pixels. (Example: drop caps: Use font-size: 300%). The top of the drop cap should be aligned with the body text. To create drop caps, Amazon recommends using the following sample CSS:
Example
p.para {
font-family: "Times New Roman";
font-size: small;
margin-bottom: 0;
margin-top: 0;
text-align: justify;
text-indent: 0;
}
@media amzn-kf8
{
span.dropcaps Publishing on Kindle: Guidelines for Publishers
{
font-weight:normal;
font-size:320%;
float:left;
margin-top:-0.3225em;
margin-bottom:-0.3245em;
}
}
@media amzn-mobi
{
span.dropcaps
{
font-size:3em;
font-weight: bold;
}
}<p class="para"><span class="dropcaps">T</span>here is a sample
To verify that the drop caps display as intended, test the book as described in section 9.1, Testing Kindle Books.
Happy Kindling,

CJ, at CJ's Easy as Pie Kindle Tutorials
http://www.cjs-easy-as-pie.com/
Robert
Posts: 1906
Joined: Fri Aug 15, 2003 8:27 pm

Post by Robert »

If you save a document as ePub in Atlantis and specify margins in ems in the “Save as eBook” dialog, Atlantis will automatically code the ePub file with all measurements specified in “ems”.
So you should not worry about this.

HTH.
Cheers,
Robert
cjseasyaspie
Posts: 34
Joined: Tue Jul 03, 2012 9:10 am
Contact:

Post by cjseasyaspie »

Oh my goodness!

If it's that easy, I am embarrassed!

I do save as ePub and upload the ePub to Amazon Kindle, but I did not know to "specify margins in ems".

Thank you!
Happy Kindling,

CJ, at CJ's Easy as Pie Kindle Tutorials
http://www.cjs-easy-as-pie.com/
Robert
Posts: 1906
Joined: Fri Aug 15, 2003 8:27 pm

Post by Robert »

Note that Atlantis will automatically remember the measurement unit (“ems” in your case) last used when saving a document to ePub. In other words, you won’t have to specify the margins measurement unit again when you save new documents to eBook. Unless, of course, if you expressly want to change the measurement unit.
cjseasyaspie
Posts: 34
Joined: Tue Jul 03, 2012 9:10 am
Contact:

Post by cjseasyaspie »

I've got that feature working for me now... thank you!

I was looking for solutions in the Options menu... the wrong place, I realize now.

I looked for, but did not find, a downloadable HELP.

Is it available as an ePub file?

If so, I'd dearly love to have one that I can put on my Kindle and actually study it... which I can't do with the built-in Help.

Thanks again,

CJ
Happy Kindling,

CJ, at CJ's Easy as Pie Kindle Tutorials
http://www.cjs-easy-as-pie.com/
Post Reply