Oracle9i Reports - Technical Article

PDF in Oracle9i Reports

Technical Article
August 2002

 

Summary

According to Adobe, Portable Document Format (PDF) is the open de facto standard for electronic document distribution worldwide. Adobe PDF is a universal file format that preserves all the fonts, formatting, graphics, and color of any source document, regardless of the application and platform used to create it. Oracle Reports was one of the first report generation tools to embrace this technology and generate PDF documents.

This article will provide an overview of the Oracle9i Reports PDF enhancements, which include compression, font aliasing, font subsetting, font embedding and accessibility tags. Each feature section contains information on setup, sample output, tradeoffs and troubleshooting.

Additional technical and product information about Oracle9i Reports can be found on Oracle Technology Network (OTN). 

Contents

Back to Top

Overview - New PDF features for Oracle9i Reports

The Oracle9i Reports upgraded PDF driver produces PDF output v1.4. This provides for enhanced compression, font aliasing, font subsetting, font embedding, and accessibility tags. Let's take a closer look at these enhancements:

    • Compression - Oracle9i Reports takes advantage of PDF’s enhanced data compression. This means smaller PDF file, making viewing and downloading quicker. The amount of space saved using compression varies based on the contents of the report for items such as the number of images versus the amount of text. By default, PDF output from Oracle9i Reports will be compressed. Compressed files are about one fifth the size of the original file. Compression is automatically turned on when running a report, but can be switched off or varied with command line options. There are many factors to take into account when looking at the compression ratio. Items like images are typically already compressed, so any report containing a large number of images will probably not see as much compression as those without images. Large amounts of highly formatted data can achieve higher compression rates, although actual compression rates will vary for each report. Testing has shown that the best case compression ratio of 1/8th to the worst case compression ratio of 1/2 was achieved based on the contents in the original file using the FlatDecode compression algorithm.

    • Font Aliasing - Font aliasing on the system level has been available for some time in Oracle Reports. Now Oracle9i Reports can alias fonts for PDF output just as it can do for bitmapped output. PDF font aliasing works with numerous font types and provides the flexibility necessary for professional looking output. Font aliasing can be used to generate PDF documents that have a standard look and feel. Since PDF is frequently used for printed output, standardized fonts allow for very precise formatting on a page. For example, if a corporation develops a standard font to be used for PDF output but they also produce many other report output formats that require different fonts, then the report developer can simply set the uifont.ali file to enable the use of existing reports to create the PDF output in a standard font such as Arial. Of course, this assumes that each machine viewing the report has the Arial font installed, which is practical in companies where there is tight control over the equipment and software installed.

    • Font Subsetting - Font subsetting is a way of including the fonts into a document. Only those fonts actually used in the PDF report output are contained within the document itself. Oracle9i Reports can subset a font into the PDF report output. When viewing with the Adobe Acrobat reader, you will see that Adobe actually creates a custom font so that it is uniquely identified (remember it is only a partial set of the original font). This reduces the reliance of having the font installed on every machine where the report may be run. This guarantees a standard look and feel for the report no matter where it is distributed and makes the report fully portable. Note: font subsetting in Oracle9i Reports is only supported for TrueType fonts.

    • Font Embedding - Font embedding is a way of including the entire font set into a document. Oracle9i Reports can embed fonts into the PDF report itself. This reduces the reliance of having the font installed on every machine where the report may be run. This guarantees a standard look and feel for the report no matter where it is distributed. Note: font embedding in Oracle9i Reports is only supported for type1 single byte fonts. Also be aware that there may be licensing restrictions on fonts that are embedded within a PDF document. Please check with the font vendor to comply with any licensing agreements necessary.

    • Accessibility - Oracle9i Reports takes advantage of Adobe's feature in PDF 1.4 to permit screen readers to "read" PDF documents with Adobe acrobat reader 5.0 and an accessibility plug-in. Using the specified tags, PDF becomes accessible for screen readers. For more information on this subject, see the "Creating Accessible Enterprise Reports using Oracle9i Reports" white paper on http://oracle.com under accessibility.

Back to Top

Compression

DESCRIPTION

PDF compression reduces the size of the PDF output file. This is important if you want to view the report over the Web, because of the smaller file size, the report is displayed quicker than a larger file. Oracle9i Reports has implemented a command line option to control compression for PDF output.

SETUP

PDF compression is turned on by default. It is controlled by using the command line option PDFCOMP={any value 0 through 9) OR {YES|NO} .

The numbers 0 though 9 control the amount of level of compression applied to the PDF output. A value of 0 means PDF output will not be compressed. A value of 9 means that maximum compression will be applied. The values of 1 through 9 gives the user a maximum amount of control over the amount of compression that will be applied to the PDF output. A value of 1 corresponds to faster performance but minimum compression, while a value of 9 corresponds to slower performance with maximum compression.

A value of YES equates to a compression numeric value of 6, which is the default and was derived by testing various types of PDF output. A value of NO equates to a compression numeric value of 0, which means no compression will take place.

The PDFCOMP command line option can be used with any of the following commands: rwclient, rwrun, rwbuilder, rwservlet rwcgi.

SAMPLE

Here is look at the file sizes of the same report with compression ON and OFF. There is about a 50% reduction ratio here, but this varies depending on the size and content of the PDF output. Also shown is the content of this PDF output, which is basically text.

 

 

TRADEOFFS

The tradeoff is size versus speed. If size is the greatest concern, without regard to the amount of time it takes to run and compress the report, then set the value of PDFCOMP=9. If performance is the greatest concern, without regard to the to size of the report, then set the value of PDFCOMP=0. The various levels inbetween provide an incremental approach of exchanging speed and size. This is best determined by trying various combinations. Keep in mind that the compression rate is dependent on the content of the report and for this reason, both the speed to generate and the size of the output will vary by report.

Advantage: smaller file size, which enables quicker downloads and faster viewing.

Disadvantage: performance is slower to generate a compressed file compared to a non-compressed file.

TROUBLESHOOTING

There is no scientific measure of the ratio since a report can contain a mixture of objects, primarily text and images, which may already be in a compressed format. For this reason, compression will vary by report and this is expected behavior. Be aware of the tradeoffs between speed and size. Also, remember that compression is ON (6) by default, so if a report is run without specifying a compression value, then later run with PDFCOMP=YES, there will be no difference in the output.

For more information, refer to Publishing Oracle9i Reports on http://otn.oracle.com/products/reports.

Back to Top

Font Aliasing

DESCRIPTION

Font aliasing for Oracle9i Reports PDF output is controlled by the uifont.ali file. Font aliasing is a simple font to font substitution that occurs at PDF report generation time. The fonts must be available on both the machine generating the PDF output and also on any machine displaying the PDF output. No fonts are included in the PDF output file, just the information on what fonts are used to display the output of the file. If the fonts are not available on the machine generating the PDF report, Oracle9i Reports replaces the aliased font based on an internal algorithm. If the fonts are not available on the machine where it is viewed using Acrobat Reader, a font substitution is made to Adobe Sans MM, which is installed with Adobe Acrobat Reader. If the PDF output is generated with the originally selected fonts and the fonts do not exist on the machine displaying the output, Adobe Acrobat Reader will try to substitute with Adobe Sans MM and if that font doesn't match properly, the resulting output may display dots for the data. For multibyte fonts, aliasing is done on the character set only. The entry in the uifont.ali should be "Character Set" = "Font Names".


Font aliasing will work with all of the following:

  • any single byte font, including Eastern European fonts for both ASCII and IS0-Latin character sets
  • Adobe multibyte Character ID (CID) fonts, both multibyte and unicode fonts, which are available as a free download from Adobe
  • Type 1 Postscript fonts
  • TrueType fonts

SETUP

Setup for PDF font aliasing is contained in the uifont.ali file. There are no command line options. Font aliasing will occur if the entries are contained in the uifont.ali file and the fonts listed are contained within the report being generated as PDF output. Here is an example of the font aliasing entry in the uifont.ali file:

[ PDF ]
/* Alias Base 14 to Base 14 */
Arial = Courier
/* Alias Base 14 to TrueType font */

Symbol = "Brush Script MT"
/* Alias TrueType font to Base 14 font */
Impact = Arial
/* Alias TrueType font to TrueType font */
"Century Schoolbook" = "Letter Gothic MT"
/*Alias TrueType to available Type 1 font */
"Kino MT" = UtopiaBold

 

The uifont.ali entry for PDF font aliasing shows the following (see the uifont.ali section for more details on the entry):
  • The first entry will substitute every Arial character with the Courier equivalent.
  • The second entry will substitute every Symbol character with the Brush Script MT equivalent.
  • The third entry will substitute every Impact character with the Arial equivalent.
  • The fourth entry will substitute every Kino MT character with the UtopiaBold equivalent.

SAMPLE

This sample output was created using Oracle9i Reports and the PDF font alias section listed in the alias setup section above:


TRADEOFFS

Advantage: generates a smaller file size than either font subsetting or font embedding (assuming all other parameters are the same) but achieves a uniform look and feel for a report.

Disadvantage: all fonts contained in the output need to be installed at all viewing locations.

TROUBLESHOOTING

If font aliasing does not work, check the following:
  • In the Acrobat Reader, choose File> Document Properties > Fonts
    • See if the actual font aliased has been added to the list
      • If no, then no font aliasing took place and most likely the problem is the fonts were not found or uifont.ali file is incorrect.
      • If yes, then font aliasing took place and the output is correct based on the fonts given in the uifont.ali file.
    • If you see Adobe Sans MM, this is the font Adobe uses if it cannot find a given font for Roman characters.
  • Fonts are not available on the machine where the report is being viewed.
  • Fonts are not in the REPORTS_PATH. This is where Oracle9i Reports looks for fonts when generating PDF output.
  • Font names are incorrect or not available on the machine (in the REPORTS_PATH) where the PDF generation occurs.
  • Check that the section names in the uifont.ali file have not been modified. Oracle9i Reports parses the file looking for the header names. In this case, [ PDF ] is the correct header name for font aliasing.
  • For multibyte character reports to display properly, Adobe Acrobat reader version 4.0 or higher is needed.
  • For viewing unicode output, the NLS_LANG parameter must be set to characterset.utf8.

Back to Top

Font Subsetting

DESCRIPTION

The Oracle9i Reports PDF font subsetting is a variant of PDF font embedding, where the fonts themselves are actually included with the output. Font subsetting includes the data and glyph information for only those characters used in the document with a particular font and not all the character information of all used fonts in the document. This allows for guaranteed viewing no matter what machine is using the Adobe Acrobat reader, since there is no dependency on the machine having fonts installed.

PDF font subsetting works for both single and multibyte fonts and is the preferred method of creating multibyte reports.

SETUP

Setup for PDF font subsetting is contained in the uifont.ali file. There are no command line options. PDF font subsetting will occur if the entries are contained in the uifont.ali file and the fonts listed are contained within the report being generated as PDF output.

If the uifont.ali file contains the PDF:Subset section and the report contains the font that is requested to be subset, and the font being subset to is on the system, font subsetting happens.

In the uifont.ali file, the left side of the equation contains the font name, but on the right side of the equation is the font file name, not the name of the font that you see in development environment (such as Oracle9i Reports). This file name must match exactly with the font file name or font subsetting will not happen. The font file name needs to be enclosed in double quotes. Here is an example of the font subsetting entry in the uifont.ali file.

[ PDF:Subset ]
Arial = "Arial.ttf"

 

When a font is subset into a PDF file, it becomes a custom font because it contains only those characters that are needed to produce the actual report. Using Adobe Acrobat 4.0 or higher, you can see what fonts are used in the report by choosing File>Document Properties or File>Document Info>Fonts. You can see the "Original Font", "Type", Encoding, Used Font and Type. In the case of font subsetting, the Encoding will specify Custom and the Used Font will be F2 and the Type will be 3. Type 3 fonts are imaged characters that look slightly bolder than they would if expressed as a Type 1 font. For best quality viewing, we recommend the following:
    1. Use Adobe Acrobat Reader 5.0.
    • Set the following parameters in the Adobe Acrobat Reader:
      • Edit > Preferences
      • Display > Smoothing
      • Check all the check boxes (smooth Text, smooth Artline, smooth Images)
      • If you are using a laptop, check the CoolType check box

PDF font subsetting with Oracle9i Reports is for TrueType fonts only. Font subsetting does not work for type1 fonts. There are 3rd party tools available to generate TrueType fonts from type1 fonts if you really want a specific font for your report. Working with TrueType fonts appears to be a limitation for Unix platforms, but it is possible to generate the report on a UNIX platform using TrueType fonts. Copy the TrueType fonts to the UNIX machine and make sure the fonts are located in the REPORTS_PATH. You can run the report with the associated TrueType fonts.

See http://partners.adobe.com/asn/developer/type/ftypes.html for more information on font types.

 

 

SAMPLE

 

 

TRADEOFFS

Font subsetting is one of the best solutions for multibyte reports because the font is a part of the report and this guarantees that the report will always look the same no matter what machine it is displayed on. The file size is larger, but the look and feel of the report is guaranteed.

Advantage: guaranteed look and feel without depending on the viewing machine to have the fonts installed. This is the recommended approach for generating multibyte fonts.

Disadvantage: only works with TrueType fonts. Fonts generated are type3 imaged characters, which in themselves have unique characteristics that are described on the Adobe web site. Since the document contains only those fonts used in the data of the output, no edits can be made to the document if they include any characters not already in the document.

See http://partners.adobe.com/asn/developer/type/ftypes.html for more information on font types.

 

TROUBLESHOOTING

If font subsetting does not work, it most likely will occur in the following:
  • Fonts are not found because the correct font file name was not used.
  • Make sure this is a TrueType font (i.e., filename.ttf).
  • Fonts are not in the REPORTS_PATH. This is where Oracle Reports looks for fonts when generating PDF output.
  • Font name is incorrect or not available on the machine where the PDF generation occurs.
  • Check that the section names in the uifont.ali file have not been modified. Reports parses the file looking for the header names (i.e., [ PDF:Subset ]).
  • For multibyte character reports to display properly, Adobe Acrobat reader version 4.0 or higher is needed.
  • In the Acrobat Reader, choose File> Document Properties > Fonts (slightly different based on Acrobat version):
    • See if the actual font is labeled "custom" and the type of font is "Type 3":
      • If no, then no font subsetting took place and most likely problem is the fonts were not found or uifont.ali file is incorrect.
      • If yes, then font subsetting took place and the output is correct based on the fonts given in the uifont.ali file.
    • If you see Adobe Sans MM, this is the font Adobe uses if it cannot find a given font.
Fonts that are subset look bold:
  • This is an issue with type 3 fonts, which are created during font subsetting. Type 3 fonts are imaged characters that look slightly bolder than they would if expressed as a Type 1 font. For best quality viewing, we recommend the following:
      1. Use Acrobat Reader 5.0.
      • Set the following parameters in the Acrobat Reader 5.0:
        • Edit > Preferences
        • Display > Smoothing
        • Check all the check boxes (smooth Text, smooth Artline, smooth Images)
        • If you are using a laptop, check the CoolType check box
Back to Top

Font Embedding

DESCRIPTION

Oracle9i Reports PDF font embedding is the process of including the entire font set along with the data into the PDF output file. For this reason, care should be taken when using this feature because file size can become very large very fast. PDF font embedding with Oracle9i Reports is for type1 fonts only, but they can be either single and multibyte fonts. PDF font embedding with Oracle9i Reports does not work for TrueType fonts. There are 3rd party tools available to generate Type 1 fonts from TrueType fonts if you really want a specific font for your report. PDF font embedding with Oracle9i Reports occurs between a font and a set of font file names. Note: There may be licensing issues that prevent a font from being embedded into the PDF output. For this reason, please check with the font creator and make sure to obtain and following any licensing agreements necessary.

SETUP

Because of the powerful nature of PDF font embedding and to allow maximum flexibility with minimal configuration, the setup to enable font embedding includes two control mechanisms. First is the entry in the uifont.ali file which specifies the Type 1 fonts to be embedded. Second is a command line option "PDFEMBED", which is used to specify for each report submitted, whether Oracle9i Reports should embed the Type1 postscript font specified in uifont.ali into PDF output. This flexibility allows users to define embedding conditions in the uifont.ali file and then selectively turn off or ignore the embedding instructions by issuing the PDFEMBED=NO command line option.

The syntax of the pdfembed command line option is: PDFEMBED={YES|NO}

  • YES means that the PDF driver will embed the font specified in the PDFEMBED parameter of the uifont.ali file into the PDF output. This is the default, so if you have font embedding specified in the uifont.ali file, it will happen automatically unless you specifically turn it off.
  • NO means that the font(s) mentioned in the PDF EMBED section will not be added to the PDF output and the PDF EMBED section of the uifont.ali file ignored for that particular job.
  • PDF font subsetting and font embedding are mutually exclusive.

To enable PDF font embedding, you must specify the correct information in the uifont.ali file such as the following:

[ PDF:Embed ]
UtopiaMediumItalic = "UtopiaMediumItalic.pfm UtopiaMediumItalic.pfb"

The above line embeds the UtopiaMediumItalic font into the PDF file. This ensures portability by not only creating the report with the UtopiaMediumItalic font, but font embedding it to make sure the font is sent with the reports output.

SAMPLE

 

TRADEOFFS

Advantage: guaranteed look and feel without depending on the viewing machine to have the fonts installed. Font embedding also allows for additions to be made to the report,which will be displayed in the proper embedded font.

Disadvantage: size (multibyte font embedding is not supported). For example, if you have a report that only contains the data "My Customer", which contains 10 letters, it would be around 2k. Now if each letter is in a different font and you want to embed 10 different fonts, where the average size of a single byte type1 font is 34kb, then you have 10(number of letters in reports) X 34kb, which produces a 340kb file size for a report that contains only 10 characters.

TROUBLESHOOTING

If PDF font embedding does not work, it most likely will occur in the following:
  • Fonts are not found because the correct font file name was not used.
  • Fonts are not in the REPORTS_PATH. This is where Oracle9i Reports looks for fonts when generating PDF output.
  • Make sure this is a Type 1 font, which means that on the right side of the equation, you must have two file names containing the font information, the fontfilename.pfm/afm file followed by the fontfilename.pfb file. The right side of the equation must be in double quotes. i.e.,UtopiaMediumItalic = "UtopiaMediumItalic.pfm UtopiaMediumItalic.pfb" ).
  • Font names are incorrect or not available on the machine where the PDF generation occurs.
  • Check that the section names in the uifont.ali file have not been modified. Oracle9i Reports parses the file looking for the header names.
  • In the Acrobat Reader 5.0, choose File> Document Properties > Fonts:
    • See if the actual font name you embedded is listed:
      • If no, then no font embedding took place and most likely problem is the fonts were not found or uifont.ali file is incorrect.
      • If yes, then font embedding took place and the output is correct based on the fonts given in the uifont.ali file.
    • If you see Adobe Sans MM, this is the font Adobe uses if it cannot find a given Roman font.
Back to Top

Accessibility

Oracle9i Reports provides several ways for you to address accessibility issues for the disabled. When a report is run to PDF format, the file follows the tagged-PDF standard defined in PDF 1.4 and, together with Acrobat Reader 5 (or higher) provides you with accessibility to the paper layout. Using the additional properties, you can provide the required information that is necessary for generating PDF documents containing additional definitions that can be interpreted by assistive technology. For more information on accessibility, see the "Creating Accessible Enterprise Reports using Oracle9i Reports" white paper on http://oracle.com under accessibility.

Back to Top

uifont.ali file

The uifont.ali file is the configuration file controlling all of the Oracle9i Reports PDF font enhancements. It can be found in <oracle_home>\tools\common90 and is a text readable file. You can edit it with a standard text editor. Caution should be used with editing the file, it should be saved as a text file with no formatting or special characters that may corrupt the file.

Oracle9i Reports has added three new sections to the uifont.ali file:

  1. [ PDF ] - Used for font aliasing and Multibyte language support
  2. [ PDF:Subset ] - Used for True Type Font subsetting and Multibyte language support
  3. [ PDF:Embed ] - Used for Type 1 font embedding

As a report is generated, the Oracle9i Reports Engine parses the uifont.ali file looking for keywords, so don't change them. Because the file is parsed, the PDF headings can be in any order.

  • Some general rules for the uifont.ali file are:
    • Use double quotes around any font or character set names containing spaces.
    • Use # in the first column for comments.
    • Comment out lines instead of deleting them in case you want to use them in the future.
    • Aliasing is font name to font name or character set to CID font (from Adobe)
    • Font subsetting is for TrueType fonts only.
    • Font subsetting uses the font name and subsets using the TrueType font file name.
    • Font embedding is for Type 1 fonts only. These fonts have two files. One for metrics, containing either a afm or pfm file extension and the binary containing the pfb file extension.
    • Font embedding uses the font name and embeds using the Type 1 font file names (both the *FM and PFB files are required in this order).

For FONT ALIASING

FORMAT

Each line of the uifont.ali file for font aliasing is of the form:

<Face>.<Size>.<Style>.<Weight>.<Width>.<Charset> = <Face>.<Size>.<Style>.<Weight>.<Width>.<Charset>

<Face> is the string name identifying a font face

<Size> is an explicit size of the font, in points.

<Style> may be a predefined string or numeric value as follows:

  1. Plain or 0
  2. Italic or 1
  3. Oblique or 2
  4. Underline or 4
  5. Outline or 8
  6. Shadow or 6
  7. Inverted or 32
  8. Overstrike or 64
  9. Blink or 128

    Styles may be combined with the plus ("+") to delimit parts of a style. For example,
    Arial..Italic+Overstrike = Helvetica.12.Italic.Bold
    will map any Arial that has both Italic and Overstrike styles to a 12-point, bold, italic Helvetica font.

<Weight> may be a predefined string or numeric value:

  1. Ultralight or 1
  2. Extralight or 2
  3. Light or 3
  4. Demilight or 4
  5. Medium or 5
  6. Demibold or 6
  7. Bold or 7
  8. Extrabold or 8
  9. Ultrabold or 9

<Width> may be a predefined string or numeric value:

  1. Ultradense or 1
  2. Extradense or 2
  3. Dense or 3
  4. Semidense or 4
  5. Normal or 5
  6. Semiexpand or 6
  7. Expand or 7
  8. Extraexpand or 8
  9. Ultraexpand or 9

For multibyte language support, you must alias a characterset with a CID font from the Asian font pack from Adobe. For example, you could specify that your Japanese report run with Shift-JIS characterset be replaced to HeiseiKakuGo-W5-Acro CID font with the following entry:
.....JA16SJIS = "HeiseiKakuGo-W5-Acro"

[ PDF ]
Arial = Courier
Tahoma.12..Bold.. = Tahoma.14....
"Times New Roman".12..Bold = "Tahoma"

 

For FONT SUBSETTING

FORMAT

<Face>.<Size>.<Style>.<Weight>.<Width>.<Charset> = Filename.ttf

Font name = Filename.ttf

[ PDF:Subset ]
Arial = "Arial.ttf"

 

For FONT EMBEDDING

FORMAT

Font name = "type1.pfm type1.pfb" (Note: the pfm/afm file must be first followed by the pfb file. Must be in double quotes).

[ PDF:Embed ]
Arial = "Arial.pfm Arial.pfb"

 

PRECEDENCE OF EXECUTION

If you have the same font in multiple places within uifont.ali, which ones takes precedence?

  1. Font aliasing takes precedence over font embedding - highest
  2. Font embedding takes precedence over font subsetting -middle
  3. Font subsetting takes no precedence - lowest

This is the precedence order of execution within uifont.ali if you have the same font within a specific heading. This means that if you have the same entry in both font embedding and font subsetting, font embedding will occur and font subsetting will not since it is being overridden by font embedding (assuming you have not set the command line option of PDFEMBED=NO).

