Skip to main content
Windward

Carrying template fonts to the generated report

You may also find useful Languages, Fonts & Locales.

 

Fonts on the Server

When you design a template you can make use of all the fonts on your system. But you also need those fonts on the server running the Windward Engine. 

If the font does not exist on the server, then the Engine will substitute a different font, that is on the server, when it performs the page layout. This will screw up the layout because you cannot turn this:

Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.

into this:

Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.

and have it look the same. If a font used in the template is not on the server, that will cause the soft line breaks in PDF reports to be wrong and text will be too short or too long in the generated report.

 

If you are creating a PDF with embedded fonts, this will work better. The substituted font will be used in the generated report. So the layout will look correct. However, if the user has the requested font on their system, they will still see the substituted font. And they may consider that incorrect.

You can set PDF reports to embed the fonts they use. This eliminates the issues in the next session. Be aware that some fonts have a licensing restriction that they cannot be embedded. If you try to embed a font with this restriction, the engine will throw an exception.

 

An Office template (DOCX, PPTX, XLSX) may have embedded fonts. However the Windward Engine cannot use them on the server as their use is restricted. OpenXML spec section 2.8 Fonts: (optionally) One or more embedded forms of the font for use on systems which do not have access to the font. When fonts are embedded, they are obfuscated to ensure that they are only used to view the contents of the document in which they are embedded, and for no other purpose.

You may also find Linux: Installing fonts useful.

Fonts on the User's Computer

If you generate a PDF report with embedded fonts, then the PDF will display correctly. And you can ignore the issues in this section.

If the server has all the fonts used in the template, the report is generated correctly and now is delivered to the end user. And they are displaying it on their system, which may not have some of the fonts in the report. Again, font substitution will occur.

 

For DOCX, PPTX, XLSX, & HTML reports, this substitution generally works pretty well. The programs will find the closest matching font. And it will then display the page using that font so all layout will be correct for the font used. You do however have the issue that the text will look different and that will impact the page layout.

 

For PDF this issue can have more problems. At a minimum text will run shorter or longer than expected. This will make the report look wrong. Even a substitution as minor as Helvetica for Arial will be off enough that the document will look wrong. And if Acrobat cannot find an acceptable substitution, it will display nothing, with a warning.

Font Appearance in a PDF or HTML Report

You have all the fonts used on the server and on the end user's computer. So everything will look identical - right? Unfortunately no. Every program renders fonts differently. So for PDF & HTML you will see very subtle differences in both the spacing between characters and the rendering of each glyph. You will also see slight difference when printing to different printers (try it sometime with a Word document).

 

Fortunately, these differences are so subtle that most people will not see them. The one place you may notice this is that page layout (soft line and page breaks) will be slightly different for PDF vs Office. (PDF generated from Office does not have this problem because it appears to Office as a printer and Office then places all text in the PDF file.)

Our Recommendations

We suggest the following to make this work best:

  1. Get every font used installed on the server. It may be a bit of work to find all the fonts you use for the operating system your server is using. But the effort is worth the eliminated ongoing hassle.
  2. If possible, restrict templates to using only the fonts that ship with Windows.
  3. For any non-standard fonts used in your templates, provide a link to download or purchase it.
  4. If you are producing reports for people outside of your corporation, and you are using non-standard fonts, generate PDF reports with embedded fonts.
  • Was this article helpful?