Windows 개발자 참고 사항: 글꼴 파일 형식입니다.

만료된 KB 콘텐츠 고지 사항

이 문서는 Microsoft에서 더 이상 지원하지 않는 제품에 대해 작성되었습니다. 따라서 이 문서는 “있는 그대로" 제공되며 더 이상 업데이트되지 않습니다.

요약

이 문서에서는 통틀어 "Windows 개발자 메모." 라고 7 개의 문서 일련의 일부 다른 문서의 내용에 대 한 자세한 내용은 Microsoft 기술 자료 문서에서 찾을 수 있습니다.
65260 Windows 개발자의 노트

자세한 내용

다음 파일은 Microsoft 다운로드 센터에서 다운로드할 수 있습니다.


FontFmt.exe

Microsoft 지원 파일을 다운로드 하는 방법에 대 한 자세한 내용은 Microsoft 기술 자료의 다음 문서 번호를 클릭 합니다.
119591 온라인 서비스 로부터 Microsoft 지원 파일을 구하는 방법
Microsoft는 이 파일에 대해 바이러스 검사를 시행하였습니다. Microsoft는 파일이 게시된 날짜에 사용할 수 있었던 최신 바이러스 검색 소프트웨어를 사용했습니다. 파일은 파일을 무단된 변경을 방지 하기 위해 보안이 강화 된 서버에 저장 됩니다.


래스터와 벡터 글꼴 Microsoft Windows 글꼴 파일 형식으로 정의 됩니다. 이러한 형식은 스마트 텍스트 생성기에서 일부 GDI 지원 모듈에서 사용할 수 있습니다. 특히 벡터 형식으로는 더 자주 지원 모듈에 의해 GDI 보다 자체에서 사용 됩니다.


래스터와 벡터 글꼴 파일 모두에 공통 된 정보로 시작한 다음 형식의 파일에 대 한 다른 정보를 계속 합니다.


Windows 3.0 글꼴 파일 헤더는 6 개의 새 필드를 포함: dFlags, dfAspace, dfBspace, dfCspace, dfColorPointer, 및 dfReserved1. 이 필드는 Windows 3.0에서 사용 되지 않습니다. Windows의 이후 버전과 호환성을 보장 하려면이 필드를 0으로 설정 합니다.


모든 장치 드라이버는 Windows 2.x 글꼴을 지원합니다. 그러나 일부 장치 드라이버는 Windows 3.0 버전을 지원.


글꼴 파일의 문자에 대 한 비트를 설명 하는 구조를 이루어져 있는 dfCharTable에 기호 테이블을 포함 하는 Windows 3.0 글꼴 파일. 이 버전 글꼴을 크기, Windows 2.x 글꼴 크기 제한인 64 K 초과할 수 있습니다. 이 가능케 32 비트 오프셋을 사용 하 여 dfCharTable의 문자 모양에.


32 비트 오프셋과 잠재적으로 큰 크기 때문에 이러한 글꼴 Windows 버전 3.0 실행 중인 시스템에서 사용 하기 위해 설계 된에 (표준 또는 386 확장) 보호 모드 32 비트 레지스터는 프로세서의 문자 모양에 액세스할 수 있는 프로세서가 80386 (또는 그 이상). 일반적으로 장치 드라이버 이러한 조건에 모두 경우에 Windows 3.0 버전의 글꼴을 사용 합니다.


글꼴 파일에 저장 되는. FNT 확장명 형식의 이름입니다. FNT입니다. 다음은 벡터와 래스터 글꼴 파일을 Windows 3.0 버전의 시작 부분에 정보를 보여 줍니다.
Field          Description
----- -----------

dfVersion 2 bytes specifying the version (0200H or 0300H) of
the file.

dfSize 4 bytes specifying the total size of the file in
bytes.

dfCopyright 60 bytes specifying copyright information.

dfType 2 bytes specifying the type of font file.

