How can I change the font in a chm file

Answer 1
You can decompile, modify, and recompile HTML Help (.chm) files with
Microsoft's HTML Help Workshop, which is available from here:

The decompilation process does not usually give you the project (.hhp)
file, which is needed in order to recompile the help file. Of the
available decompilers, the only one that is capable of regenerating the
..hhp file is KeyTools, available from here:


But... one important thing to note is that the decompile/recompile
process isn't a "round-trip" process. Certain features that the help
author added to the original help file can't be recovered when you
decompile it, so these may no longer work after you've recompiled. This
is especially true in the area of context-sensitive (F1) help, which
may be broken in the recompiled version of the file.

HTML Help files are inextricably bound up with IE because they use IE
as their "layout engine"; in effect, the topic pane of the help viewer
is an embedded IE window. However, if you modify the cascading style
sheets (.css) to which the help topics are linked so that they use
absolute rather than relative values, changes to the IE font settings
won't affect the display of help content. For example, you might
specify the style properties for

elements like this:

p { font-size: 10pt; }

rather than like this:

p { font-size: 90%; } or p { font-size: medium; }

When you decompile a HTML Help file, you'll usually find one or more
..css files among the output.

For what it's worth, I think that the amount of time and effort
required to modify more than a couple of help files greatly outweighs
any benefit you might derive from doing so. In other words, it's
something that you might try once and then give up on...

Answer 2
The chm font is changeable. It all depends on how the fonts are specified in the stylesheet of
the chm file. If you use fixed sizes in pix or mm (and you shouldn't), then
yes, the size can't be changed by the user. But if you specify it as
''size:small;" and everything else as relative, then it's changeable. Just
like any website.

Also, when you create your chm file, the chm compiler has a setting to add a
font size button on the menu. See for instance this file I created long ago:

Add font button to chm file:
Method 1
Just to add that, although Microsoft's HTML Help documentation and Help Workshop tool don't make any mention of it, it is possible to add a Font button to the toolbar of the HTML Help viewer. However, the technique requires you to edit the window settings in your HTML Help project (.hhp) file in a text editor, so I don't suppose that it will fit in very well with your H&M workflow.

See this article for details:


Method 2
Alternatively, you can open the .hhp file in FAR and add the button there.

Reference reading:


No comments: