• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Courier New <space> is wider than the letters in HTML5/HTML Help output

Contributor ,
Feb 05, 2020 Feb 05, 2020

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)?

TOPICS
Publishing , Responsive HTML5

Views

917

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Feb 06, 2020 Feb 06, 2020

Solved!

Go to "Publish Settings", "Style Mapping", edit the Paragraph Style, set the Block attribute Word-spacing to "normal".

 

Votes

Translate

Translate
Community Expert ,
Feb 05, 2020 Feb 05, 2020

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 05, 2020 Feb 05, 2020

Copy link to clipboard

Copied

You got it, the raw HTML contains "&#160;" 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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2020 Feb 05, 2020

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 05, 2020 Feb 05, 2020

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 06, 2020 Feb 06, 2020

Copy link to clipboard

Copied

LATEST

Solved!

Go to "Publish Settings", "Style Mapping", edit the Paragraph Style, set the Block attribute Word-spacing to "normal".

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines