Knowledge Base

Automatic Font Replacement

Problem

Using internal printer fonts is mandatory when using printer internal counters, date, and time.

When you print your labels on a different printer from a different, your selected fonts might not be available on your new printer, especially when the newly selected printer is from a different manufacturer. Your new printer probably supports an entirely different set of internal fonts. The fonts may look alike but are available under a different name.

Similar problems may occur when TrueType fonts you use on your labels are not installed on your target machine where NiceLabel Automation prints labels.

You can configure NiceLabel software and Web Printing clients to automatically replace the fonts used on your labels with compatible fonts. You can configure font mapping based on font names. When your original font is not found, NiceLabel tries to use the first available replacement font defined in your mapping table. If NiceLabel does not find a suitable replacement, Arial Truetype font is used.

NOTE: If you configure font replacement, your mapping rules execute when you change the printer on your label.

Solution

To configure custom font mapping:

  1. Open File Explorer and navigate to the following folder:

    For NiceLabel 2017:
    %ProgramData%\NiceLabel\NiceLabel 2017

    For NiceLabel 2019:
    %ProgramData%\NiceLabel\NiceLabel 2019

    For NiceLabel Web Clients:

    If you installed your web client:

    %userprofile%\AppData\Local\NiceLabel\NiceLabelWebClient

    If your administrator installed your Web Client with the ALLUSERSINSTALL command-line switch: 
    %ProgramData%\NiceLabel\NiceLabelWebClient

    NOTE:
    Your path may vary depending on your installation.

  2. Copy your fontmapping.def file to fontmapping.local.def.
  3. Open your fontmapping.local.def file in your text XML editor.
  4. Inside the element FontMappings, create a new element with a custom name.
  5. Inside your new element, create at least two elements with the name Mapping.
    • The value of the first Mapping element must contain the name of your original font.
    • The value of the second Mapping element must contain the name of your replacement font.

You can add additional Mapping elements with new font names. If the first replacement font is not available, NiceLabel tries the next. If no replacement fonts are available, NiceLabel uses Arial Truetype instead.

NOTE: Your fontmapping.local.def file is preserved during upgrades while fontmapping.def is overwritten during upgrades. Do not modify fontmapping.def.

Sample Mapping Configuration

This example defines two mappings:

  • The first mapping (see AveryNovexx XML element) converts any Avery font into a matching Novexx font. For example, the font Avery YT100 is replaced with Novexx YT100, and Avery 1 is replaced with Novexx 1. If the Novexx font is not available, NiceLabel uses Arial Truetype.
  • The second mapping (see TextReplacement XML element) converts Avery YT100 into Novexx YT104. If that font is not available, then the Zebra 0 font is used. If that font is also not available, Arial Truetype is used.
  • The second mapping overrides the first one.
<?xml version="1.0" encoding="utf-8"?>
<FontMappings>
    <AveryNovexx>
       <Mapping>Avery</Mapping>
        <Mapping>Novexx</Mapping>
    </AveryNovexx>
    <TextReplacement>
        <Mapping>Avery YT100</Mapping>
        <Mapping>Novexx YT104</Mapping>
        <Mapping>Zebra 0</Mapping>
    </TextReplacement>
</FontMappings>

Print document   Email document

Feedback

Did this article help you? *