Put the specific changes first followed by the more generic changes

For example, if you want to subset Arial Plain, Arial Bold, Arial Italic and Arial Bold-Italic fonts, your entries should be:

[ PDF:Subset ]
Arial..Italic.Bold.. = "Arialbi.ttf"
Arial...Bold.. = "Arialb.ttf"
Arial..Italic... = "Ariali.ttf"
Arial..... = "Arial.ttf"

If the plain Arial..... = "Arial.ttf" entry appears first, then all styles of Arial font in the layout will be subset as Arial Plain font.

Sample of a partial uifont.ali file for all the PDF entries containing all three PDF sections:

[ PDF ]
Palatino = "Palatino.ttf"

[ PDF:Subset ]
Garmond..Italic.Bold.. = "Garmacbi.ttf"
Garmond...Bold.. = "Garmacb.ttf"
Garmond..Italic... = "Garmaci.ttf"
Garmond..... = "Garamac.ttf"

[ PDF:Embed ]
Arial = "Arial.pfm Arial.pfb"

 

Back to Top  

Character sets

The character set component of the NLS environment variables specifies the character set in which data is represented in your environment. When data is transferred from a system using one character set to a system using another character set, it is processed and displayed correctly on the second system, even though some characters might be represented by different binary values in the character sets.

If you are designing a multilingual application, or even a single-language application that runs with multiple character sets, you need to determine the character set most widely used at runtime and then generate with the NLS environment variable (NLS_LANG) set to that particular character set. If you design and generate an application in one character set and run it in another character set, performance can suffer. Furthermore, if the runtime character set does not contain all the characters in the generate character set, then question marks appear in place of the unrecognized characters. Portable Document Format (PDF) supports multibyte character sets.

There might be situations where you create an application with a specific font but find that a different font is being used when you run that application. You would most likely encounter this when using an English font (such as MS Sans Serif or Arial) in environments other than Western European. This occurs because Oracle9i Reports checks to see if the character set associated with the font matches the character set specified by the language environment variable (NLS_LANG). If the two do not match, Oracle9i Reports automatically substitutes the font with another font whose associated character set matches the character set specified by the language environment variable. This automatic substitution assures that the data being returned from the database gets displayed correctly in the application. Note: If you enter local characters using an English font, then Windows does an implicit association with another font. There might be cases, however, where you do not want this substitution to take place. You can avoid this substitution by mapping all desired fonts to the WE8ISO8859P1 character set in the font alias file (uifont.ali).

Back to Top

Unicode

Unicode is a global character set that allows multilingual text to be displayed in a single application. This enables multinational corporations to develop a single multilingual application and deploy it worldwide. Oracle9i Reports provides Unicode support. If you use Unicode, you are able to display multiple languages, both single-byte languages such as those spoken in Western Europe, Eastern Europe, Bidirectional Middle Eastern, and multibyte Asian languages such as Chinese, Japanese, and Korean (CJK) in the same application.

Use of a single character set that encompasses all languages eliminates the need to have various character sets for various languages. For example, to display a multibyte language such as Japanese, the NLS_LANG environment variable must be set to the following:

NLS_LANG=JAPAN_JAPANESE.JA16SJIS

To display a single-byte language such as German, NLS_LANG must be set to the following: NLS_LANG=GERMAN_GERMANY.WE8ISO8859P1

The obvious disadvantage of this scheme is that applications can only display characters from one character set at a time. Mixed character set data is not possible.

With the Unicode character set, you can set the character set portion of NLS_LANG to UTF8 instead of a specific language character set. This allows characters from different languages and character sets to be displayed simultaneously. For example, to display Japanese and German together on the screen, the NLS_LANG variable must be set to one of the following:
  • NLS_LANG=JAPAN_JAPANESE.UTF8
  • NLS_LANG=GERMAN_GERMANY.UTF8

