Difference: UsingCustomFonts (16 vs. 17)

Revision 172014-06-15 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="APPXDeveloper"

Defining Custom Fonts

Line: 13 to 13
 

Custom Fonts on a Windows Server

Changed:
<
<
There are multiple ways to install and use a font on a Windows Server
>
>
There are two ways to install and use a font on a Windows Server
 

Install as Windows Font

The easiest way to include a custom font is to install the font on your Windows server. The steps to install the font will be different depending on the desktop OS release. The steps below are for Windows XP Professional.

Line: 33 to 33
 
  • Select Named Resources and define a resource with:
    • Select the ROLLOVER SELECTED state. If you are using Appx 5.2 or later, choose FONT instead.
    • Set the Location Type to SERVER FILE
Changed:
<
<
    • Enter the font name (not the .ttf file name) as the Location Data (Free 3 of 9 Regular, for example). Important: The font name is case sensitive, and it is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.
>
>
    • Enter the font name (not the .ttf file name) as the Location Data (Free 3 of 9 Regular, for example). Important: The font name is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.
 

Install Font in a Folder

Alternatively, you can install the font in a folder of your choosing, then tell the PDF printing software where to find the font. You will need to add an entry to the Windows registry which will provide a search path that APPX will use to find your font files. You can download one of the attached files at the bottom of the page (either 32 bit or 64 bit depending on your Windows version), edit the path and then simply double click the file to install the change in your registry.

Line: 49 to 49
 You will also need to define a Named Resource for each font file with the following attributes:
  • Select the ROLLOVER SELECTED state. If you are using Appx 5.2 or later, choose FONT instead.
  • Set the Location Type to SERVER FILE
Changed:
<
<
  • Enter the name of the font file without an extension in the Location Data field.

Install Font in a Folder (Method 2)

>
>
  • Enter the name of the font file without an extension in the Location Data field. Important: The font name is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.

Custom Fonts on a Unix or Linux Server

Follow these instructions to install a custom font. This should also work in APPX 4.2.x. This example will refer to the Free3of9.ttf bar code font.

  • Place the font file (Free3of9.ttf) in the Resource directory for one of your applications.
  • Log into APPX and select Application Design for the app you where you will be using the custom font.
  • Select Name Resources and define a resource with:
    • Select the ROLLOVER SELECTED state. If you are using Appx 5.2 or later, choose FONT instead.
    • Set the Location Type to DESIGN FILE
    • Enter the font file name without the extension as the Location Data (free3of9, for example). Remember that file names are case sensitive. The font name is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.

Install Font in a Folder (Platform Independant)

 
Changed:
<
<
An alternative mechanism is to create a PDFlib resource file that defines the searchpath. Here is a sample file:
>
>
An alternative mechanism is to create a PDFlib resource file that defines the searchpath. You can use this approach on either Windows or Linux. Here is a sample file:
 
Changed:
<
<
PS-Resources-1.0
>
>
PS-Resources-1.0
 
Changed:
<
<
SearchPath
>
>
.
 
Changed:
<
<
C:\WINDOWS\Font
>
>
SearchPath
 
Changed:
<
<
C:\MyCustomFonts
>
>
C:\MyCustomFonts
 
Changed:
<
<
.
>
>
.
 
Changed:
<
<
The file must begin with a line that says: PS-Resources-1.0
>
>
The file must begin with a line that says: PS-Resources-1.0, followed by line containing a single period.
 
Changed:
<
<
Then, each section begins with a resource name (in this case, SearchPath), followed by the values assigned to that resource (C:\WINDOWS\Font and C:\MyCustomFonts), and the section is terminated with a line containing only a period.
>
>
Then, each section begins with a resource name (in this case, SearchPath), followed by the values assigned to that resource (For example, C:\MyCustomFonts for Windows platforms, or /tmp/myfonts for Linux), and the section is terminated with a line containing only a period.
  The format of the resource file (along with a list of the resources you can define) is described in section 3.1.3 here: http://www.pdflib.com/fileadmin/pdflib/pdf/manuals/PDFlib-7-tutorial.pdf
Changed:
<
<
According to that document the resource file is read from the following search path:

$PDFLIBRESOURCEFILE (or %PDFLIBRESOURCEFILE% on Windows)

$PWD/upr

$PWD/pdflib.upr

$PWD is the current-working-directory of the Appx process: since that can be different for each user, we would recommend using the PDFLIBRESOURCEFILE environment variable (which you can set in the appx.env file).

Custom Fonts on a Unix or Linux Server

Follow these instructions to install a custom font. This should also work in APPX 4.2.x. This example will refer to the Free3of9.ttf bar code font.

  • Place the font file (Free3of9.ttf) in the Resource directory for one of your applications.
  • Log into APPX and select Application Design for the app you where you will be using the custom font.
  • Select Name Resources and define a resource with:
    • Select the ROLLOVER SELECTED state. If you are using Appx 5.2 or later, choose FONT instead.
    • Set the Location Type to DESIGN FILE
    • Enter the font file name without the extension as the Location Data (free3of9, for example). Remember that file names are case sensitive. The font name is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.
>
>
This file can be placed anywhere you like, and you must define the environment variable PDFLIBRESOURCEFILE to point at that file. We recommend setting the environment variable in the appx.env file.
 
Added:
>
>
You will also need to define a Named Resource for each font file with the following attributes:
  • Select the ROLLOVER SELECTED state. If you are using Appx 5.2 or later, choose FONT instead.
  • Set the Location Type to SERVER FILE
  • Enter the name of the font file without an extension in the Location Data field. Important: The font name is case sensitive on Linux platforms, and it is cached in your session. If you need to correct the name, log off & on again so Appx will pick up the new name.
 

Using the Font in Appx

  • On your image define a field and set these GUI Attributes:
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback