📄 vdmx.htm
字号:
<HTML>
<HEAD>
<TITLE>The 'vdmx' Table</TITLE>
<STYLE>
<!--
BODY {background: #FFFFFF; link: #000080}
H1 {font-size: 24pt; color: #c60029}
H2 {font-size: 18pt; color: black}
H3 {font-size: 16pt; color: black}
H4 {font-size: 14pt; color: black}
CAPTION {font-size: 16pt; font-weight: Bold}
A:link {text-decoration: none}
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000080">
<TABLE WIDTH=480 CELLPADDING=8 CELLSPACING=0 BORDER=0>
<TR><TD><IMG WIDTH=100 HEIGHT=1 ALT="" SRC="/truetype/otspec/pixel.gif" BORDER=0></TD>
<TD><H1>Table Formats</H1></TD>
</TR>
<TR><TD></TD><TD ALIGN=TOP>
<H2>VDMX - Vertical Device Metrics</H2>
<P>
Under Windows, the usWinAscent and usWinDescent
values from the 'OS/2' table will be used to determine the maximum
black height for a font at any given size. Windows calls this
distance the Font Height. Because TrueType instructions can lead
to Font Heights that differ from the actual scaled and rounded
values, basing the Font Height strictly on the yMax and yMin can
result in "lost pixels." Windows will clip any pixels
that extend above the yMax or below the yMin. In order to avoid
grid fitting the entire font to determine the correct height,
the VDMX table has been defined.
<P>
The VDMX table consists of a header followed by groupings of VDMX
records:
<TABLE WIDTH=480 BGCOLOR="#F0F0F0">
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Type</TH><TH BGCOLOR="#C0C0C0">Name</TH>
<TH BGCOLOR="#C0C0C0">Description</TH></TR>
</THEAD>
<TBODY>
<TR>
<TD VALIGN=TOP>USHORT</TD><TD VALIGN=TOP>version</TD>
<TD VALIGN=TOP>Version number (starts at 0).</TD></TR>
<TR>
<TD VALIGN=TOP>USHORT</TD><TD VALIGN=TOP>numRecs</TD>
<TD VALIGN=TOP>Number of VDMX groups present</TD></TR>
<TR>
<TD VALIGN=TOP>USHORT</TD><TD VALIGN=TOP>numRatios</TD>
<TD VALIGN=TOP>Number of aspect ratio groupings</TD></TR>
<TR>
<TD VALIGN=TOP>Ratios</TD><TD VALIGN=TOP>ratRange[numRatios]</TD>
<TD VALIGN=TOP>Ratio ranges (see below for more info)</TD></TR>
<TR>
<TD VALIGN=TOP>USHORT</TD><TD VALIGN=TOP>offset[numRatios]</TD>
<TD VALIGN=TOP>Offset from start of this table to the VDMX group for this ratio range.</TR>
<TR>
<TD VALIGN=TOP>Vdmx</TD><TD VALIGN=TOP>groups</TD>
<TD VALIGN=TOP>The actual VDMX groupings (documented below)
</TD></TR>
</TABLE> <P>
<P>
<BLOCKQUOTE>
<TT>struct Ratios
{<BR>
BYTE bCharSet; /* Character set (see below) */<BR>
BYTE xRatio; /* Value to use for x-Ratio */<BR>
BYTE yStartRatio; /* Starting y-Ratio value */<BR>
BYTE yEndRatio /* Ending y-ratio value */<BR>
}</TT></BLOCKQUOTE>
<P>
Ratios are set up as follows:
<TABLE WIDTH=480>
<THEAD>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>For a 1:1 aspect ratio</TD><TD VALIGN=TOP>Ratios.xRatio = 1;<BR>
Ratios.yStartRatio = 1;<BR>
Ratios.yEndRatio = 1;</TD></TR>
<TR>
<TD VALIGN=TOP>For 1:1 through 2:1 ratio</TD>
<TD VALIGN=TOP>Ratios.xRatio = 2;<BR>
Ratios.yStartRatio = 1;<BR>
Ratios.yEndRatio = 2;</TD></TR>
<TR>
<TD VALIGN=TOP>For 1.33:1 ratio</TD>
<TD VALIGN=TOP>Ratios.xRatio = 4;<BR>
Ratios.yStartRatio = 3;<BR>
Ratios.yEndRatio = 3;</TD></TR>
<TR>
<TD VALIGN=TOP>For <CITE>all</CITE> aspect ratios</TD>
<TD VALIGN=TOP>Ratio.xRatio = 0;<BR>
Ratio.yStartRatio = 0;<BR>
Ratio.yEndRatio = 0;</TD></TR>
</TABLE> <P>
<P>
All values set to zero signal the default
grouping to use; if present, this must be the <CITE>last</CITE> Ratio
group in the table. Ratios of 2:2 are the same as 1:1.
<P>
Aspect ratios are matched against the target device by normalizing
the entire ratio range record based on the current X resolution
and performing a range check of Y resolutions for each record
after normalization. Once a match is found, the search stops.
If the 0,0,0 group is encountered during the search, it is used
(therefore if this group is not at the end of the ratio groupings,
no group that follows it will be used). If there is not a match
and there is no 0,0,0 record, then there is no VDMX data for that
aspect ratio.
<P>
Note that range checks are conceptually performed as follows:
<P>
(deviceXRatio == Ratio.xRatio) && (deviceYRatio >=
Ratio.yStartRatio) && (deviceYRatio <= Ratio.yEndRatio)
<P>
Each ratio grouping refers to a specific VDMX record group; there
must be at least 1 VDMX group in the table.
<P>
The uCharSet value is used to denote cases where the VDMX group
was computed based on a subset of the glyphs present in the font
file. The currently defined values for character set are:
<TABLE WIDTH=480 BGCOLOR="#F0F0F0">
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">uCharSet</TH><TH BGCOLOR="#C0C0C0">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>0</TD><TD VALIGN=TOP>No subset; the VDMX group applies to all glyphs in the font. This is used for symbol or dingbat fonts.</TD></TR>
<TR><TD VALIGN=TOP>1</TD><TD VALIGN=TOP>Windows ANSI subset; the VDMX group was computed using only the glyphs required to complete the Windows ANSI character set. Windows will ignore any VDMX entries that are not for the ANSI subset (i.e. uCharSet = 1)</TD></TR>
</TABLE> <P>
<P>
VDMX groups immediately follow the table header.
Each set of records (there need only be one set) has the following
layout:
<TABLE WIDTH=480 BGCOLOR="#F0F0F0">
<THEAD>
<TR><TH BGCOLOR="#C0C0C0">Type </TH><TH BGCOLOR="#C0C0C0">Name</TH><TH BGCOLOR="#C0C0C0">Description</TH></TR>
</THEAD>
<TBODY>
<TR><TD VALIGN=TOP>USHORT</TD><TD VALIGN=TOP>recs</TD><TD VALIGN=TOP>Number of height records in this group</TD></TR>
<TR><TD VALIGN=TOP>BYTE</TD><TD VALIGN=TOP>startsz</TD><TD VALIGN=TOP>Starting yPelHeight</TD></TR>
<TR><TD VALIGN=TOP>BYTE</TD><TD VALIGN=TOP>endsz</TD><TD VALIGN=TOP>Ending yPelHeight</TD></TR>
<TR><TD VALIGN=TOP>vTable</TD><TD VALIGN=TOP>entry[recs]</TD><TD VALIGN=TOP>The VDMX records</TD></TR>
</TABLE> <P>
<P>
<BLOCKQUOTE>
<TT>struct vTable
{<BR>
USHORT yPelHeight; /* yPelHeight to which values apply */<BR>
SHORT yMax; /* yMax (in pels) for this yPelHeight */<BR>
SHORT yMin; /* yMin (in pels) for this yPelHeight */<BR>
}</TT></BLOCKQUOTE>
<P>
This table must appear in sorted order (sorted by yPelHeight),
but need not be continous. It should have an entry for every pel
height where the yMax and yMin do not scale linearly, where linearly
scaled heights are defined as:
<P>
Hinted yMax and yMin are identical to scaled/rounded
yMax and yMin
<P>
It is assumed that once yPelHeight reaches 255, all heights will
be linear, or at least close enough to linear that it no longer
matters. Please note that while the Ratios structure can only
support ppem sizes up to 255, the vTable structure can support
much larger pel heights (up to 65535). The choice of SHORT and
USHORT for vTable is dictated by the requirement that yMax and
yMin be signed values (and 127 to -128 is too small a range) and
the desire to word-align the vTable elements.
<br> <br>
<FONT FACE="Arial, Helvetica" SIZE=1>
Microsoft Typography Web Site <A HREF="/truetype/otspec/CPYRIGHT.htm">© 1996 Microsoft Corporation</A>
<BR>
Comments to the Microsoft Typography group: <A HREF="mailto:ttwsite@microsoft.com">ttwsite@microsoft.com</A>
<BR>
<A HREF="/truetype/default.htm">Home</a> | <a href="/truetype/creators.htm">Information for Developers</a>
<BR>
Last updated 05 September 1996
</FONT>
</TD></TR>
</TABLE>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -