Out staff of freelance writers includes over 120 experts proficient in System Information, therefore you can rest assured that your assignment will be handled by only top rated specialists. Order your System Information paper at affordable prices with cheap essay writing service!
Font-File Format
ßßßßßßßßßßßßßßßßßß
This topic describes the file formats for
raster and vector fonts used by the Windows
Help with essay on System Information
operating system. These file formats may be
used by smart text generators in some support
modules for the graphics device interface
(GDI). Vector formats, however, are more
frequently used by GDI than by the support
modules.
Organization of a Font File
Raster and vector font files begin with
information that is common to both types of
file and then continue with information that
differs for each type. These font files are
stored with an .FNT extension.
In Windows versions .0 and later, the
font-file header for raster and vector fonts
includes six new members dFlags, dfAspace,
dfBspace, dfCspace, dfColorPointer, and
dfReserved1. All device drivers support the
fonts in Windows .x. However, not all drivers
support those in versions .0 and later.
In Windows, font files for raster and vector
fonts include the glyph table in the
dfCharTable member, which consists of
structures describing the bits for characters
in the font file.The use of -bit offsets to
the character glyphs in the dfCharTable member
enables fonts to exceed 64K, the size limit of
Windows .x fonts.
Because of their -bit offsets and
potentially large size, the newer fonts are
designed for use on systems that are running
Windows versions .0 and later in protected
(standard or 86-enhanced) mode and are using
an 8086 (or higher) processor whose -bit
registers can access the character glyphs.
Typically, newer drivers use the newer version
of a font only when both of these conditions
are true.
Font-File Structure
Font information is found at the beginning of
both raster and vector font files.
Following are the members of the TFONTINFO
structure
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ�ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
dfVersion ³ The version (0x000 or 0x000) of the file.
dfSize ³ The total size of the file, in bytes.
dfCopyright ³ Copyright information.
dfType ³ The type of font file. This information is organized
³ as follows
Byte ³ Description
ÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Low-order ³ Exclusively for GDI use. If the low-order
³ bit of the word is zero, it is a bitmap
³ (raster) font file. If the low-order bit
³ is 1, it is a vector font file. The
³ second bit is reserved and must be zero.
³ If no bits follow in the file and the
³ bits are located in memory at a fixed
³ address specified by the dfBitsOffset
³ member, the third bit is set to 1.
³ Otherwise, the bit is set to zero. If the
³ font is realized by a device, the
³ high-order bit of the low-order byte is
³ set. The remaining bits in the low-order
³ byte are then reserved and set to zero.
High-order ³ Reserved for device use and is always
³ set to zero for standard fonts realized
³ by GDI. Physical fonts that set the
³ high-order bit of the low-order byte may
³ use this byte to describe themselves. GDI
³ never inspects the high-order byte.
dfPoints ³ The nominal point size (that is, the number
³ identifying the point size) at which this character
³ set looks best.
dfVertRes ³ The nominal vertical resolution (that is, the number
³ identifying the vertical resolution), in dots per
³ inch, at which this character set was digitized.
dfHorizRes ³ The nominal horizontal resolution (that is, the number
³ identifying the horizontal resolution), in dots per
³ inch, at which this character set was digitized.
dfAscent ³ The distance from the top of a character-definition
³ cell to the base line of the typographical font. The
³ dfAscent member is useful for aligning the base lines
³ of fonts with different heights.
dfInternalLeading ³ The amount of leading inside the bounds set by the
³ dfPixHeight member. Accent marks can occur in this
³ area. The designer can set the value to zero.
dfExternalLeading ³ The amount of extra leading that the designer requests
³ the application to add between rows. Since this area
³ is outside the font proper, it contains no marks and
³ is not altered by text-output calls in either opaque
³ or transparent mode. The designer can set the value to
³ zero.
dfItalic ³ Whether the character-definition data represents an
³ italic font. If the flag is set, the low-order bit is
³ 1. All other bits are zero.
dfUnderline ³ Whether the character-definition data represents an
³ underlined font. If the flag is set, the low-order bit
³ is 1. All other bits are zero.
dfStrikeOut ³ Whether the character-definition data represents a
³ strikeout font. If the flag is set, the low-order bit
³ is 1. All other bits are zero.
fWeight ³ Specifies the weight of the characters in the
³ character-definition data, on a scale of 1 through
³ 1000. A dfWeight value of 400 specifies a regular
³ weight.
dfCharSet ³ The character set defined by this font.
dfPixWidth ³ The width of the grid on which a vector font was
³ digitized. For raster fonts, if the dfPixWidth member
³ is nonzero, it represents the width for all the
³ characters in the bitmap. If the member is zero, the
³ font has variable-width characters whose widths are
³ specified in the array for the dfCharTable member.
dfPixHeight ³ The height of the character bitmap for raster fonts or
³ the height of the grid on which a vector font was
³ digitized.
dfPitchAndFamily ³ The pitch and font family. If the font is variable
³ pitch, the low bit is set. The four high bits give
³ the family name of the font. Font families describe
³ the general look of a font. They identify fonts when
³ the exact name is not available. The font families are
³ described as follows
Family ³ Description
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
FF_DONTCARE ³ Unknown.
FF_ROMAN ³ Proportionally spaced fonts with
³ serifs.
FF_SWISS ³ Proportionally spaced fonts without
³ serifs.
FF_MODERN ³ Fixed-pitch fonts.
FF_SCRIPT ³ Cursive or script fonts. (Both are
³ designed to look similar to
³ handwriting. Script fonts have joined
³ letters; cursive fonts do not.)
FF_DECORATIVE ³ Novelty fonts.
dfAvgWidth ³ The width of characters in the font. For fixed-pitch
³ fonts, this value is the same as the value for the
³ dfPixWidth member. For variable-pitch fonts, it is the
³ width of the character X.
dfMaxWidth ³ The maximum pixel width of any character in the font.
³ For fixed-pitch fonts, this value is the same as the
³ value of the dfPixWidth member.
dfFirstChar ³ The first character code defined by the font.
³ Character definitions are stored only for the
³ characters actually present in the font. Use this
³ member, therefore, when calculating indexes for either
³ the dfBits or dfCharOffset member.
dfLastChar ³ The last character code defined by the font. All
³ characters with codes between the values for the
³ dfFirstChar and dfLastChar members must be present in
³ the character definitions for the font.
dfDefaultChar ³ The character to substitute whenever a string contains
³ a character that is out of range. The character is
³ given relative to the dfFirstChar member so that the
³ dfDefaultChar member is the actual value of the
³ character less the value of the dfFirstChar member.
³ The dfDefaultChar member indicates a special character
³ that is not a space.
dfBreakChar ³ The character that defines word breaks for word
³ wrapping and word-spacing justification. The character
³ is given relative to the dfFirstChar member so that
³ the dfBreakChar member is the actual value of the
³ character less that of the dfFirstChar member. The
³ dfBreakChar member is normally minus the value of
³ the dfFirstChar member (the ASCII space character).
dfWidthBytes ³ The number of bytes in each row of the bitmap. This
³ value is always even so that the rows start on word
³ boundaries. For vector fonts, this member has no
³ meaning.
dfDevice ³ The offset in the file to the string giving the device
³ name. For a generic font, this value is zero.
dfFace ³ The offset in the file to the null-terminated string
³ that names the face.
dfBitsPointer ³ The absolute machine address of the bitmap. This is
³ set by GDI at load time. The value of the
³ dfBitsPointer member is guaranteed to be even.
dfBitsOffset ³ The offset in the file to the beginning of the bitmap
³ information. If the third bit in the dfType member is
³ set, the dfBitsOffset member is an absolute address of
³ the bitmap (probably in read-only memory).
³ For raster fonts, the dfBitsOffset member points to a
³ sequence of bytes that make up the bitmap of the font.
³ The height of the bitmap is the height of the font,
³ and its width is the sum of the widths of the
³ characters in the font, rounded up to the next word
³ boundary.
³ For vector fonts, the dfBitsOffset member points to a
³ string of bytes or words (depending on the size of the
³ grid on which the font was digitized) that specify the
³ strokes for each character of the font. The value of
³ the dfBitsOffset member must be even.
dfReserved ³ Not used.
dfFlags ³ The bit flags that define the format of the glyph
³ bitmap, as follows
Pitch value ³ Address
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
DFF_FIXED ³ 0x0001
DFF_PROPORTIONAL ³ 0x000
DFF_ABCFIXED ³ 0x0004
DFF_ABCPROPORTIONAL ³ 0x0008
DFF_1COLOR ³ 0x0010
DFF_16COLOR ³ 0x000
DFF_56COLOR ³ 0x0040
DFF_RGBCOLOR ³ 0x0080
dfAspace ³ The global A space, if any. The value of the dfAspace
³ member is the distance from the current position to
³ the left edge of the bitmap.
dfBspace ³ The global B space, if any. The value of the dfBspace
³ member is the width of the character.
dfCspace ³ The global C space, if any. The value of the dfCspace
³ member is the distance from the right edge of the
³ bitmap to the new current position. The increment of a
³ character is the sum of the A, B, and C spaces. These
³ spaces apply to all glyphs, including DFF_ABCFIXED.
dfColorPointer ³ The offset to the color table for color fonts, if any.
³ The format of the bits is like a device-independent
³ bitmap (DIB), but without the header. (That is, the
³ characters are not split into disjoint bytes; instead,
³ they are left intact.) If no color table is needed,
³ this entry is NULL.
dfReserved1 ³ Not used.
dfCharTable ³ An array of entries for raster, fixed-pitch vector,
³ and proportionally spaced vector fonts, as follows
Font type ³ Description
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍØÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Raster ³ Each entry in the array
³ consists of two -byte
³ words for Windows .x
³ and three -byte words
³ for Windows .0 and
³ later. The first word
³ of each entry is the
³ character width. The
³ second word of each
³ entry is the byte
³ offset from the
³ beginning of the
³ TFONTINFO structure to
³ the character bitmap.
³ For Windows .0 and
³ later, the second and
³ third words are used
³ for the offset.
Fixed-pitch vector ³ Each -byte entry in
³ the array specifies the
³ offset from the start
³ of the bitmap to the
³ beginning of the string
³ of stroke specification
³ units for the
³ character. The number
³ of bytes or words to be
³ used for a particular
³ character is calculated
³ by subtracting its
³ entry from the next
³ one, so that there is a
³ sentinel at the end
³ of the array of values.
Proportionally-spaced vector ³ Each 4-byte entry in
³ the array is divided
³ into two -byte fields.
³ The first field gives
³ the starting offset
³ from the start of the
³ bitmap of the character
³ strokes. The second
³ field gives the pixel
³ width of the character.
³ One extra entry at the
³ end of the character
³ table describes an
³ absolute-space
³ character, which is
³ guaranteed to be blank.
³ This character is not
³ part of the normal
³ character set.
³ The number of entries
³ in the table is
³ calculated as follows
³ (dfLastChar -
³ dfFirstChar) + . This
³ number includes a
³ spare, the sentinel
³ offset.
facename ³ An ASCII character string that constitutes the name of
³ the font face. The size of this member is the length
³ of the string plus a null terminating character.
devicename ³ An ASCII character string that constitutes the name of
³ the device if this font file is for a specific one.
³ The size of this member is the length of the string
³ plus a null terminating character.
bitmaps ³ Character bitmap definitions. Unlike the old font
³ format, each character is stored as a contiguous set
³ of bytes.
³ The first byte contains the first 8 bits of the first
³ scan line (that is, the top line of the character).
³ The second byte contains the first 8 bits of the
³ second scan line. This continues until the first
³ column is completely defined. The subsequent byte
³ contains the next 8 bits of the first scan line,
³ padded with zeros on the right if necessary (and so
³ on, down through the second column). If the glyph is
³ quite narrow, each scan line is covered by one byte,
³ with bits set to zero as necessary for padding. If the
³ glyph is very wide, a third or even
³ fourth set of bytes can be present.
³ Character bitmaps must be stored contiguously and
³ arranged in ascending order. The bytes for a 1-pixel
³ by 14-pixel A character, for example, are given in
³ two sets, because the character is less than 17 pixels
³ wide
³
³ 00 06 0 10 0 0 0 F 0 0 0 00 00 00
³ 00 00 00 80 40 40 40 C0 40 40 40 00 00 00
³ Note that in the second set of bytes, the second digit
³ of the byte is always zero. The zeros correspond to
³ the thirteenth through sixteenth pixels on the right
³ side of the character, which are not used by this
³ character bitmap.
Version-Specific Glyph Tables
The dfCharTable member for Windows .x has a
TGLYPHENTRY structure with the following
format
GlyphEntry struc
geWidth dw ? ; width of char bitmap, pixels
geOffset dw ? ; pointer to the bits
GlyphEntry ends
The dfCharTable member in Windows .0 and
later is dependent on the format of the glyph
bitmap. The only formats supported are
DFF_FIXED and DFF_PROPORTIONAL.
DFF_FIXED
DFF_PROPORTIONAL
GlyphEntry struc
geWidth dw ? ; width of char bitmap, pixels
geOffset dd ? ; pointer to the bits
GlyphEntry ends
DFF_ABCFIXED
DFF_ABCPROPORTIONAL
GlyphEntry struc
geWidth dw ? ; width of char bitmap, pixels
geOffset dd ? ; pointer to the bits
geAspace dd ? ; A space, fract pixels (16.16)
geBspace dd ? ; B space, fract pixels (16.16)
geCspace dw ? ; C space, fract pixels (16.16)
GlyphEntry ends
Fractional pixels are expressed as -bit
signed numbers with an implicit binary point
between bits 15 and 16. This is referred to as
a 16.16 (sixteen dot sixteen) fixed-point
number.
The ABC spacing in the following example is
the same as defined previously. However,
specific sets are defined for each character
DFF_1COLOR ; 8 pixels per byte
DFF_16COLOR ; pixels per byte
DFF_56COLOR ; 1 pixel per byte
DFF_RGBCOLOR ; RGB quads
GlyphEntry struc
geWidth dw ? ; width of char bitmap, pixels
geOffset dd ? ; pointer to the bits
geHeight dw ? ; height of char bitmap, pixels
geAspace dd ? ; A space, fract pixels (16.16)
geBspace dd ? ; B space, fract pixels (16.16)
geCspace dd ? ; C space, fract pixels (16.16)
GlyphEntry ends
Please note that this sample paper on System Information is for your review only. In order to eliminate any of the plagiarism issues, it is highly recommended that you do not use it for you own writing purposes. In case you experience difficulties with writing a well structured and accurately composed paper on System Information, we are here to assist you. Your cheap custom research papers on System Information will be written from scratch, so you do not have to worry about its originality.
Order your authentic assignment from cheap essay writing service and you will be amazed at how easy it is to complete a quality custom paper within the shortest time possible!
No comments:
Post a Comment
Note: only a member of this blog may post a comment.