Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Setting font name  (Read 15494 times)
Douglas M.
Posts: 1


« on: April 07, 2010, 10:29:48 pm »

I've found I can set font size and attributes like bold and italics, but changing font name doesn't appear to have any impact.  Is there some setup I'm missing?

Server specs:
OS: Red Hat Enterprise Linux Server release 5.3 (Tikanga)
FGL: 2.21.01 build-1521
GRE: 2.20.06

Workstation specs:
OS: Windows XP SP3
GDC: 2.22.02
Reuben B.
Four Js
Posts: 1126


« Reply #1 on: April 08, 2010, 02:30:07 am »

Hi,

Apologies if this ends up as a double-post, IE crashed when I hit Post

What it could possibly be.. is have a look in $GREDIR/bin you will see two scripts fontinfo, fontinfopdf.  These lists the fonts that are installed on your machine.

If you run these scripts on your XP machine you are designing the reports on, and the Linux machine, the reports are being created on, you will get two very different results of the fonts available on the machines.  So you may find that a font such as 'Arial' is installed on your Windows PC, but is not on your Linux box.

If at run-time the font is not available, the GRE uses a series of fallback rules using font-family's until eventually it will use the system default font.

What could be happening is that in your report design you are specifying a font that is on your Windows PC but is not on the Linux box.

I know with one of my clients, their standard said all reports are Arial unless otherwise specified, and they found that on the Linux box Arial wasn't installed so they had to download and install this font onto the Linux box.

Hope that helps,

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Alex G.
Four Js
Posts: 155


« Reply #2 on: April 08, 2010, 09:27:22 am »

In the documentation there is a section "Fonts and Printers" in the "Design How-To" page that deals with this topic. Find the text pasted below.

Kind Regards,
Alex Geller
 
Fonts and Printers
Getting Font and Printer Information from your Server

Some scripts are provided in the <GRE-install-dir>/bin directory to get information about the available fonts and printers. These scripts are executed from the command-line:

    * fontinfo - lists the fonts available on your server
    * fontinfopdf - lists only the fonts that can be used in pdfs
    * printerinfo - lists the available printers

Tips on Installing common Fonts or new Fonts

The best results are achieved if the fonts on the server where Genero Report Engine (GRE) is installed, and those used in the Genero Report Designer, are the same:

    * If GRE and the Designer are installed on the same machine, there is no problem.
    * If GRE and the Designer are installed on different machines that have the same operating system and the same installed fonts, there is no problem.

A report that uses only a few positioned items will still layout correctly, however, even if the fonts used in the Designer and the fonts used in the GRE server differ:

    * If the server cannot find a specified font, it does not raise an error; it uses a fallback font instead.
    * If no font is specified, a default font is used.

Specify a font at the root of the document, to avoid potentially changing output when a new version of Java, or a different server, is used. In the Report Designer, set the font property for the Page Root node.

Not all fonts contain all possible characters: some fonts will not contain certain glyphs. In this case, GRE will attempt to take the missing characters from a different font that contains the glyphs. For example, the monospaced (fixed-width) font "Courier" does not contain graphics characters. If a report contains a grid that is drawn using graphics characters, GRE might substitute characters from a set that is not fixed-width, causing the layout to break. Avoid this problem by using a font like "Lucida Sans Typewriter", which is both fixed-width and contains the required characters.

Not all fonts can be used for embedding in PDF: the license flag contained in the font might prevent a font from being used. The utility $GREDIR/bin/fontinfopdf lists all fonts that can be used in PDF documents. While True Type fonts generally work, sometimes a Type 1 font will not appear in the list because it is available only as text (.pfa) but not as a binary file (.pfb). In this case, the binary font can be created by using font compilation tools such as pfa2pfb or t1binary from the t1binaries package.
Specific Font Types

Type 1 and Windows TrueType Fonts

Genero Report Engine is capable of reading both Type 1 and Windows TrueType fonts, so that it is possible to simply copy fonts from Windows to Unix. Since the TrueType directories differ from one Linux distribution to another, and between different Unix versions, it is possible to copy the fonts into the Java fonts directory $JAVA_HOME/jre/lib/fonts where they will be found by GRE. In order to check whether GRE sees the font you installed, run the executable $GREDIR/bin/fontinfo which lists all fonts.

Lucida family of Fonts

 SUN-Java contains a basic set of fonts (Serif, Sans Serif and Monospaced) in the "Lucida" family. Some distributions of the Java Runtime Environment do not contain all fonts, but it is legal to copy the fonts from one distribution to another as stated in http://java.sun.com/j2se/1.5.0/jre/README. These fonts contain a large part of the unicode characters.

The available codes are listed in http://java.sun.com/j2se/1.5.0/docs/guide/intl/font.html#lucida.

Liberation fonts

Another option for free fonts is the "Liberation" fonts originally provided by Red-Hat. These fonts have the same metrics (character width) as the Microsoft fonts Arial, Times New Roman, and Courier, and a similar look. These fonts can be installed on both Windows and Linux. A description of the fonts can be found at http://en.wikipedia.org/wiki/Liberation_fonts. The fonts can be downloaded at https://www.redhat.com/promo/fonts.

Asian Fonts

When using Asian fonts in PDF or SVG documents:

    * Set the fidelity property to "true" on any WORDBOX or WORDWRAPBOX using Asian characters.
    * For reports running in compatibility, set the parameter fidelity to "true" in calls to the API function fgl_report_configureCompatibilityOutput().

Make sure the specified fonts contain the required characters. The designer will display the characters correctly even though the selected font may not contain them; the runtime system does not have this behavior.
Jeff W.
Posts: 31


« Reply #3 on: April 13, 2010, 09:55:24 pm »

BTW, what is the System Default Font?  Is it universal across all/most OSs?
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines