Home |
Font Capture |
Font CaptureFontCapture (program pfontcap.exe) is a utility program written using RTPEG-32 to generate additional fonts for use by application programs. FontCapture generates .cpp source files or binary data files each containing a PegFont data structure, character widths and character data. The .cpp files generated by PegFontCapture can be compiled, linked, and if desired ROM'ed along with the rest of an application. Since the .cpp files generated by PegFontCapture entirely contain read-only data, additional PegFonts included with a program should only consume ROM storage. The binary output format is intended for use with targets which support a run-time file system. In this type of system, an arbitrary number of PegFonts may be stored as binary files and read from the filesystem into memory only when needed. The PegFont format is a binary 1, 2 or 4 bit/pixel font format. The standard 1-bpp format is most commonly used. These fonts can be drawn in any combination of foreground and background colors supported by the target system. The 2 bit/pixel format is used for Outlined fonts, which is a font format used primarily in video display systems such as television or set-top box applications. In this format the font includes a single-pixel wide outline. When drawing the font, the foreground color is used for the font outline and the background color is used as the font fill color. The 4 bit/pixel format is used for anti-aliased fonts. Anti-aliased fonts define 16 pixel intensity levels to produce much smoother appearance for round character edges. Anti-aliased fonts can only be produced when the TrueType (Native) font rendering engine is selected. The Source Font group allows you to select the source font type. FontCapture supports the conversion of MS Windows TrueType fonts or Adobe Postscript Glyph Bitmap Distribution (BDF) fonts. If you are converting a TrueType format source font, you can use either the native MS Windows font rendering engine or the open-source FreeType (Native) rendering engine. These two font renderers produce slightly different results due to internal differences in implementation. If you select TrueType (Windows) as your source font type, the Select... button can be used to invoke the ChooseFont Windows common dialog. If you select the TrueType (Native) as your source font type, the Select... button is used to choose a .ttf file from your host system's file system. Note that the Native rendering engine works directly from a TrueType source file, it does not utilize the "Installed Fonts" of the Windows host system. If you select the BDF source font format, the Select... button allows you to select the actual .bdf file. No matter which type of source font you choose, the output of Font Capture is a PegFont data structure in 'C' data array format or binary format. The final source font format is a PegFont file. This selection allows you to read a previously converted PegFont source file. If you have edited or customized the output of a PegFont and saved the font in source file format, this option allows you to re-open the source file for further editing and modification. The Char Range group allows specifying precisely the characters you want to include in the font. For example, the desired range for a certain font may include only numeric characters to reduce the resulting font size. For multi-lingual applications, you may need to specify a complex set of character ranges to support all languages included in the system. This sometimes involves using Unicode character encoding. The simplest Char Range to specify is the ASCII character range. This includes characters 0x00 to 0x7f. For any other character range, you must specify in detail the range or ranges of characters you want to include using the range configuration dialog described below. The Output Format group allows you to select between normal bitmapped font output and outlined font format. The Outline checkbox can be used to generate a font with an added single pixel wide outline of each glyph. This is not the typical font type used in RTPEG-32 applications, but is supported for the minority of applications that require an outlined font capability. When the Outline box is selected, PegFontCapture encodes the output PegBitmap in a 2-bpp format, where bitmap value 0 indicates the pixel should be the foreground color, bitmap value 1 indicates that the pixel should be in the outline color, and bitmap value 2 indicates that the pixel should be either the background color or transparent, depending on the PegColor.uFill value passed to the text drawing function. The Binary output format is used when you want to create a binary PegFont file, rather than the more common C++ source file. The Solid and Add Space checkboxes are modifiers for the outline font generation mode. The Solid checkbox causes the font outline to appear somewhat heavier than the default outline. The Solid choice is beneficial when working with large fonts. The Add Space option adds a single pixel of spacing between each generated character when generating an outline font. This is beneficial when working with very small outlined fonts. The Solid and Add Space modifiers are ignored if the Outline checkbox is not selected. The Optimization slider gives you control over how the FontCapture program breaks multiple-page fonts into component pages. The FontCapture program examines the resulting font and attempts to find sections of the font that contain no input data. When large empty sections are found, FontCapture removes the empty section by creating two font pages that skip the empty font section. The optimization slider allows you to adjust how large the empty section needs to be to justify creating a new font page. Creating more pages reduces the font storage size, but also increases the runtime overhead when displaying strings because the correct font page for each character must be located at runtime. Note that optimization works best when using the TrueType (Native) rendering engine, because more precise font data is available when using the Native rendering engine. The Generate PegFont button causes FontCapture to convert the source font into a PegFont. This process may occur very quickly for a small font, or it may take several minutes for a very large font containing many thousands of characters. You can capture as many fonts as you like within one session of running FontCapture. You can use this window to examine the PegFont produced, and even compare multiple fonts to find the best appearance. Once you are satisfied with the appearance of your font, you can use the Save As.. button to save the font to a source or binary file of your choosing. Applying Custom Character Filters
|