The low-order byte is 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 in
dfBitsOffset, the third bit is set to 1; otherwise, the
bit is set to 0 (zero). The high-order bit of the low
byte is set if the font was realized by a device. The
remaining bits in the low byte are reserved and set to
zero.

The high byte is reserved for device use and will
always be set to zero for GDI-realized standard fonts.
Physical fonts with the high-order bit of the low byte
set may use this byte to describe themselves. GDI will
never inspect the high byte.

dfPoints 2 bytes specifying the nominal point size at which
this character set looks best.

dfVertRes 2 bytes specifying the nominal vertical resolution
(dots-per-inch) at which this character set was
digitized.

dfHorizRes 2 bytes specifying the nominal horizontal resolution
(dots-per-inch) at which this character set was
digitized.

dfAscent 2 bytes specifying the distance from the top of a
character definition cell to the baseline of the
typographical font. It is useful for aligning the
baselines of fonts of different heights.

dfInternalLeading
Specifies the amount of leading inside the bounds set
by dfPixHeight. Accent marks may occur in this area.
This may be zero at the designer's option.

dfExternalLeading
Specifies the amount of extra leading that the designer
requests the application add between rows. Since this
area is outside of the font proper, it contains no
marks and will not be altered by text output calls in
either the OPAQUE or TRANSPARENT mode. This may be zero
at the designer's option.

dfItalic 1 (one) byte specifying whether or not the character
definition data represent an italic font. The low-order
bit is 1 if the flag is set. All the other bits are
zero.

dfUnderline 1 byte specifying whether or not the character
definition data represent an underlined font. The
low-order bit is 1 if the flag is set. All the other
bits are 0 (zero).

dfStrikeOut 1 byte specifying whether or not the character
definition data represent a struckout font. The low-
order bit is 1 if the flag is set. All the other bits
are zero.

dfWeight 2 bytes specifying the weight of the characters in the
character definition data, on a scale of 1 to 1000. A
dfWeight of 400 specifies a regular weight.

dfCharSet 1 byte specifying the character set defined by this
font.

dfPixWidth 2 bytes. For vector fonts, specifies the width of the
grid on which the font was digitized. For raster fonts,
if dfPixWidth is nonzero, it represents the width for
all the characters in the bitmap; if it is zero, the
font has variable width characters whose widths are
specified in the dfCharTable array.

dfPixHeight 2 bytes specifying the height of the character bitmap
(raster fonts), or the height of the grid on which a
vector font was digitized.

dfPitchAndFamily
Specifies the pitch and font family. The low bit is set
if the font is variable pitch. The high four bits give
the family name of the font. Font families describe in
a general way the look of a font. They are intended for
specifying fonts when the exact face name desired is
not available. The families are as follows:

Family Description
------ -----------
FF_DONTCARE (0<<4) Don't care or don't know.
FF_ROMAN (1<<4) Proportionally spaced fonts
with serifs.
FF_SWISS (2<<4) Proportionally spaced fonts
without serifs.
FF_MODERN (3<<4) Fixed-pitch fonts.
FF_SCRIPT (4<<4)
FF_DECORATIVE (5<<4)


dfAvgWidth 2 bytes specifying the width of characters in the font.
For fixed-pitch fonts, this is the same as dfPixWidth.
For variable-pitch fonts, this is the width of the
character "X."

dfMaxWidth 2 bytes specifying the maximum pixel width of any
character in the font. For fixed-pitch fonts, this is
simply dfPixWidth.

dfFirstChar 1 byte specifying the first character code defined by
this font. Character definitions are stored only for
the characters actually present in a font. Therefore,
use this field when calculating indexes into either
dfBits or dfCharOffset.

dfLastChar 1 byte specifying the last character code defined by
this font. Note that all the characters with codes
between dfFirstChar and dfLastChar must be present in
the font character definitions.

