Copy link to clipboard
Copied
In FM19 I have a paragraph style that uses the Courier New font. This gives fixed width characters - at least in FM and the pdf output.
But in the Responsive HTML5 or Windows HTML Help output, the letters are still fixed width, but the <space> character is suddenly a little bit wider. This makes the output look a bit messy, and is also harder to read.
How can I make the <space> character have the same width as the characters (letters and digits)?
Solved!
Go to "Publish Settings", "Style Mapping", edit the Paragraph Style, set the Block attribute Word-spacing to "normal".
Copy link to clipboard
Copied
What is the actual raw HTML that's generated?
Which might be by way of asking if this is a user agent (browser-side) or user system (font) problem.
Alternatively, try:
U+00A0 no-break space: Ctrl+{space} in FM
U+2002 en space: Esc {space} n
U+2003 em space: Esc {space} m
U+205F medium mathematical space: might be Esc {space} 1
Copy link to clipboard
Copied
You got it, the raw HTML contains " " characters, i.e. "no-break space".
It's used in short programming examples, to get several "space" before comments. Like:
int hv1, hv2; -- comment with several apparently no-break space before...
Probably a work-around to avoid FM merging two <space> into one. (Which makes sense in regular text, but not in programming code examples.)
Can I simply turn off that space merging feature for my code paragrapgh style?
Copy link to clipboard
Copied
I've not used the HTML workflow in recent FM versions, so don't know what transform controls exist. You're probably dozen of clicks ahead of any poking around I might do.
As a temporary hack, the Wiki Whitespace character page lists a number of other Unicode values you could try.
Copy link to clipboard
Copied
Thanks for the Wiki link, I have now tried a few of the different Courier New white-spaces, but none of them look good in both FM/pdf and HTML. (Very odd.)
However, I've found that the css/html "pre" tags turns off the space collapsing.
In the Publish Settings, Style Mapping, it's even possible to set White-space property to "pre"!
But since FM still is putting the too wide nbsp character when I turn off smart-collapsing, the "pre" property makes no difference. Very frustrating.
Copy link to clipboard
Copied
Solved!
Go to "Publish Settings", "Style Mapping", edit the Paragraph Style, set the Block attribute Word-spacing to "normal".