Document-ID: 28397.1
Subject: WIN: FONT ALIASING AND DEFAULT FONTS
Author: PSOMAL
Last Revision Date: 18 December 1996
WIN: Font Aliasing and Default fonts
Font aliasing is a feature used to map fonts. Font aliasing is achieved
by modifying the UIFONT.ALI file. Default fonts may be set in Oracle Forms 4.5
by using the FORMS45_DEFAULTFONT parameter in the ORACLE.INI.
This document describes both these features and is meant to be a supplement
to the information provided in the CDE2 for Windows Installation Guide.
The ORACLE.INI is normally created in the MS-Windows home directory, and is
pointed to by the ORA_CONFIG parameter in the WIN.INI.
FONT ALIASING:
==============
This feature allows the user to substitute one font for another and is used
primarily when porting applications. For example, when porting an application
designed under Motif to MS-Windows, font aliasing may be used to map
Helvetica to a font available on MS-Windows. Font aliasing is achieved
by modifying the UIFONT.ALI file.
Font aliasing can also be used to map fonts at runtime. In this
case, the application may be designed using a particular set of fonts.
To migrate the application onto a deployment machine simply use the font
aliasing file (UIFONT.ALI), if required. This file maps the fonts used
by the application when Oracle Forms runtime is used to run the application.
The font aliases used in the UIFONT.ALI file also map the fonts used
by other CDE tools like Oracle Reports. The focus of this bulletin
is font aliasing in Oracle Forms.
Using the font aliasing feature in Oracle Forms 4.5.5.3.5 changes the font of
boilerplate text only. Even though the font for text items shows as being
mapped in the canvas view, at runtime the fonts for these items are not
changed. This problem has been fixed in the later version of Oracle Forms
(version 4.5.6). Thus, using font aliasing in Oracle Forms 4.5.6 maps the
fonts for all the text within the form.
Note: Below, C:\ORAWIN is assumed to be the subdirectory where Oracle products
are installed.
SETTING UP FONT ALIASING:
=========================
To map or alias fonts the desired font mapping is specified in the UIFONT.ALI
file. The default location of this file is the C:\ORAWIN\CDE2
subdirectory. To alias a font an entry similar to the following is made
in the UIFONT.ALI file:
source_font = destination_font
For example:
/* To replace all Helvetica fonts by Courier New */
Helvetica = "Courier New"
/* To replace all 14 point MS Sans Serif fonts with a 10 point Courier font */
"MS Sans Serif".14 = Courier.10
The size, style, weight and width of the font can also be mapped.
The entire specification of a font is
<Face>.<Size>.<Style>.<Weight>.<Width>.<CharSet>.
For a list of all recognized names for the style, weight and width parameters
refer to the UIFONT.ALI file. If a part of the specification is not required
in the mapping it may be omitted. In the following example the style is
omitted.
Arial.10..Bold = "Times New Roman".14..Regular
For more information on specifying a font refer to
(1) CDE2 for Windows Installation Guide, Chapter 2 - Using Oracle Forms.
(2) The UIFONT.ALI file.
Notes:
* If a font name includes spaces, it must be enclosed within double quotes.
* The font name must be specified exactly. A useful method to ensure that
the font name has been specified exactly is to bring up the font dialog
box within Oracle Forms designer (Format-->Font item in the menu) and note
the font name.
To illustrate font aliasing follow the steps listed below:
(1) Create a default block based on a database table such as EMP.
(2) Bring up the canvas created. Then select all the items on the canvas by
choosing the menu item Edit-->Select All.
(3) Use the menu item Format-->Font to change the font of all the items
selected to "Courier New".
(4) Save this form as say emp.fmb.
(5) Exit Oracle Forms designer.
(6) Edit the UIFONT.ALI file and add the following:
[Display]
"Courier New" = Arial.14..Bold
(7) Bring up Oracle Forms designer, and open the form created above (emp.fmb).
Navigate to the canvas, all the fonts should now be changed to Arial with
a size of 14 and a weight of bold.
When migrating an application from another platform (say Unix to MS-Windows),
it is a good idea to determine the exact font mapping string by first
creating a sample form as above on Unix. Then use the UIFONT.ALI file
to map the fonts and bring the form down to the MS-Windows platform. Once,
you have successfully mapped the fonts for a sample application, you may
migrate your main application easily.
LOCATION OF UIFONT.ALI:
=======================
The location of UIFONT.ALI may be changed as follows. These changes may be
required if Oracle Forms is installed on a LAN and each user wants to modify
the UIFONT.ALI file.
(1) Copy the file to the working directory (the working directory is set in
the program item properties). Oracle Forms picks up UIFONT.ALI from the
working directory. However, you must make sure that the file is removed
from the default location C:\ORAWIN\CDE2, since Oracle Forms looks in the
default directory first.
(2) UIFONT.ALI can also be placed in another directory, add that directory to
the TK21 parameter in the ORACLE.INI.
The file is picked up from the first directory in the path,
so it can be left in the default location.
For example:
TK21=C:\ORAWIN\CDE2 (original)
Change it to:
TK21=C:\TEMP;C:\ORAWIN\CDE2 (if the UIFONT.ALI is in C:\TEMP)
FONT MAPPING VERIFICATION:
==========================
FONTCHK.EXE can be used to verify that the UIFONT.ALI file is correct. This
executable can be found in the C:\ORAWIN\BIN subdirectory. Note, if
Oracle Forms 4.0 is also installed in the same location, then FONTCHK will
parse the UIFONT.ALI in the default location for Oracle Forms 4.0
(C:\ORAWIN\DBS).
To change this behaviour execute FONTCHK by giving it an argument that contains
the location of the UIFONT.ALI (example C:\ORAWIN\CDE2\UIFONT.ALI).
To illustrate how FONTCHK works make the following erroneous entry in
UIFONT.ALI:
"Courier New" = Arial..Bold
Now run FONTCHK, choose FILE-->RUN from the MS-Windows program manager
menu options and type:
FONTCHK.EXE C:\ORAWIN\CDE2\UIFONT.ALI
FONTCHK will report a font alias error at the erroneous line.
TIP:
====
Remove UIFONT.ALI if font aliasing not required. If you do not utilize the
ability to alias fonts within your applications
removal or renaming of the UIFONT.ALI file will slightly improve the startup
performance of your applications.
In the case of an application using a font that is not available, Oracle
Forms will select and use a font that is similar to the unavailable font.
Therefore, when porting an application be careful while mapping the fonts.
DEFAULT FONT SETTINGS:
======================
The FORMS45_DEFAULTFONT parameter can be set in the ORACLE.INI to
specify the default font used in the Oracle Forms Layout editor.
Example:
FORMS45_DEFAULTFONT = "Courier New".8
If this parameter is not set the default font used by forms is Fixedsys.
FORMS45_DEFAULTFONT can be set to a monospaced font only. Thus, the only
fonts accepted by the layout editor (besides fixedsys) are:
o Courier
o Courier New
o Terminal.
If a monospaced font is not used then Oracle Forms will select and use the
monospace font similar to the font specified.
The rules used for specifying the fonts are similar to those described
in the discussion on font aliasing.
Once this parameter has been set in the ORACLE.INI, all items (base table
items as well as boilerplate items) in new forms take on this font. In
existing forms, only the base table items take on the default font. The
font for the boilerplate items remains unchanged. In order to change the
boilerplate item font, select all the items and change the font. Once the
font for any existing boilerplate item has been changed, the font for new
boilerplate text will be the default font specified in the ORACLE.IN. However,
if you add any boilerplate text without changing the font of any existing
boilerplate item, the new text will have a default fixedsys font.
Using both UIFONT.ALI and FORMS45_DEFAULTFONT can lead to conflicts. The
solution is to use one of these methods or to make sure that the font used
as the default font is not aliased in the UIFONT.ALI file.