Ask Reuben – November 19, 2025

Default GRW Report Font

If I don’t specify any font properties for a report object, what values are used?

I hesitate to write this article at thie time as I know there is an enhancement coming in 6.00 and 5.01, so I will probably add an addendum to this article in about a months time.

When you place a report object on a report, most of the time you will not set a value for the fontName and fontSize properties.  The properties panel will look like …



… so the question you might ask yourself, what fontName and what fontSize are used?

The answer lies with three key design features you should be aware of Genero Report Writer and how you design your report.


Inheritance

If a report object property is not defined, the value is taken from the parent report object.  If the value is not explicitly defined on the parent object, repeat the process with the parent of the parent object, and so on.

If no ancestor object explicitly defines a value, use the Operating System default value.

So in the screenshot below from OrderReport.4rp in Tutorials & Samples, , the font values for OrdDateLbl1, if they are blank, the value will be taken from FirstOrderDetails.  If FirstOrderDetails is blank, the value will be taken from FirstPageHeader1.  If FirstPageHeader1 is blank, the value will be taken from CarriedForwardAndContent, and so on,

Finally if at the top if PageRoot is blank, the Operating System default value will be used.



Multiple Machines

If you look at the GRW Runtime architecture diagram that is available here , there are three servers involved in the design and production of reports.

  1. The machine where the report designer is sitting
  2. The server where Genero Report Engine is installed
  3. The machine where the report is being viewed.

Just because the designer selects a font from the drop down that appears on the server where they are designing a report is no guarantee that that font is installed on the server where Genero Report Engine is running, or on the machine that the report is ultimately viewed.

Fonts, Images, Sub-reports, you should be thinking just because this is on the PC I am designing the report on, are they on the server where the report is generated?


Fallback Fonts

When the Genero Report Engine or the tool you are using to view the report encounters a font that is not on that server, it will use what is called a fallback font.  That is the Java runtime has some configuration that says if a font cannot be found, it will use a specified alternative.

In more recent versions of Genero Report Writer, if you set GREDEBUG to debug your report, one of the messages output will indicate if a fallback font has been used.

You may have sometimes seen this fallback font with compatibility reports.  The fallback font was a proportional font when a compatibility report should use a monospaced font, and so you need to explicitly specify “monospaced” as the report in fgl_report_configureCompatibilityOutput.


Implications in Designing Reports.

The three features mean you should consider the following

  • Have a clear coding rule that says what fontName and fontSize is to be used for your report.  Have a standard that you will use in all your reports.  Don”t rely on the operating system default.  As fontName and fontSize cannot be defined in the root node of the report structure, this typically means that anytime you have a Page Root (MiniPage) (a MiniPage object with X-Size and Y-Size = max) then you should have a coding rule that says the fontName and fontSize properties are to be populated.  Most reports will only have one PageRoot but you will need to consider scenarios where there are two or more PageRoot objects.
  • As part of your installation routines, make sure that your required font is available on the server where Genero Report Engine is installed.  Don’t rely on each new server you deploy to have font that is your standard, make sure that your installation procedures will install that font if it is not present.  Be aware of the fontinfo (and fontinfopdf) command and what it can output for you.
  • A well designed report will typically have report elements arranged into Layout Node or Mini Page objects , so that the report object property is defined once in this parent object.  This parent need not have any visible properties.
  • Be aware of what the fidelity property can do.  My understanding is that instead of instructing printers or viewers to draw characters in a given font and size, instead an image is rendered.  You may have encountered this in the past if you could not copy and paste text from a report, that was because you were looking at an image!.
  • Be aware of the font embedding concept.  This includes the font files bundled inside the report files so that when viewed elsewhere it uses the font file inside the report thus guaranteting that the font is present. This comes at a cost of the size of the report file.

How can I quickly set a font inside each report?

If you are reading this and realising your reports have no fontName or fontSize specified and are using the operating system font how can you set a font or check that a font is defined?

You might consider :

  • if number of reports is low, create a task for your most junior developer to open every .4rp, set the fontName and fontSize property on every pageRoot node.  Sometimes this is the most cost effective method.
  • if you want to automate this, remember that .4rp is in XML format.    View using a text editor and make note of what changes.  The two lines below are a before and after of a PageRoot node without and with fontName and fontSize populated…


<MINIPAGE name="PageRoot" width="max" length="max">
to
<MINIPAGE name="PageRoot" width="max" length="max" fontName="Arial" fontSize="12">

… it is then a trivial exercise for a senior developer to write a program using the tool of your choice (can be Genero) that reads an XML file and checks that for every MINIPAGE node with width=”max” and length=”max” that it has a fontName and fontSize attribute specified.  If you are brave, a similar program can be used to add and populate the fontName and fontSize properties if they are missing.  The key is to do this step manually first and study the before and after in a text editor so that you add the attributes to the correct node, the attribues are spelt correctly, and the values are legitimate.

  • or else you might decide to wait for Genero 6 to see what the proposed enhancement in this area is.