Skip to main content
Inspiring
March 23, 2017
Question

How to get thin spaces in HTML Help output

  • March 23, 2017
  • 3 replies
  • 2857 views

I have a project I'm still maintaining in Frame 12, producing CHM files as the output using the Publish command.

I find that any thin space in my Frame source is getting rendered as an ordinary space in the Help viewer. Is this a limitation of that old Microsoft HTML Help Viewer not rendering thin spaces properly?  Or is Frame not bothering to write   entities in its HTML output? And if so, how do I make it do that? (I don't see anything obvious in the Publish settings).

    This topic has been closed for replies.

    3 replies

    Inspiring
    March 30, 2017

    Well, I did a Find & Change in my Frame12 source from "\st" to "\u2009",

    and created my HTML Help output,

    and viewing the CHM source in notepad, I see my Frame thin spaces are correctly encoded in the HTML as ampersand-hash-8201;

    Success!

    Unfortunately, the Microsoft HTML Help Viewer, being a lobotomised version of IE4 (or something like that) still doesn't render it anywhere near "thin" enough for my taste, but it's a slight improvement  

    Thanks for the tip, Stefan.

    Inspiring
    March 30, 2017

    When I have time later today, I'll try making the CHM in Frame 2017 (I'm currently using Frame12 for this, as the graphics break in 2017).

    If the problem is still there in 2017 then I'll raise a bug on the tracker.

    Community Manager
    March 30, 2017

    Please see my response above. With the correct Unicode thin space (u2009) it works in FM 2017 (and probably also in 2015, but I have not tested it).

    Please also note that there are a couple of old reserved characters in FM for backward compatibility like FM's own thin space (\st). That is, while \u2009 is stored internally as the real Unicode glyph, \st is stored as an FM special character.

    In FM 8 and above, I recommend to use only the correct Unicode character \u2009 (UNICODE THIN SPACE) and not FM's legacy \st anymore which is only there for backward compatibility with very old FM version (< 7.2).

    You can search for \st and replace with \U2009 if you want to change it globally

    By the way, the Unicode thin space \u2009 is not a non-breaking space. You might want to consider using the Unicode 202F ("NARROW NO-BREAK SPACE").

    Bob_Niland
    Community Expert
    Community Expert
    March 30, 2017

    I'd be tempted to implement instances of these as variables. It might at least make it easier to figure what they are later.

    Name: U+2009 THIN SPACE
    Def: \u2009

    Name: U+202F NARROW NO-BREAK SPACE
    Def: \u202f

    Does FM recognize 202F as non-breaking?

    Jeff_Coatsworth
    Community Expert
    Community Expert
    March 23, 2017

    You can do a quick test to see if CHMs are the cause by doing a test WebHelp output and having a look inside the HTML. I'd recommend looking inside the CHM's HTML files by decompiling the CHM (see Decompiling a Help File (Windows)  to do that) to have a look if your thin space appears in it.

    Inspiring
    March 23, 2017

    Ah fair point ...

    actually I just opened the CHM with 7-Zip and looked in the .htm files in Notepad.  It's putting an   in instead of a thin space.

    For example, I have a sentence in the Frame source like this:
    "Valid range is from 100 ms to..." (where I have used 'Esc space t' thin space in Frame to give a thin space between the '100' and the 'ms'

    In the CHM file this comes out as "Valid range is from 100<span class="hcp2"> </span>ms to..."

    No idea what "hcp2" class is, it's not something I defined.

    Jeff_Coatsworth
    Community Expert
    Community Expert
    March 29, 2017

    Character entity 160 is the non-breaking space.  (From the HTML 2.0 spec)

    The thin space character entity was added in HTML 4.0, in 1997. Twenty years ago. /facepalms gently/


    LOL - go find the bug tracker/wish list form back on the main FM forums page.