Help with Font Mapping
When processing a job, one of the most common conversion errors results from a font mapping problem. For example, such a font mapping error with a typical PCL to PDF conversion processing in normal mode would output the following lines in the log file:
POS2216E Resource 'Helvetica' of type 'Type 1 font' not found.
(Searched: 'Helvetica.pfb;.\Helvetica.pfb;/psfonts\Helvetica.pfb;')
…
MCP2027F Error processing files (Rc = '1058')
MCP2001I Program stopped (Rc='2027')
In order to determine that is not a major problem with processing the job, the next step should be adding the "-relaxed" parameter to the command line. Often the job will run to completion with font mapping warning messages similar to:
PDI2005W Font 'Arial' (weight 'BOLD' style 'UPRIGHT' replaced with
'Default font')
PDI2005W Font 'Arial' (weight 'MEDIUM' style 'UPRIGHT' replaced with
'Default font')
These messages are informing us that the source fonts could not be found and that the conversion engine will make its best attempt to emulate the fonts. DocBridge generally does a good job of emulation but there will be small rendering differences. As a rule of thumb, it is always best to use the fonts directly from the source to be assured of best quality and performance.
In order to clearly pinpoint the fonts in question, use the "-fontentries fonts.xml" parameter. For example:
cpmcopy -i input.pdf -o -type nul -fontentries fonts.xml
After running this command line you have in the fonts.xml file the complete font mapping list:
<!-- Fonts from 'C:\Users\dale\Desktop\Compart\jobname' -->
<font family="Arial" serifstyle="SANSSERIF" spacing="PROPORTIONAL"
typeface="16602">
<face devname="Arial" style="UPRIGHT" weight="BOLD" width="NORMAL"/>
</font>
<font family="Arial" serifstyle="SANSSERIF" spacing="PROPORTIONAL"
typeface="16602">
<face devname="Arial" style="UPRIGHT" weight="MEDIUM" width="NORMAL"/>
</font>
These font entries in fonts.xml can be copied and pasted into a profile to specifically reference them (more on that later). First here is an easy way to get proper results if this is a small, simple job. Place the fonts
- arial.ttf
- arialbd.ttf
in the root directory (where the job was launched) this will most likely eliminate these messages.
The information below will be displayed when you double click on the arial.ttf font:
This will work if the font name from the log file (really it is coming from the input file) matches the font name inside these font files exactly.
There are three places a font name is referenced in a Compart conversion:
1. The font name as it exists in the input document - think "devname"
2. The font name as it exists logically inside the Compart engine - think font family
3. The font file on disk to use - think fontfile= fontfiletype=
So to convert from input document to output document the font name we read is assigned to the devname field and mapped to an internal name with font family field. When going to the output document the internal font name is mapped from the font family name to search for the file name specified in the fontfile= field with the extension coming from the fontfiletype= field.
If you want the conversion engine to search for fonts in a particular directory other than the executable root you must tell it by setting the resource search path in the profile. In this case we would enter the following string in the mffpcl.pro file:
<resourcelist>
..
<files path="c:\windows\Fonts" type="TrueType" extension="ttf"/>
..
<resourcelist>
In this example the typeface format was designated as TrueType because Arial is most commonly found shipping with Windows or in HP printers. If the font in question had been something like Helvetica commonly used in PostScript jobs we might have used:
<files path="/psfonts" type="Type1Font" extension="pfb"/>
However, if there are slight variations in the font name we may need to do more. Let's says there are two Arial TrueType fonts listed above and there is a reference to "ArialMT" in the conversion. In this case supplying the path to arial.ttf will not work because the names do not match exactly although this is most likely the same font. We can map the two fonts in the mffpcl.pro as shown below:
<font family="ArialMT" typeface="16602">
<face weight="MEDIUM" style="UPRIGHT" fontfile="arial"
fontfiletype="TrueType"/>
<face weight="MEDIUM" style="ITALIC" fontfile="ariali"
fontfiletype="TrueType"/>
<face weight="BOLD" tyle="UPRIGHT" fontfile="arialbd"
fontfiletype="TrueType"/>
<face weight="BOLD" style="ITALIC" fontfile="arialbi"
fontfiletype="TrueType"/>
</font>
You might have noticed the string: typeface="16602". This is used by PCL among other formats. In PCL the font is selected by number, not the font name string. The numbers are defined in HP's PCL Developer Guide manual.
So far we have been looking at fonts found on the input side of a conversion. If we are going out to a format that has different font handling properties like AFP, there are other things to consider. In general if the source font from an input file is included, nothing more is required, so the mffafp.pro file might include:
<font family="Arial" serifstyle="SANSSERIF"
spacing="PROPORTIONAL" encoding="T1WING">
<face weight="MEDIUM" width="NORMAL" style="UPRIGHT"
baselineincrement="1150">
<raster devname="C0A48410" size= "1"/>
<raster devname="C0A48420" size= "2"/>
<raster devname="C0A48430" size= "3"/>
<raster devname="C0A48440" size= "4"/>
</face>
</font>
The "devname" entry is allows us to map an input font name to an output font name and must be used for AFP. We can be even more specific if needed and map to specific point sizes:
<font family="Arial,Bold" serifstyle="SANSSERIF" spacing="PROPORTIONAL">
<face weight="BOLD" width="NORMAL" style="UPRIGHT" embed="never">
<raster size="6.48"devname="AR06BP" fontfile="AR06BP"
fontfiletype="xrx"/>
<raster size="7.98" devname="AR08BP" fontfile="AR08BP"
fontfiletype="xrx"/>
<raster size="9" devname="AR09BP" fontfile="AR09BP"
fontfiletype="xrx"/>
<raster size="10.02" devname="AR10BP" fontfile="AR10BP"
fontfiletype="xrx"/>
<raster size="10.98" devname="AR11BP" fontfile="AR11BP"
fontfiletype="xrx"/>
<raster size="12" devname="AR12BP" fontfile="AR12BP"
fontfiletype="xrx"/>
</face>
</font>
Note: Specifically regarding AFP there are a couple of other things to consider outside of mapping that are good to know. We have the ability to automatically generate AFP raster fonts, if input filter can provide raster data and there is no match in font list. See in the mffafp.pro file:
<fonthandling default="CONVERTTOAFP" ... />
Some AFP printers can handle 600 dpi images but only 300 dpi fonts. (600 dpi fonts are often supported if they are scalable fonts.) We have entries in the mffafp.pro to handle this different dpi condition. This of course all depends on the capabilities of the actual on site printer. For example:
Worked
- rasterresolution=600
- fontresolution=300
Did not work
- rasterresolution=600
- fontresolution=0 (default)
Contact support for any further font questions.