📄 font.htm
字号:
the bitmap. this is set by gdi at load time. the<br>dfbitspointer is guaranteed to be even.<br><br>dfbitsoffset 4 bytes specifying the offset in the file to the<br>beginning of the bitmap information. if the 04h bit in<br>the dftype is set, then dfbitsoffset is an absolute<br>address of the bitmap (probably in rom).<br><br>for raster fonts, dfbitsoffset points to a sequence of<br>bytes that make up the bitmap of the font, whose height<br>is the height of the font, and whose width is the sum<br>of the widths of the characters in the font rounded up<br>to the next word boundary.<br><br>for vector fonts, it points to a string of bytes or<br>words (depending on the size of the grid on which the<br>font was digitized) that specify the strokes for each<br>character of the font. the dfbitsoffset field must be<br>even.<br><br>dfreserved 1 byte, not used.<br><br>dfflags 4 bytes specifying the bits flags, which are additional<br>flags that define the format of the glyph bitmap, as<br>follows:<br><br>dff_fixed equ 0001h ; font is fixed pitch<br>dff_proportional equ 0002h ; font is proportional<br>; pitch<br>dff_abcfixed equ 0004h ; font is an abc fixed<br>; font<br>dff_abcproportional equ 0008h ; font is an abc pro-<br>; portional font<br>dff_1color equ 0010h ; font is one color<br>dff_16color equ 0020h ; font is 16 color<br>dff_256color equ 0040h ; font is 256 color<br>dff_rgbcolor equ 0080h ; font is rgb color<br><br>dfaspace 2 bytes specifying the global a space, if any. the<br>dfaspace is the distance from the current position to<br>the left edge of the bitmap.<br><br>dfbspace 2 bytes specifying the global b space, if any. the<br>dfbspace is the width of the character.<br><br>dfcspace 2 bytes specifying the global c space, if any. the<br>dfcspace is the distance from the right edge of the<br>bitmap to the new current position. the increment of a<br>character is the sum of the three spaces. these apply<br>to all glyphs and is the case for dff_abcfixed.<br><br>dfcolorpointer<br>4 bytes specifying the offset to the color table for<br>color fonts, if any. the format of the bits is similar<br>to a dib, but without the header. that is, the<br>characters are not split up into disjoint bytes.<br>instead, they are left intact. if no color table is<br>needed, this entry is null.<br>[note: this information is different from that in the<br>hard-copy developer's notes and reflects a correction.]<br><br>dfreserved1 16 bytes, not used.<br>[note: this information is different from that in the<br>hard-copy developer's notes and reflects a correction.]<br><br>dfchartable for raster fonts, the chartable is an array of entries<br>each consisting of two 2-byte words for windows 2.x and<br>three 2-byte words for windows 3.00. the first word of<br>each entry is the character width. the second word of<br>each entry is the byte offset from the beginning of the<br>fontinfo structure to the character bitmap. for windows<br>3.00, the second and third words are used for the<br>offset.<br><br>there is one extra entry at the end of this table that<br>describes an absolute-space character. this entry<br>corresponds to a character that is guaranteed to be<br>blank; this character is not part of the normal<br>character set.<br><br>the number of entries in the table is calculated as<br>((dflastchar - dffirstchar) + 2). this includes a<br>spare, the sentinel offset mentioned in the following<br>paragraph.<br><br>for fixed-pitch vector fonts, each 2-byte entry in this<br>array specifies the offset from the start of the bitmap<br>to the beginning of the string of stroke specification<br>units for the character. the number of bytes or words<br>to be used for a particular character is calculated by<br>subtracting its entry from the next one, so that there<br>is a sentinel at the end of the array of values.<br><br>for proportionally spaced vector fonts, each 4-byte<br>entry is divided into two 2-byte fields. the first<br>field gives the starting offset from the start of the<br>bitmap of the character strokes. the second field gives<br>the pixel width of the character.<br><br><facename> an ascii character string specifying the name of the<br>font face. the size of this field is the length of the<br>string plus a null terminator.<br><br><devicename> an ascii character string specifying the name of the<br>device if this font file is for a specific device. the<br>size of this field is the length of the string plus a<br>null terminator.<br><br><bitmaps> this field contains the character bitmap definitions.<br>each character is stored as a contiguous set of bytes.<br>(in the old font format, this was not the case.)<br><br>the first byte contains the first 8 bits of the first<br>scanline (that is, the top line of the character). the<br>second byte contains the first 8 bits of the second<br>scanline. this continues until a first "column" is<br>completely defined.<br><br>the following byte contains the next 8 bits of the<br>first scanline, padded with zeros on the right if<br>necessary (and so on, down through the second<br>"column"). if the glyph is quite narrow, each scanline<br>is covered by 1 byte, with bits set to zero as<br>necessary for padding. if the glyph is very wide, a<br>third or even fourth set of bytes can be present.<br><br>note: the character bitmaps must be stored<br>contiguously and arranged in ascending order.<br><br>the following is a single-character example, in which<br>are given the bytes for a 12 x 14 pixel character, as<br>shown here schematically.<br><br>............<br>.....**.....<br>....*..*....<br>...*....*...<br>..*......*..<br>..*......*..<br>..*......*..<br>..********..<br>..*......*..<br>..*......*..<br>..*......*..<br>............<br>............<br>............<br><br>the bytes are given here in two sets, because the<br>character is less than 17 pixels wide.<br><br>00 06 09 10 20 20 20 3f 20 20 20 00 00 00<br>00 00 00 80 40 40 40 c0 40 40 40 00 00 00<br><br>note that in the second set of bytes, the second digit<br>of each is always zero. it would correspond to the 13th<br>through 16th pixels on the right side of the character,<br>if they were present.<br><br><br>the windows 2.x version of dfchartable has a glyphentry structure with<br>the following format:<br><br>glyphentry struc<br>gewidth dw ? ; width of character bitmap in pixels<br>geoffset dw ? ; pointer to the bits<br>glyphentry ends<br><br>the windows 3.00 version of the dfchartable is dependent on the format<br>of the glyph bitmap.<br><br>note: the only formats supported in windows 3.00 will be dff_fixed<br>and dff_proportional.<br><br>dff_fixed<br>dff_proportional<br><br>glyphentry struc<br>gewidth dw ? ; width of character bitmap in pixels<br>geoffset dd ? ; pointer to the bits<br>glyphentry ends<br><br>dff_abcfixed<br>dff_abcproportional<br><br>glyphentry struc<br>gewidth dw ? ; width of character bitmap in pixels<br>geoffset dd ? ; pointer to the bits<br>geaspace dd ? ; a space in fractional pixels (16.16)<br>gebspace dd ? ; b space in fractional pixels (16.16)<br>gecspace dw ? ; c space in fractional pixels (16.16)<br>glyphentry ends<br><br>the fractional pixels are expressed as a 32-bit signed number with an<br>implicit binary point between bits 15 and 16. this is referred to as a<br>16.16 ("sixteen dot sixteen") fixed-point number.<br><br>the abc spacing here is the same as that defined above. however, here<br>there are specific sets for each character.<br><br>dff_1color<br>dff_16color<br>dff_256color<br>dff_rgbcolor<br><br>glyphentry struc<br>gewidth dw ? ; width of character bitmap in pixels<br>geoffset dd ? ; pointer to the bits<br>geheight dw ? ; height of character bitmap in pixels<br>geaspace dd ? ; a space in fractional pixels (16.16)<br>gebspace dd ? ; b space in fractional pixels (16.16)<br>gecspace dd ? ; c space in fractional pixels (16.16)<br>glyphentry ends<br><br>dff_1color means 8 pixels per byte<br>dff_16color means 2 pixels per byte<br>dff_256color means 1 pixel per byte<br>dff_rgbcolor means rgbquads<br><br><br>microsoft is a registered trademark and windows is a trademark of<br>microsoft corporation.<br></td></tr></table></center></div><p align="center"><a href="../index.htm">返回</a></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -