Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spaces in Poetry
#2
(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>&nbsp;</p>
Secondly, any text that has 'preserve whitespace' set will keep all the space characters you have in the text.  You can set that in CSS or by using the PRE tag (in which case it will by default switch to a fixed-width font, which is probably what you need if you're trying to use space characters to line up your text).  For example:
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>&nbsp;</p>
<p>&nbsp;</p>
<div>A sentence with a gap above it</div>


</BODY>
</HTML>
Reply


Messages In This Thread
Spaces in Poetry - by adaml - 07-01-2025, 04:51 PM
RE: Spaces in Poetry - by jim_chapman - 07-01-2025, 09:38 PM
RE: Spaces in Poetry - by adaml - 07-01-2025, 10:29 PM
RE: Spaces in Poetry - by jim_chapman - 07-02-2025, 07:49 AM
RE: Spaces in Poetry - by adaml - 07-03-2025, 07:41 AM
RE: Spaces in Poetry - by jim_chapman - 07-03-2025, 04:01 PM
RE: Spaces in Poetry - by adaml - 07-03-2025, 04:45 PM
RE: Spaces in Poetry - by jim_chapman - 07-17-2025, 08:16 AM
RE: Spaces in Poetry - by adaml - 07-17-2025, 04:58 PM
RE: Spaces in Poetry - by jim_chapman - 07-18-2025, 07:34 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)