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

Monospace fonts in RoboHelp

Community Beginner ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Hi all,

I'm somewhat new to RoboHelp and I need your help in managing monospace fonts and different types of fixed spaces in code samples.

To be more specific: I have several code lines that display wonderful in FrameMaker 10 when set in a monospace font, such as Courier New or Lucida Console, as you can see below:

01_Frame.jpg

However, as soon as I import them in RoboHelp 9.0.1.262, it looks like the the fixed character width miraculously vanishes and no matter what other monospace font I use, the result is pretty much the same, i.e. the lines (and "faux columns") are no longer aligned:

02_RH.jpg

I tried using the Frame object via Insert > HTML > Frame > Frame, but the result is exactly the same.

Moreover, when I try to tweak the space amount by replacing the regular blank "&#160" with (fixed) en-dash spaces " " or hairspaces " " in the HTML source, as shown below

03_HTML_Code.jpg

it looks like RH is not able to recognize the codes:

04_HTML_Output.jpg

So, did anyone face a similar challenge? Any idea about how to fix this would be more than welcome!

Thanks,

Razvan

Views

562

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

Community Beginner , Mar 24, 2016 Mar 24, 2016

Amebr,

Thanks for the tip! I've found something even better - the <pre> tag

Actually, it was a two step move:

1. In RH HTML View, I've manually put the code within <pre>... </pre> tags (the blanks are also magically 'normalized'):

06_PRE.jpg

2. In the same RH HTML I've "colorized" the line I've needed highlighted by using <font colour=...>, as my character tag is overwritten by the <pre> tags:

The HTML result is this beautifully aligned and highlighted code sample, which, by the way, displays properly in RH De

...

Votes

Translate

Translate
Community Expert ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Do you mean code that is part of a topic when viewed in Design View or the HTML code when displayed in HTML View?

If the latter, I think you are pretty much tied to Courier and Lucida and at 100% view. I tried many other fonts but those were the only two that were reliable.

Not sure about Design View but I can look if that is what you meant.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

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 Beginner ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

Peter,

Yes, I have a file/topic that has Title Para Para Para [...] then these lines of code inserted as Frame (RH object, that is), in Design View - the two grey screenshots above are taken in Design View.

When switching to HTML View and trying to replace the spaces, in Design View I get the same messy alignment.

And when I actually generate the Webhelp output, it's getting even worse, as all the blanks between my 'faux colums' dissapear (which makes sense, since HTML removes multiple blanks...).


So, is there a fix to this?

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 ,
Mar 23, 2016 Mar 23, 2016

Copy link to clipboard

Copied

I tried entering the text manually in RH using the <code> tag, and also with a paragraph style set to use monospace and both seemed to go in okay (without having to manually add &#160;. RH doesn't understand anything much beyond    ). Can you perhaps wrap your text in Framemaker in the html <code> tag, as maybe the spaces are being stripped in the import process, and RH might honour the code tag better?

I haven't used Framemaker at all, so these are just thought experiments.  Otherwise, perhaps you can paste fro Framemaker into Notepad and then into the RH topic, assuming there aren't too many code samples needed and that the spaces aren't stripped in the copy paste process.

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 Beginner ,
Mar 24, 2016 Mar 24, 2016

Copy link to clipboard

Copied

Amebr,

Thanks for the tip! I've found something even better - the <pre> tag

Actually, it was a two step move:

1. In RH HTML View, I've manually put the code within <pre>... </pre> tags (the blanks are also magically 'normalized'):

06_PRE.jpg

2. In the same RH HTML I've "colorized" the line I've needed highlighted by using <font colour=...>, as my character tag is overwritten by the <pre> tags:

The HTML result is this beautifully aligned and highlighted code sample, which, by the way, displays properly in RH Design View too (see the screenshot below). By the way, I have a hunch that this will also nicely publish in PDF

07_OUTPT.jpg

The only problem is that this works for occasional use of code samples. For longer chunks, I guess it would be somewhat cumbersome.

Razvan

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
LEGEND ,
Mar 24, 2016 Mar 24, 2016

Copy link to clipboard

Copied

LATEST

Perhaps you have already figure this bit out, but if you select some of the text you need to surround with the pre tag. When you change to HTML view that same text is highlighted so it gives you an easy frame of reference as to the general area where the tag needs to go.

Cheers... Rick

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
Resources
RoboHelp Documentation
Download Adobe RoboHelp