dfDefaultChar 1 byte specifying the character to substitute
whenever a string contains a character out of the
range. The character is given relative to dfFirstChar
so that dfDefaultChar is the actual value of the
character, less dfFirstChar. The dfDefaultChar should
indicate a special character that is not a space.

dfBreakChar 1 byte specifying the character that will define word
breaks. This character defines word breaks for word
wrapping and word spacing justification. The character
is given relative to dfFirstChar so that dfBreakChar is
the actual value of the character, less that of
dfFirstChar. The dfBreakChar is normally (32 -
dfFirstChar), which is an ASCII space.

dfWidthBytes 2 bytes specifying the number of bytes in each row of
the bitmap. This is always even, so that the rows start
on WORD boundaries. For vector fonts, this field has no
meaning.

dfDevice 4 bytes specifying the offset in the file to the string
giving the device name. For a generic font, this value
is zero.

dfFace 4 bytes specifying the offset in the file to the
null-terminated string that names the face.

dfBitsPointer 4 bytes specifying the absolute machine address of
the bitmap. This is set by GDI at load time. The
dfBitsPointer is guaranteed to be even.

dfBitsOffset 4 bytes specifying the offset in the file to the
beginning of the bitmap information. If the 04H bit in
the dfType is set, then dfBitsOffset is an absolute
address of the bitmap (probably in ROM).

For raster fonts, dfBitsOffset points to a sequence of
bytes that make up the bitmap of the font, whose height
is the height of the font, and whose width is the sum
of the widths of the characters in the font rounded up
to the next WORD boundary.

For vector fonts, it 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 dfBitsOffset field must be
even.

dfReserved 1 byte, not used.

dfFlags 4 bytes specifying the bits flags, which are additional
flags that define the format of the Glyph bitmap, as
follows:

DFF_FIXED equ 0001h ; font is fixed pitch
DFF_PROPORTIONAL equ 0002h ; font is proportional
; pitch
DFF_ABCFIXED equ 0004h ; font is an ABC fixed
; font
DFF_ABCPROPORTIONAL equ 0008h ; font is an ABC pro-
; portional font
DFF_1COLOR equ 0010h ; font is one color
DFF_16COLOR equ 0020h ; font is 16 color
DFF_256COLOR equ 0040h ; font is 256 color
DFF_RGBCOLOR equ 0080h ; font is RGB color

dfAspace 2 bytes specifying the global A space, if any. The
dfAspace is the distance from the current position to
the left edge of the bitmap.

dfBspace 2 bytes specifying the global B space, if any. The
dfBspace is the width of the character.

dfCspace 2 bytes specifying the global C space, if any. The
dfCspace 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 three spaces. These apply
to all glyphs and is the case for DFF_ABCFIXED.

