Issue with System font in RTF documents

As preservation team of the National Archives of the Netherlands, we received a question. We want to ask you if you can help us find more knowledge about this issue. Perhaps you have encountered it before. You may even have a solution.

And: (how) would you document this issue, knowledge and/or solution in metadata?

Render issue

The issue is that some combinations of Microsoft Windows and Microsoft Word render some RTF text in the System font incorrect or not at all, see the area above the green text in the screen shots.

The RTF documents are e-mails exported as RTF, stored in an information system and downloaded for viewing in Microsoft Word. On initial display, the documents are rendered as expected. But as soon as you e.g. double-click the text in the System font, the issue occurs.

The issue reproduced in different environments.

We were unable to reproduce this issue in various other environments, ranging from other Windows and Word combinations to other document viewers, both on and offline. But our test was too ad hoc to conclude that the issue is limited to the environments mentioned. Or that it is an issue specific to those environments.

Possible explanations?

In cooperation with the colleagues who sent us the question, we came up with possible explanations for this issue.

One explanation is that the default system font might be corrupt or missing. The RTF instruction to use the System font is in fact an instruction to use the default system font. In this case the default Swiss font family font, Arial. When our colleagues investigated their font list and cache after googling ‘Windows 10 Arial font problem‘, and refreshed their font cache or re-installed the Arial font, the issue was sometimes – not always – solved. Also, using the Arial font directly (and not via an instruction to use the System font), did not seem to result in the issue.

Another explanation stems from the RTF markup itself. The document has the following RTF header (where we changed some values to make different fonts stand out more; business e-mails would e.g. not use the Comic Sans MS font):

{\rtf1\ansi\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 System;}{\f1\fnil Comic Sans MS;}{\f2\fnil Verdana color=#990099 size=2;}}

This header includes the XML-style “color=” and “size=” parameters. The size= parameter is suspicious. It would result in a font size of 1. The \fs command’s parameter is in half-points. Interpreting a font defintion with size=2 might also result in setting the font size to 1. That sounds like the small font issue. But it is defined for a different font and the color= parameter is not interpreted, so we think this is probably a red herring.

Your knowledge, experiences or solutions?

  • We want to ask you, if you have encountered this issue before. Perhaps you have experiences or knowledge to share, or documentation to point to. You might even have a solution for us.
  • We are also considering to document this issue in metadata. Perhaps, to keep it manageable, not at the individual file level, but at some higher aggregation. Would you document a possible issue like this? Where? How?

You can send your reponses to me: [email protected].

The RTF document

Feel free to save the following code block as an RTF document (a text document with a .rtf extension) and test if you can reproduce the problem in your environment.

{\rtf1\ansi\deff0{\fonttbl{\f0\fswiss\fprq2\fcharset0 System;}{\f1\fnil Comic Sans MS;}{\f2\fnil Verdana color=#990099 size=2;}}
{\colortbl ;\red0\green153\blue0;}
\viewkind4\uc1\pard\lang1043\b\f0\fs20 Van:\tab\tab Remco van Veenendaal
\par Verzonden:\tab\tab 29-2-2021 11:22:33
\par Aan:\tab\tab Digital preservation community
\par CC:\tab\tab 
\par BCC:\tab\tab 
\par Onderwerp:\tab Issue rendering RTF document with System font
\par 
\par \b0\f1\fs20  
\par  
\par \cf1\f2 Please help us find a solution for an issue when rendering this RTF document \cf0\f1  
\par 
\par >>> <TEST> 29-2-21 12:34 >>>
\par This document contains an e-mail saved as RTF document. (It is a real-world issue, not a hypothetical test case. The content has been changed. The RTF markup was preserved.)
\par In some environments this document has a rendering issue. The text that uses the System font - the e-mail heading and attachment line at the end - is invisible or is displayed in a small font size. E.g. in Microsoft Word 2016 on Microsoft Windows Server 2012 R2 (small size) or in Microsoft Word 2013 on Microsoft Windows 10 (invisible).
\par The issue may be related to a font cache issue. Try googling Windows 10 Arial font problem. The System font redirects to the default (Swiss font family) system font, often Arial. Refreshing the font cache or re-installing the Arial font sometimes solves the issue.
\par We also find the XML-style 'color=' and 'size=' instructions suspicious. Size=2 would result in a font size of 1, which sounds like the small font issue.
\par 
\par Do you have experience with this issue, and perhaps knowledge or solutions to share?
\b\f0\fs20 
\par
\par <<File: TEST.htm>>\b0\f1\fs20 
\par }

Update 2021-03-08, in response to the comments: below are two screenshots that my colleagues made of the document. First the normal situation, then the issue situation. (Please note that Word was configured to display some markup.)

The normal situation
The issue situation

1139
reads

8 Comments

  1. Francesco Pretto
    March 9, 2021 @ 6:41 pm CET

    I think the screenshot here possibly confirms my hypothesis: Word wants to use a scalable font, but instead the System font is a bitmap font, causing an hiccup in the rendering in some situations, possibly related to font matching algorithm and system configured locale, like I explained previously. I can reproduce similarly in a Russian language Windows, but the hiccup is temporary only for the time the document is downloaded from the internet with a “Block” attribute. As soon as the file is “Unblocked” the render issue disappear (see my previous comments). Actually the font picked for rendering in Word is not the “System” bitmap font. It’s probably a fallback San Serif font, like Helvetica Bold (in Word, just switch some other text to Helvetica and set it to Bold, they will look identical to the text marked with “System”). To reveal how is the bitmap “System” font looks like, try open the document with “WordPad” application instead. It should look like this[1]. You could try if the registry file in my previous comment fix the rendering hiccup in Word (it should still pick Helvetica there, unless you open the file with WordPad).

    [1] https://1drv.ms/u/s!AsCBX05aMOTUgaAmP4xnK-FJtzeWPQ?e=4cIVlr

  2. RvanVeenendaal
    March 8, 2021 @ 5:25 pm CET

    In response of the comments, we’ve added two screenshots of the RTF document. One of the normal situation and one of the issue situation. It may help you understand the situation better.

  3. Francesco Pretto
    March 6, 2021 @ 1:56 pm CET

    I may have a fix for you to render those RTF documents as intended, without changing the locale, in an affected system. First backup registry at [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts] and [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]. Then create the a registry (.reg) file with the following comment (I hope it will show it correctly here in the comments):

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]

    “SystemTypeface”=”8514sys.fon”

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]

    “System”=”SystemTypeface”

    “System,0″=-

    Save it and apply it to the affected system. and then reboot the system. This configuration create a logical font with the name “SystemTypeface”, using the original 8514sys.fon, and then create a substitution rule for “System” to the newly created “SystemTypeface”. At this point, if you open the file with Word it should show you a fallback scalable font instead of “System”, which it’s probably not the intended font when the document was produced. The problem here is that the “System typeface” font is a bitmap font, not a scalable one. If you instead open the RTF document with Wordpad, the latter will render the document with the (probably) intended bitmap font, unregarding of the locale setting (it worked in my wife’s Russian computer and in a quick test with a Dutch Windows installed from scratch). At this point you can either view the document in Wordpad or try to print the document with a real printer. If you try to convert it to PDF, the bitmap font will be probably replaced by a scalable one, at least that’s what I experimented with several tools. If you wants to batch save a lot of documents for preservation, keeping the original aspect of the bitmap font as intended, then it begins a new topic 🙂 .
    If you need to restore the registry, just delete the added keys in the .reg file, restore the backups and reboot the system. I hope all these instructions can help.

Leave a Reply

Join the conversation