Since version 6.6 we changed the technologies that we are using for printing and have replaced the farmerswife PDF creation with a built-in printer, where you before would print using your computer installed PDF printer.
This change could affect the reports and PDFs that you generate from farmerswife
Issues that you can experience are
- Selected font is not displayed correctly in the report print designer preview
- The printed PDF has the wrong fonts
- You get an empty PDF and a PS file.
The solution is to use the new functionality Scan Fonts. Hopefully this fixes all problems, ie that you get the correct font both in the report print designer and on the printed PDF. If this however only fixes the first point and you still get the wrong fonts on your printed PDF, the solution is to add a csv file to your server system folder.
IMPORTANT: The font format in your fonts library be format True Type.
This article describes how to do this.
Reports can be generated both on your farmerswife desktop client and on the server. Server side printing happens when you use functionalities to attach a PDF to emails sent from farmerswife, or when sharing reports to the Web client and iOS. Font scanning is therefore important both for the farmerswife client and on the Server. The absolute first step is of course to check that you have the font installed on your computer and for server side printing also on the server.
The “Scan Fonts” functionality allows farmerswife to correctly read the fonts you have installed on your client or server machine. In most cases, default system fonts will work without a scan, but if you have installed special fonts farmerswife might not be able to use these until you run the scan.
Font scanning on the
Server: On server initialization, after an upgrade or the nightly scheduled server restart, there will be an automatic font scanning if there has previously not been a fully completed font scan process on the server. It is also possible to run a server font scanning via the Toolbox in the desktop client.
Client: First time you run a report you will get a question to scan fonts. If you select not to, you can later do it from the Toolbox. Font scanning is a one time process for each user.
Font scanning when generating a PDF
In the process of generating your first PDF after upgrading to 6.6 SP1 or later, you will get a popup asking you to run a font scan. If you select "Skip Scan For Now" and you then realise that you need to scan your fonts, you can do it later from the Toolbox.
Font scanning from the Toolbox
In Toolbox > Settings > Miscellaneous > click on the button Scan Fonts
If you have User Permission "Server Setup" you will be able to start a font scan for the Server. You can select Cancel or Confirm. After clicking on cancel or confirm a second popup shows where you can select to start a Client side font scanning. The scanning process takes less than a minute.
When this process is done your fonts should be displaying correctly in your report template.
If fonts do not print correctly on the printed PDF - use a fontmap.csv to map the fonts
It can happen that even if all looks good in the print designer preview, that your printed PDF does not have your selected font . In these cases the default font that will be printed is Arial. To fix this you can add a fontmap.csv file to the server system folder, this is a one time process. Please contact email@example.com for help. If you want to give it a go yourselves please see the description on how this works below.
If you host the farmerswife server you will need the help of the system admin / person that maintains your farmerswife server. If your server is cloud hosted contact firstname.lastname@example.org.
Creating the fontmap.csv
In the fontmap.csv you will need one line for headers and one line for the font you are mapping.
The structure of the fontmap.csv consists of the font name and 4 positions delimited by a comma:
fontmap line 1 > Font name,Regular suffix,Italic suffix,Bold suffix,BoldItalic suffix
fontmap line 2 > The post script name of the fonts and the corresponding suffixes (ie for regular, italic etc)
(A fontmap.csv is attached to the article
Each position represents the font styles Regular, Italic, Bold, BoldItalic. These are the font styles you can set by ticking the corresponding checkboxes in the print designer Edit window.
(If you in previous farmerswife versions had selected various styles in the font selector, you will now only find the font family name, and be able to use the check boxes to create the corresponding font styles.)
Step by step examples
Check the font name in your farmerswife Print Designer
In Mac you can easily find the post script name in the Font Book, (while Windows Font manger does not show the name - you can find it in your computer*). Open your Mac "Font Book" application, and locate your font. Click on the Information (i) on the top left to see the details of the font.
Check the "PostScript name" for each style of the font which can be selected in the Print Designer: Regular, Bold, Italic and Bold+Italic
Example Avenir Next
We are looking for the -suffix in each font style, ie Regular, Italic, Bold and BoldItalic:
For our Avenir Next example the PostScript font name is AvenirNext. This name is added in the position of Font name in the fontmap.csv. This name will be combined with the post script suffixes of the the other styles. So if the Font name is AvenirNext the regular suffix as you will see below is -Regular (including the -). The font is mapped by combining Font name + suffix = AvenirNext-Regular.
Font name: AvenirNext
Regular suffix: -Regular (The PostScript name is AvenirNext-Regular, we therefore need AvenirNext in the position of the Font name, and in the position of Regular we add "-Regular", including the "-" this way the font name and suffix are mapped together as AvenirNext-Regular)
Italic suffix: -Italic (PostScript name is AvenirNext-Italic, therefore in the position of Italics we add the suffix "-Italic")
Bold suffix: -Bold (the PostScript name is AvenirNext-Bold, so in the position of Bold we add "-Bold")
Bold Italic suffix: -BoldItalic (The PostScript name is AvenirNext-BoldItalic, so in the position of BoldItalic we add the suffix "-BoldItalic")
The completed fontmap.csv will be
Font name,Regular suffix,Italic suffix,Bold suffix,BoldItalic suffix
Example Aller - no suffix for Regular
Take a look at the PostScript name for each position.
The PostScript name for Regular is Aller, ie there is no suffix. The other styles have a suffix to the PostScript name.
As there is no suffix for Regular we will leave the position of Regular in the csv empty.
The fontmap.csv will in this example be
Font name,Regular suffix,Italic suffix,Bold suffix,BoldItalic Suffix
As you see we have not added anything between the first and second comma.
Add the fontmap.csv to your farmerswife Server
- Quit the server.
- Add the fontmap.csv to your farmerswife server system folder
- Restart the server
- When you reconnect the farmerswife client font should map correctly to your printed PDF. If not please contact support.
We continuously update farmerswife to natively support non-standard fonts that you report to us.
Attached a template fontmap.csv
The supported non-standard fonts by default from 6.6 SP1 are listed below. The list below also gives examples of how fontmaps with font name and suffixes can look:
FreeSans,,Oblique Bold BoldOblique
GillSans,,-Italic -Bold -BoldItalic
DIN Condensed,,,-Bold, Effra,-Regular,-Italic,-Bold,-BoldItalic
PF Handbook Pro,-Regular,-Italic,-Bold,-BoldItalic
TW cen MT,,,-Bold,
*Paths to find the Fontmap.GS file on your machine
When you run a font scan a file in your Farmerswife folder is created or updated. This file contains the PostScript names. To find the PostScript name, especially on Windows, it can be very helpful to use this Fontmap.GS file. Below are the paths to find this file. Your IT/Systemadmin will know how to find them.
Path to find fw Server side Fontmap.GS on Windows:
C:\Users\Username\AppData\Roaming\Farmers WIFE Server\Fontmap.GS
Path to find fw Client side Fontmap.GS on Windows:
Path to find fw Server side Fontmap.GS on Mac (in Finder go to “Go” menu and use “alt/option” keyboard key and choose “Library”; this will result in this path:
/Users/Username/Library/Application Support/Farmers WIFE Server/Fontmap.GS
Path to find fw Client side Fontmap.GS on Mac (in Finder go to “Go” menu and use “alt/option” keyboard key and choose “Library”; this will result in this path:
/Users/Username/Library/Application Support/Farmers WIFE/Fontmap.GS