dfColorPointer
4 bytes specifying the offset to the color table for
color fonts, if any. The format of the bits is similar
to a DIB, but without the header. That is, the
characters are not split up into disjoint bytes.
Instead, they are left intact. If no color table is
needed, this entry is NULL.
[NOTE: This information is different from that in the
hard-copy Developer's Notes and reflects a correction.]

dfReserved1 16 bytes, not used.
[NOTE: This information is different from that in the
hard-copy Developer's Notes and reflects a correction.]

dfCharTable For raster fonts, the CharTable is an array of entries
each consisting of two 2-byte WORDs for Windows 2.x and
three 2-byte WORDs for Windows 3.0. 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
FONTINFO structure to the character bitmap. For Windows
3.0, the second and third WORDs are used for the
offset.

There is one extra entry at the end of this table that
describes an absolute-space character. This entry
corresponds to a character that 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
((dfLastChar - dfFirstChar) + 2). This includes a
spare, the sentinel offset mentioned in the following
paragraph.

For fixed-pitch vector fonts, each 2-byte entry in this
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.

For proportionally spaced vector fonts, each 4-byte
entry is divided into two 2-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.

<facename> An ASCII character string specifying the name of the
font face. The size of this field is the length of the
string plus a NULL terminator.

<devicename> An ASCII character string specifying the name of the
device if this font file is for a specific device. The
size of this field is the length of the string plus a
NULL terminator.

<bitmaps> This field contains the character bitmap definitions.
Each character is stored as a contiguous set of bytes.
(In the old font format, this was not the case.)

The first byte contains the first 8 bits of the first
scanline (that is, the top line of the character). The
second byte contains the first 8 bits of the second
scanline. This continues until a first "column" is
completely defined.

The following byte contains the next 8 bits of the
first scanline, padded with zeros on the right if
necessary (and so on, down through the second
"column"). If the glyph is quite narrow, each scanline
is covered by 1 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.

NOTE: The character bitmaps must be stored
contiguously and arranged in ascending order.

The following is a single-character example, in which
are given the bytes for a 12 x 14 pixel character, as
shown here schematically.

............
.....**.....
....*..*....
...*....*...
..*......*..
..*......*..
..*......*..
..********..
..*......*..
..*......*..
..*......*..
............
............
............

The bytes are given here in two sets, because the
character is less than 17 pixels wide.

00 06 09 10 20 20 20 3F 20 20 20 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 each is always zero. It would correspond to the 13th
through 16th pixels on the right side of the character,
if they were present.

Windows 2.x 버전 dfCharTable 다음과 같은 형식의 GlyphEntry 구조체를 있습니다.
GlyphEntry    struc
geWidth dw ? ; width of character bitmap in pixels
geOffset dw ? ; pointer to the bits
GlyphEntry ends

DfCharTable는 Windows 3.0 버전의 문자 모양 비트맵 형식에 따라 달라 집니다.


참고: Windows 3.0에서 지 원하는 유일한 형식은 DFF_FIXED 및 DFF_PROPORTIONAL 됩니다.


DFF_FIXED
DFF_PROPORTIONAL
GlyphEntry    struc
geWidth dw ? ; width of character bitmap in pixels
geOffset dd ? ; pointer to the bits
GlyphEntry ends

DFF_ABCFIXED
DFF_ABCPROPORTIONAL
GlyphEntry    struc
geWidth dw ? ; width of character bitmap in pixels
geOffset dd ? ; pointer to the bits
geAspace dd ? ; A space in fractional pixels (16.16)
geBspace dd ? ; B space in fractional pixels (16.16)
geCspace dw ? ; C space in fractional pixels (16.16)
GlyphEntry ends

분수 픽셀 비트 15 16 사이의 암시적 이진 포인트와 부호 있는 32 비트 수로 표현 됩니다. 이 라고는 16.16 고정 소수점 수 ("16 점 16").


ABC 간격 여기는 앞에서 정의한 것과 동일 합니다. 그러나 여기 가지 각 문자에 대해 특정 설정 합니다.


DFF_1COLOR
DFF_16COLOR
DFF_256COLOR
DFF_RGBCOLOR
GlyphEntry    struc
geWidth dw ? ; width of character bitmap in pixels
geOffset dd ? ; pointer to the bits
geHeight dw ? ; height of character bitmap in pixels
geAspace dd ? ; A space in fractional pixels (16.16)
geBspace dd ? ; B space in fractional pixels (16.16)
geCspace dd ? ; C space in fractional pixels (16.16)
GlyphEntry ends

DFF_1COLOR는 바이트 당 8 픽셀 의미
DFF_16COLOR는 바이트 당 2 픽셀 의미
DFF_256COLOR는 바이트 당 1 픽셀 굵기로
DFF_RGBCOLOR RGBquads를 의미합니다.


Microsoft 등록된 상표 이며 Windows는 Microsoft Corporation의 상표입니다.
속성

문서 ID: 65123 - 마지막 검토: 2017. 2. 7. - 수정: 1

Microsoft Windows Software Development Kit 3.0, Microsoft Windows Software Development Kit 3.1

피드백