Oracle9i Reports relies on the operating system for the font and input method for different languages. To enter and display text in a particular language, you must be running a version of the operating system that supports that language. Font support is limited but not restricted to the operating system font. Windows NT release 4.0 provides True Type Big Fonts. These fonts contain all the characters necessary to display or print multilingual text. If you try to type, display, or print multilingual text and see unexpected characters, then you are probably not using a Big Font. Big Fonts provided by Microsoft under Windows NT release 4.0 are as follows:

  • Arial
  • Courier New
  • Lucida Console
  • Lucida Sans Unicode
  • Times New Roman

Third-party Unicode fonts are also available.

To enable Unicode support, set the NLS_LANG environment variable as follows: NLS_LANG=character_set.UTF8

Back to Top

Type1 fonts

PostScript font formats Adobe Type 1 fonts are stored in two common formats: .pfa (PostScript Font ASCII) and .pfb (PostScript Font Binary). These contain descriptions of the character shapes, with each character being generated by a small program that calls on other small programs to compute common parts of the characters in the font. In both cases, the character descriptions are encrypted. Before such a font can be used, it must be rendered into dots in a bitmap, either by the PostScript interpreter, or by a specialized rendering engine, such as Adobe Type Manager, which is used to generate low-resolution screen fonts on Apple Macintosh and on Microsoft Windows systems.

The Type 1 binary files(.pfa, .pfb) contain character information while the metric (.afm - Adobe Font Metric or .pfm - Printer Font Metric) files contain the metric information to form the character. These metrics files are ASCII files with a well-defined easy-to-parse structure.

Back to Top

TrueType fonts

The personal computer brought about a need for scalable font technology, thought to be an important part of any future operating system. Adobe wanted both Apple and Microsoft to license its PostScript code, which was capable of handling this role, but both companies were concerned about having a third party control key parts of their operating systems. Apple and Microsoft agreed to a cross-licensing and product development deal, with Microsoft creating a PostScript-style graphics engine and Apple creating a font system.

Apple developed what was to become TrueType, which proved superior to other competing technologies on performance and rendering quality. Apple and Microsoft announced their strategic alliance against Adobe, where Apple would do the font system, Microsoft the printing engine. Apple released TrueType in March 1991 and the first TrueType fonts:

  • Times Roman
  • Helvetica
  • Courier

Microsoft introduced TrueType into Windows with version 3.1 in early 1992. They created a core set of fonts:

  • Times New Roman
  • Arial
  • Courier

Both Apple's and Microsoft's TrueType fonts showed that scalable fonts could generate bitmaps virtually as though each size had been designed by hand.

Back to Top

Barcode fonts

Barcode fonts can be quite confusing. Some industries have chosen a specific barcode type. If this is what you need, then using the appropriate barcode font should work. For example, if you are interested in putting barcode on retail packages or books, the choice of a barcode is simple. Retail packages in North America use the UPC-A bar code. European retail articles use the EAN barcode . And all book ISBN numbers use the Bookland barcode (an EAN 13 bar code with a 5 digit supplement). Fonts are one way to obtain barcode, but not the only way.

Oracle9i Reports offers another solution for producing barcodes using a Java barcode bean. The Java barcode bean is capable of creating barcodes based on the most popular barcode types. See http://otn.oracle.com/reports for an example and white paper on using the barcode bean.

Back to Top

CID Fonts

Character IDentifier (CID) fonts are a format of composite (multibyte) Type 1 fonts to better address the requirements of Far East markets. Adobe developed the CID-keyed font file format to support large character set fonts for use with PostScript. It is the ideal format for Chinese, Japanese, or Korean fonts, and may also be used for roman fonts with very large character sets. CID-keyed refers to the character identifier (CID) numbers that are used to index and access the characters in the font. A CID (character identifier) font consists of a large font file that contains all the character outlines and a small CMap file that contains a list of characters, encodings, and character identifiers. The combination of the font file and the CMap file yields a font that is a specific character set and encoding information. Each CID font can support many character set and encoding combinations.

Back to Top

Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065, USA
http://www.oracle.com/
Worldwide Inquiries:
1-800-ORACLE1
Fax 650.506.7200

Copyright and Corporate Info

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy