Oracle Webforms and font mapping


Just a little sample how to bring custom fonts to webforms. In Oracle Webforms you have 2 mappings of a font. The first mapping is done on the Server where you bring the application font name to a logical font name. The second font mapping is done on the client where you convert the logical font name to a physical font.

Small example:

We want to show a barcode font in the forms mask. The barcode form is not correctly converted to the right client font, so all we see is a plain text.

f1_1
Next go to your server and check your application font name. If you are not sure which name is used in the form, you can convert it to a FMT (Textformat).

You should found something like that.

DEFINE  F50T
BEGIN
   TP = 14
   TI = 11
   TN = 103
   TV = <<"Barcode C128 18">>
END

Edit your Registry.dat file. This file is located in $DOMAIN_HOME/config/fmwconfig/servers/WLS_FORMS/applications/formsapp_11.1.1/config/forms/registry/oracle/forms/registry/Registry.dat

If you have not modified your serverApp Parameter (located in formsweb.cfg) then you should use the default Parameter. If you change the serverApp Parameter you can make different mappings for production or development.

Example of a Registry.dat file, where we map our AppFont  to a logical JavaFont at the end of the parameter line. The beginning of the Line represents the value of the serverApp Parameter.

default.fontMap.appFontnames=Courier New,Courier,courier,System,Terminal,Fixed,Fixedsys,Times,Times New Roman,MS Sans Serif,Arial,Barcode C128 18
default.fontMap.javaFontnames=MonoSpaced,MonoSpaced,MonoSpaced,Dialog,MonoSpaced,Dialog,Dialog,Serif,Serif,Dialog,SansSerif,Barcode C128 18

Next we must make a mapping on the Client. If you have installed default Oracle Java Runtime you will find a sample file for that. Look for the file $JRE_HOME/lib/fontconfig.properties.src and copy it to $JRE_HOME/lib/fontconfig.properties

Add a line to the file like that. A documentation can be found here.

Barcode C128 18.plain.alphabetic=Barcode C128 18

Here you will make the logical mapping to a physical client font (right side)

If you have all done right you will see the barcode in your webforms.

f1_2

As always comments are welcome

Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s