07-01-2025, 09:38 PM
(07-01-2025, 04:51 PM)adaml Wrote: I am publishing a poetry book using ePub reflowable 3.0 format. Some of the poems have extra spacing between words to position them uniquely relative to other words, for visual effect.
I am using multiple entities to force spaces, which is working in other readers that I have tested it with (Adobe Digital Editions, Aquile Reader, Calibre eBook Viewer). However, Freda ignores the extra spaces and only renders one space between all words.
Is this by design, or do I need to use a different entity (such as nbsp) to make this work?
Thanks
Freda is quite aggressive about showing any amount of whitespace as a single space, unless it's actually being told by CSS/XHTML to preserve whitespace. If you really want to control the position of words in an HTML document you may do better to create suitable spans and set their margins accordingly. Or even use floating elements. Putting your text into table elements can also work. Using space characters (or other whitespace entities) is always going to be a rough and ready solution, because you don't get to control the screen dimensions of the user's device, or the font face (and size) that the user selects.
That said, Freda does offer some possibilities for doing what you need. Firstly, you can create extra vertical spacing using paragraphs containing only a non-breaking space.
Code:
<p> </p>Code:
<HTML>
<HEAD>
<meta charset="utf-8">
<TITLE>Poetry Layout Test</TITLE>
</HEAD>
<BODY>
<div><pre>A sentence with single spacing</pre></div>
<div><pre>A sentence with double spacing</pre></div>
<div><pre>A sentence with triple spacing</pre></div>
<p> </p>
<p> </p>
<div>A sentence with a gap above it</div>
</BODY>
</HTML>
