zoukankan      html  css  js  c++  java
  • 点阵字体, 矢量字体

    点阵字体

    http://zh.wikipedia.org/wiki/%E7%82%B9%E9%98%B5%E5%AD%97%E4%BD%93

    点阵字体也叫位图字体,其中每个字形都以一组二维像素信息表示。这种文字显示方式于较早前的电脑系统(例如未有图形接口时的 DOS 操作系统)被普遍采用。
    由于位图的缘故,点阵字体很难进行缩放,特定的点阵字体只能清晰地显示在相应的字号下,否则文字只被强行放大而有损字形,产生成马赛克式的锯齿边缘。
    但对于字号 8-14px 的尺寸较小的汉字字体(即现今操作系统大多采用的默认字号)现今亦仍然被使用于荧幕显示上,能够提供更高的显示效果;
    不过现今该种点阵字体主要只作为“辅助”的部分,当用户设置的字体尺寸并没有拥有位图像时,字体便会以矢量图象方式显示;
    而当打印时,印有字体无论大小亦会使用矢量字体打印。常见的纯点阵字体有 bdf,pcf,fnt,hbf 等格式。

    矢量字体

    http://zh.wikipedia.org/wiki/%E7%9F%A2%E9%87%8F%E5%AD%97%E4%BD%93

    矢量字体 是与 点阵字体 相对应的一种字体。

    矢量字体的每个字形都是通过数学方程来描述的,一个字形上分区出若干个关键点,相邻关键点之间由一条光滑曲线连接,这条曲线可以由有限个参数来唯一确定。
    矢量字的好处是字体可以无级缩放而不会产生变形。目前主流的矢量字体格式有3种:

    Type1TrueTypeOpenType,这三种格式都是平台无关的。

    Type1全称PostScript Type1,是1985年由Adobe公司提出的一套矢量字体标准,由于这个标准是基于PostScript Description Language(PDL),
    而PDL又是高端打印机首选的打印描述语言,所以Type1迅速流行起来。但是Type1是非开放字体,Adobe对使用Type1的公司征收高额的使用费。

    TrueType是1991年由Apple公司与Microsoft公司联合提出另一套矢量字标准。

    Type1使用三次贝塞尔曲线来描述字形,TrueType则使用二次贝塞尔曲线来描述字形。
    所以Type1的字体比TrueType字体更加精确美观。一个误解是,Type1字体比TrueType字体占用空间多。
    这是因为同样描述一个圆形,二次贝塞尔曲线只需要8个关键点和7段二次曲线;而三次贝塞尔曲线则需要12个关键点和11段三次曲线。
    然而实际情况是一般来说 Type1比TrueType要小10%左右。这是因为对于稍微复杂的字形,为了保持平滑,TrueType必须使用更多的关键点。
    由于现代大部分打印机都是使用PDL作为打印描述语言,所以True1字体打印的时候不会产生形变,速度快;
    而TrueType则需要翻译成PDL,由于曲线方程的变化,还会产生一定的形变,不如Type1美观。

    这么说来,Type1应该比TrueType更具有优势,为什么如今的计算机上TrueType反而比Type1使用更广泛呢?

    第一个原因是:Type1由于字体方程的复杂,所以在屏幕上渲染的时候花费的时间多,解决方案是大部分Type1字体嵌入了点阵字体,这样渲染快,
    但是边缘不光滑,比较难看。很多ps文档和ps转换的pdf文档都是这样,在计算机上浏览的时候字体很难看,但是打印出来很美观。
    TrueType则渲染比较快,可以平滑的显示在屏幕上,看上去很美观。

    第二个原因是Type1的高额使用费,使得Type1没有被所有的操作系统所支持。
    Windows家族只有OS/2和Windows 2000及之后的版本从操作系统级别开始支持Type1。
    由于这个问题,Adobe只好在其所有的产品中嵌入Adobe Type Manager(ATM)作为渲染引擎。

    OpenType则是Type1与TrueType之争的最终产物。
    1995年,Adobe公司和Microsoft公司开始联手开发一种兼容Type1和TrueType,并且真正支持Unicode的字体,后来在发布的时候,正式命名为OpenType。
    OpenType可以嵌入Type1和TrueType,这样就兼有了二者的特点,无论是在屏幕上察看还是打印,质量都非常优秀。
    可以说OpenType是一个三赢的结局,无论是Adobe,Microsoft还是最终用户,都从OpenType中得到了好处。
    Windows家族从Windows 2000开始,正式支持OpenType。
    打开系统的字体目录(一般是C:\Windows\Fonts\或C:\Winnt\Fonts),可以看到:
    一个红色A的图标的是点阵字体,
    两个蓝色重叠的T的图标是TrueType字体,
    两个绿色重叠的T的图标是TrueType字体集,
    一个绿色O的图标就是OpenType字体。

    如果字体扩展名为FON表示点阵字库
    如果扩展名为TTF/OTF则表示矢量字库
    如果扩展名为TTC则表示矢量字库集

    Raster, Vector, TrueType, and OpenType Fonts

    http://msdn.microsoft.com/ZH-CN/library/windows/desktop/dd162893(v=vs.85).aspx

    Applications can use four different kinds of font technologies to display and print text:

    • Raster
    • Vector
    • TrueType
    • Microsoft OpenType

    The differences between these fonts reflect the way that the glyph for each character or
    symbol is stored in the respective font-resource file:

    • In raster fonts, a glyph is a bitmap
      that the system uses to draw a single character or symbol in the font.
    • In vector fonts, a glyph is a collection of line endpoints that define the line segments
      that the system uses to draw a character or symbol in the font.
    • In TrueType and OpenType fonts, a glyph is a collection of line and curve commands as well as a collection of hints.

    The system uses the line and curve commands to define the outline of the bitmap
    for a character or symbol in the TrueType or Microsoft OpenType font.
    The system uses the hints to adjust the length of the lines and shapes of the curves used to draw the character or symbol.
    These hints and the respective adjustments are based on the amount of scaling used to reduce or increase the size of the bitmap.
    An OpenType font is equivalent to a TrueType font except that an OpenType font
    allows PostScript glyph definitions in addition to TrueType glyph definitions.

    Because the bitmaps for each glyph in a raster font are designed for a specific resolution of device,
    raster fonts are generally considered to be device dependent.

    Vector fonts, on the other hand, are not device dependent,
    because each glyph is stored as a collection of scalable lines.

    However, vector fonts are generally drawn more slowly than raster or TrueType and OpenType fonts.

    TrueType and OpenType fonts provide both relatively fast drawing speed and true device independence.
    By using the hints associated with a glyph, a developer can scale the characters
    from a TrueType or OpenType font up or down and still maintain their original shape.

    As previously mentioned, the glyphs for a font are stored in a font-resource file.
    A font-resource file is actually a DLL that contains only data, there is no code.

    For raster and vector fonts, this data is divided into two parts:

    A header describing the font's metrics and the glyph data.
    A font-resource file for a raster or vector font is identified by the .fon file name extension.

    For TrueType and OpenType fonts, there are two files for each font:

    the first file contains a relatively short header and
    the second contains the actual font data.

    The first file is identified by an .fot extension and
    the second is identified by a .ttf extension.

    TrueType、PostScript 和 OpenType 字体之间的区别是什么? 

    http://windows.microsoft.com/zh-cn/windows-vista/whats-the-difference-between-truetype-postscript-and-opentype-fonts 

    TrueType 字体可调整到任意大小,并且在所有大小情况下,都是清晰可读的。可以将它们发送给 Windows 支持的任何打印机或其他输出设备。
    OpenType 字体与 TrueType 字体相关,但包括更大的基本字符集扩展,包括小型大写、老样式数字及更复杂的形状,
    “字形”“连字”。OpenType 字体在任意大小下仍清晰可读,并且可以发送到 Windows 支持的任何打印机或其他输出设备。
    PostScript 字体线条平滑、细节突出,是一种高质量的字体。他们经常用于打印,尤其是经常用于如书籍或杂志等的专业质量的打印。

    哪种字体最适合我?

    不一定。如果只想要一种打印效果好,并且在屏幕上易于阅读的字体,则可以考虑使用 TrueType 字体。
    如果需要大型字符集用于语言覆盖和精细的版式,则可能想要使用 OpenType 字体。
    如果需要打印专业质量的印刷出版物,如有光泽的杂志,或需要进行商业打印,则 PostScript 字体是一种很好的选择。

    TrueType

    http://zh.wikipedia.org/wiki/TrueType 

    TrueType是由美国苹果公司和微软公司共同开发的一种电脑轮廓字体类型标准。这种类型字体文件的扩展名是.ttf,类型代码是tfil

    早在80年代末,苹果公司为了对抗Adobe公司的Type 1PostScript字体,设计开发了TrueType,之后微软加入了开发,后来视窗系统的字体格式基本上都统一成TrueType,
    而在苹果的麦金塔系统中却成了PostScript和TrueType对立的局面。TrueType后来也被Linux等系统使用,成为标准字体。
    TrueType的主要强项在于它能给开发者提供关于字体显示、不同字体大小的像素级显示等的高级控制。

    在新开发的OpenType类型字体中,可以选择PostScript还是TrueType作为记述方式。

    TrueType字体中的字符(或 字形)轮廓由直线和二次贝塞尔曲线片段构成。这些构建在数学上比平面设计界PostScript使用的三次贝塞尔曲线(也被Type 1 字体所使用)更容易处理。
    尽管如此,对于多数形状,三次要比二次贝塞尔曲线需要更多的点来描述。这个差异也意味着它不能将 Type 1 无损地转换为TrueType格式,可是你可以无损地将TrueType转换为Type 1。

    OpenType

    https://zh.wikipedia.org/wiki/OpenType

    OpenType,是一种可缩放字型(scalable font)电脑字体类型,采用PostScript格式,是美国微软公司Adobe公司联合开发,用来替代TrueType字型的新字型。
    这类字体的文件扩展名为.otf,类型代码是OTTO,现行标准为OpenType 1.4。

    OpenType最初发表于1996年,并在2000年之后出现大量字体。它源于微软公司的TrueType Open字型,TrueType Open字型又源于TrueType字型。
    OpenType font包括了Adobe CID-Keyed font技术。Adobe公司已经在2002年末将其字体库全部改用OpenType格式。
    到2005年大概有一万多种OpenType字体,Adobe产品占了三分之一。

    OpenType之前的主流是苹果公司和微软开发的TrueType类型,还有Adobe公司开发的Type 1("PostScript")字体类型。
    微软在1994年独自开发了"TrueType Open"类型[1],之后1996年Adobe加入开发,增加了其在Type 1字体中使用的对字体轮廓的支持,OpenType这个名字于是便用来称呼合并之后的技术。

    在后来的十几年中,Adobe和微软继续开发改进OpenType格式,在2005年末,OpenType开始申请成为国际标准组织(ISO)的公开标准。
    这个新标准已经升级到OpenType 1.4,以适应ISO语言标准的一些变化,之后其被称为"开放字体类型(Open Font Format)"。这个新标准计划在2006年末完成。

    OpenType使用TrueType字体通用的"sfnt"架构,但其加入若干“智能字体”(smartfont)选项,可以加强字体的字形和语言支持能力。
    OpenType字体中的字形(glyph)、轮廓数据可以在两种格式中任选其一:
    一个是在'glyf'表中TrueType格式轮廓,另一个是在'CFF '表中的CFF(压缩字体格式,Compact Font Format)格式轮廓。
    CFF轮廓数据是基于PostScript语言Type 2字体格式。表格名'CFF '长度为四个字符,并且以一个空格字符结尾。

    在如版式等大多数情况下,轮廓数据格式是什么类型并不重要,但这两种格式的区别在图元光栅化(rasterisation)的时候就有区别。
    而单从"OpenType"一词中看不出来使用的是哪种数据格式,所以有时候使用"OpenType (PostScript flavor)", "OpenType CFF",或者"OpenType (TrueType flavor)"等称呼加以区别。

    OpenType的主要特征有:

    • 字体编码基于万国码(Unicode),可以支持任何文本,或者同时支持多种文本。
    • 一个OpenType字体可以带有超多65,536个字形。对于中文字库而言,最基本的字汇应该包含Big5的13,060个汉字或是GB2312-80标准的6763个常用字型,
      这些字应该能满足一般用户的使用,对于户籍管理、银行系统和出版社等用户而言需要2万多字甚至7万多字的支持。
    • 字体有高级字形特征,可以进行对复杂文本进行充分的字形处理,并能通过更简单的脚本施加更复杂的字形效果,比如用罗马字母脚本书写英文。
    • 字体文件可以拓展到跨平台,能够在Mac OS,Windows和一些Unix系统中进行设置。
    • 若不含异体字等拓展字形和拓展文字性能,OpenType CFF字体比Type 1要小

    PostScript字体

    http://baike.baidu.cn/view/121491.htm

    按 PostScript 页面描述语言 (PDL) 规则定义的字体,并且只能在 PostScript 兼容的打印机上打印。
    当按屏幕字体显示的文档被发送到 PostScript 打印机时,如果有 PostScript 版本的字体,则打印机将使用该字体打印。
    如果该字体不存在,但计算机安装了该版本的字体,则该字体将被下载到打印机。
    如果打印机或计算机上都没有安装 PostScript font 字体,则位映射字体(光栅字体)被转换为 PostScript 字体,而打印机就使用位映射字体打印文本。
    按印刷工业中的质量标准,PostScript 字体在平滑性、细节和忠实性方面比位映射字体要好

    光栅字体

    存储为位图的字体。光栅字体是为特定打印机设计的,有特定的大小和分辨率,而且不能缩放或旋转。如果打印机不支持光栅字体,就不会打印这些字体。
    五种光栅字体分别为 Courier、MS Sans Serif、MS Serif、Small 和 Symbol。光栅字体也被称为位图字体。

    Enumerating the Installed Fonts

    http://msdn.microsoft.com/en-us/library/windows/desktop/dd162615(v=vs.85).aspx

    In some instances, an application must be able to enumerate the available fonts and select the one most appropriate for a particular operation.
    An application can enumerate the available fonts by calling the EnumFonts or EnumFontFamilies function.
    These functions send information about the available fonts to a callback function that the application supplies.
    The callback function receives information in LOGFONT and NEWTEXTMETRIC structures.
    (The NEWTEXTMETRIC structure contains information about a TrueType font.
    When the callback function receives information about a non-TrueType font, the information is contained in a TEXTMETRIC structure.)
    By using this information, an application can limit the user's choices to only those fonts that are available.

    The EnumFontFamilies function is similar to the EnumFonts function but includes some extra functionality. 
    EnumFontFamilies allows an application to take advantage of styles available with TrueType fonts.
    New and upgraded applications should use 
    EnumFontFamilies instead of EnumFonts.

    TrueType fonts are organized around a typeface name (for example, Courier New) and style names (for example, italic, bold, and extra-bold).
    The EnumFontFamilies function enumerates all the styles associated with a specified family name, not simply the bold and italic attributes.
    For example, when the system includes a TrueType font called Courier New Extra-BoldEnumFontFamilies lists it with the other Courier New fonts.
    The capabilities of EnumFontFamilies are helpful for fonts with many or unusual styles and for fonts that cross international borders.

    If an application does not supply a typeface name, the EnumFonts and EnumFontFamiliesfunctions supply information about one font in each available family.
    To enumerate all the fonts in a device context, the application can specify NULL for the typeface name,
    compile a list of the available typefaces, and then enumerate each font in each typeface.

    EnumFonts function

    The EnumFonts function enumerates the fonts available on a specified device.
    For each font with the specified typeface name, the EnumFonts function retrieves information about
    that font and passes it to the application defined callback function.
    This callback function can process the font information as desired.
    Enumeration continues until there are no more fonts or the callback function returns zero.

    Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the EnumFontFamiliesEx function.

    int EnumFonts(
      _In_  HDC hdc,
      _In_  LPCTSTR lpFaceName,
      _In_  FONTENUMPROC lpFontFunc,
      _In_  LPARAM lParam
    );

    Parameters

    hdc [in]

    A handle to the device context from which to enumerate the fonts.

    lpFaceName [in]

    A pointer to a null-terminated string that specifies the typeface name of the desired fonts.
    If lpFaceName is NULLEnumFonts randomly selects and enumerates one font of each available typeface.

    lpFontFunc [in]

    A pointer to the application definedcallback function. For more information, see EnumFontsProc.

    lParam [in]

    A pointer to any application-defined data. The data is passed to the callback function along with the font information.

    Return value

    The return value is the last value returned by the callback function. Its meaning is defined by the application.

    Remarks

    Use EnumFontFamiliesEx instead of EnumFonts.
    The EnumFontFamiliesEx function differs from the EnumFonts function in that it retrieves the style names associated with a TrueType font.
    With EnumFontFamiliesEx, you can retrieve information about font styles that cannot be enumerated using the EnumFonts function.

    The fonts for many East Asian languages have two typeface names: an English name and a localized name. 
    EnumFontsEnumFontFamilies, and EnumFontFamiliesEx return the English typeface name if the system locale does not match the language of the font.

    EnumFontFamilies function

    http://msdn.microsoft.com/en-us/library/windows/desktop/dd162619(v=vs.85).aspx

    The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device.
    Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the EnumFontFamiliesEx function.

    int EnumFontFamilies(
      _In_  HDC hdc,
      _In_  LPCTSTR lpszFamily,
      _In_  FONTENUMPROC lpEnumFontFamProc,
      _In_  LPARAM lParam
    );

    Parameters

    hdc [in]

    A handle to the device context from which to enumerate the fonts.

    lpszFamily [in]

    A pointer to a null-terminated string that specifies the family name of the desired fonts.
    If lpszFamily is NULLEnumFontFamilies selects and enumerates one font of each available type family.

    lpEnumFontFamProc [in]

    A pointer to the application defined callback function. For information, see EnumFontFamProc.

    lParam [in]

    A pointer to application-supplied data. The data is passed to the callback function along with the font information.

    Return value

    The return value is the last value returned by the callback function. Its meaning is implementation specific.

    Remarks

    For each font having the typeface name specified by the lpszFamily parameter, the EnumFontFamilies function retrieves information about
    that font and passes it to the function pointed to by the lpEnumFontFamProc parameter.
    The application defined callback function can process the font information as desired.
    Enumeration continues until there are no more fonts or the callback function returns zero.

    When the graphics mode on the device context is set to GM_ADVANCED using the SetGraphicsMode function and
    the DEVICE_FONTTYPE flag is passed to the FontType parameter, this function returns a list of type 1 and OpenType fonts on the system.
    When the graphics mode is not set to GM_ADVANCED, this function returns a list of type 1, OpenType, and TrueType fonts on the system.

    The fonts for many East Asian languages have two typeface names: an English name and a localized name. 
    EnumFontsEnumFontFamilies, and EnumFontFamiliesEx return the English typeface name if the system locale does not match the language of the font.

    EnumFontsProc 

    The EnumFontsProc function is an application-defined callback function that processes font data from the EnumFonts function.
    This function is provided only for compatibility with 16-bit versions of Windows. Applications should call the EnumFontFamiliesEx function.

    The AND (&) operator can be used with the RASTER_FONTTYPE and DEVICE_FONTTYPE constants to determine the font type. 
    The RASTER_FONTTYPE bit of the FontType parameter specifies whether the font is a raster or vector font. 
    If the bit is one, the font is a raster font; if zero, it is a vector font. 
    The DEVICE_FONTTYPE bit of FontType specifies whether the font is a device-based or graphics device interface (GDI)-based font. 
    If the bit is one, the font is a device-based font; if zero, it is a GDI-based font.

    The following example uses the EnumFontFamilies function to retrieve the number of available raster, vector, and TrueType font families.

        UINT uAlignPrev; 
        int aFontCount[] = { 0, 0, 0 }; 
        char szCount[8];
            HRESULT hr;
            size_t * pcch; 
     
        EnumFontFamilies(hdc, (LPCTSTR) NULL, 
            (FONTENUMPROC) EnumFamCallBack, (LPARAM) aFontCount); 
     
        uAlignPrev = SetTextAlign(hdc, TA_UPDATECP); 
     
        MoveToEx(hdc, 10, 50, (LPPOINT)NULL); 
        TextOut(hdc, 0, 0, "Number of raster fonts: ", 24); 
        itoa(aFontCount[0], szCount, 10); 
            
            hr = StringCchLength(szCount, 9, pcch);
            if (FAILED(hr))
            {
            // TODO: write error handler 
            }
        TextOut(hdc, 0, 0, szCount, *pcch); 
     
        MoveToEx(hdc, 10, 75, (LPPOINT)NULL); 
        TextOut(hdc, 0, 0, "Number of vector fonts: ", 24); 
        itoa(aFontCount[1], szCount, 10);
            hr = StringCchLength(szCount, 9, pcch);
            if (FAILED(hr))
            {
            // TODO: write error handler 
            } 
        TextOut(hdc, 0, 0, szCount, *pcch); 
     
        MoveToEx(hdc, 10, 100, (LPPOINT)NULL); 
        TextOut(hdc, 0, 0, "Number of TrueType fonts: ", 26); 
        itoa(aFontCount[2], szCount, 10);
            hr = StringCchLength(szCount, 9, pcch);
            if (FAILED(hr))
            {
            // TODO: write error handler 
            }
        TextOut(hdc, 0, 0, szCount, *pcch); 
     
        SetTextAlign(hdc, uAlignPrev); 
     
    BOOL CALLBACK EnumFamCallBack(LPLOGFONT lplf, LPNEWTEXTMETRIC lpntm, DWORD FontType, LPVOID aFontCount) 
    { 
        int far * aiFontCount = (int far *) aFontCount; 
     
        // Record the number of raster, TrueType, and vector  
        // fonts in the font-count array.  
     
        if (FontType & RASTER_FONTTYPE) 
            aiFontCount[0]++; 
        else if (FontType & TRUETYPE_FONTTYPE) 
            aiFontCount[2]++; 
        else 
            aiFontCount[1]++; 
     
        if (aiFontCount[0] || aiFontCount[1] || aiFontCount[2]) 
            return TRUE; 
        else 
            return FALSE; 
     
        UNREFERENCED_PARAMETER( lplf ); 
        UNREFERENCED_PARAMETER( lpntm ); 
    } 

    This example uses two masks, RASTER_FONTTYPE and TRUETYPE_FONTTYPE, to determine the type of font being enumerated.
    If the RASTER_FONTTYPE bit is set, the font is a raster font.
    If the TRUETYPE_FONTTYPE bit is set, the font is a TrueType font.
    If neither bit is set, the font is a vector font.
    A third mask, DEVICE_FONTTYPE, is set when a device (for example, a laser printer) supports downloading TrueType fonts;
    it is zero if the device is a display adapter, dot-matrix printer, or other raster device.
    An application can also use the DEVICE_FONTTYPE mask to distinguish GDI-supplied raster fonts from device-supplied fonts.
    The system can simulate bold, italic, underline, and strikeout attributes for GDI-supplied raster fonts, but not for device-supplied fonts.

    An application can also check bits 1 and 2 in the tmPitchAndFamily member of the NEWTEXTMETRIC structure to identify a TrueType font.
    If bit 1 is 0 and bit 2 is 1, the font is a TrueType font.

    Vector fonts are categorized as OEM_CHARSET instead of ANSI_CHARSET.
    Some applications identify vector fonts by using this information, checking the tmCharSet member of the NEWTEXTMETRIC structure.
    This categorization usually prevents the font mapper from choosing vector fonts unless they are specifically requested.
    (Most applications no longer use vector fonts because their strokes are single lines and
    they take longer to draw than TrueType fonts, which offer many of the same scaling and rotation features that required vector fonts.)

    EnumFontFamiliesEx function

    The EnumFontFamiliesEx function enumerates all uniquely-named fonts in the system
    that match the font characteristics specified by the LOGFONT structure.
    EnumFontFamiliesEx enumerates fonts based on typeface name, character set, or both.

    int EnumFontFamiliesEx(
      _In_  HDC hdc,
      _In_  LPLOGFONT lpLogfont,
      _In_  FONTENUMPROC lpEnumFontFamExProc,
      _In_  LPARAM lParam,
      DWORD dwFlags
    );

    Parameters

    hdc [in] 
      

    A handle to the device context from which to enumerate the fonts. 

     

     

    lpLogfont [in]

    A pointer to a LOGFONT structure that contains information about the fonts to enumerate. The function examines the following members.

    Member

    Description

    lfCharSet

    If set to DEFAULT_CHARSET, the function enumerates all uniquely-named fonts in all character sets.
    (If there are two fonts with the same name, only one is enumerated.)
    If set to a valid character set value, the function enumerates only fonts in the specified character set.

    lfFaceName

    If set to an empty string, the function enumerates one font in each available typeface name.
    If set to a valid typeface name, the function enumerates all fonts with the specified name.

    lfPitchAndFamily

    Must be set to zero for all language versions of the operating system.

    lpEnumFontFamExProc [in]

    A pointer to the application defined callback function. For more information, see the EnumFontFamExProc function.

    lParam [in]

    An application defined value. The function passes this value to the callback function along with font information.

    dwFlags

    This parameter is not used and must be zero.

    Return value

    The return value is the last value returned by the callback function.
    This value depends on which font families are available for the specified device.

    Remarks

    The EnumFontFamiliesEx function does not use tagged typeface names to identify character sets.
    Instead, it always passes the correct typeface name and a separate character set value to the callback function.
    The function enumerates fonts based on the values of the lfCharSet and lfFaceName members in the LOGFONT structure.

    As with EnumFontFamiliesEnumFontFamiliesEx enumerates all font styles. Not all styles of a font cover the same character sets.
    For example, Fontorama Bold might contain ANSI, Greek, and Cyrillic characters, but Fontorama Italic might contain only ANSI characters.
    For this reason, it's best not to assume that a specified font covers a specific character set, even if it is the ANSI character set.
    The following table shows the results of various combinations of values for lfCharSet andlfFaceName.

    ValuesMeaning

    lfCharSet = DEFAULT_CHARSET

    lfFaceName = '\0'

    Enumerates all uniquely-named fonts within all character sets.
    If there are two fonts with the same name, only one is enumerated.

    lfCharSet = DEFAULT_CHARSET

    lfFaceName = a specific font

    Enumerates all character sets and styles in a specific font.

    lfCharSet =a specific character set

    lfFaceName = '\0'

    Enumerates all styles of all fonts in the specific character set.

    lfCharSet =a specific character set

    lfFaceName = a specific font

    Enumerates all styles of a font in a specific character set.

    The following code sample shows how these values are used.

    // To enumerate all styles and charsets of all fonts: 
    lf.lfFaceName[0] = '\0';
    lf.lfCharSet = DEFAULT_CHARSET;
    HRESULT hr;
    
    // To enumerate all styles and character sets of the Arial font: 
    hr = StringCchCopy( (LPSTR)lf.lfFaceName, LF_FACESIZE, "Arial" );
    if (FAILED(hr))
    {
    // TODO: write error handler 
    }
    
    lf.lfCharSet = DEFAULT_CHARSET;
    
    
    
    // To enumerate all styles of all fonts for the ANSI character set 
    lf.lfFaceName[0] = '\0';
    lf.lfCharSet = ANSI_CHARSET;
    
    // To enumerate all styles of Arial font that cover the ANSI charset 
    hr = StringCchCopy( (LPSTR)lf.lfFaceName, LF_FACESIZE, "Arial" );
    if (FAILED(hr))
    {
    // TODO: write error handler 
    }
    
    lf.lfCharSet = ANSI_CHARSET;

    Note, based on the values of lfCharSet and lfFaceNameEnumFontFamiliesEx will enumerate the same font as many times
    as there are distinct character sets in the font. This can create an extensive list of fonts which can be burdensome to a user.
    For example, the Century Schoolbook font can appear for the Baltic, Western, Greek, Turkish, and Cyrillic character sets.
    To avoid this, an application should filter the list of fonts.

    The fonts for many East Asian languages have two typeface names: an English name and a localized name. 
    EnumFontsEnumFontFamilies, and EnumFontFamiliesEx return the English typeface name if the system locale does not match the language of the font.

    When the graphics mode on the device context is set to GM_ADVANCED using the SetGraphicsMode function and
    the DEVICE_FONTTYPE flag is passed to the FontType parameter, this function returns a list of type 1 and OpenType fonts on the system.
    When the graphics mode is not set to GM_ADVANCED, this function returns a list of type 1, OpenType, and TrueType fonts on the system.

    EnumFontFamExProc callback function

    The EnumFontFamExProc function is an application defined callback function used with the EnumFontFamiliesEx function.
    It is used to process the fonts. It is called once for each enumerated font.
    The FONTENUMPROC type defines a pointer to this callback function. 
    EnumFontFamExProc is a placeholder for the application defined function name.

    int CALLBACK EnumFontFamExProc(
      const LOGFONT *lpelfe,
      const TEXTMETRIC *lpntme,
      DWORD FontType,
      LPARAM lParam
    );

    Parameters

    lpelfe

    A pointer to an LOGFONT structure that contains information about the logical attributes of the font.
    To obtain additional information about the font, you can cast the result as an ENUMLOGFONTEX or ENUMLOGFONTEXDV structure.

    lpntme

    A pointer to a structure that contains information about the physical attributes of a font.
    The function uses the NEWTEXTMETRICEX structure for TrueType fonts; and the TEXTMETRIC structure for other fonts.

    This can be an ENUMTEXTMETRIC structure.

    FontType

    The type of the font. This parameter can be a combination of these values:

      { EnumFonts Masks }
      {$EXTERNALSYM RASTER_FONTTYPE}
      RASTER_FONTTYPE = 1;
      {$EXTERNALSYM DEVICE_FONTTYPE}
      DEVICE_FONTTYPE = 2;
      {$EXTERNALSYM TRUETYPE_FONTTYPE}
      TRUETYPE_FONTTYPE = 4;
    RASTER_FONTTYPE
    TRUETYPE_FONTTYPE

    如果RASTER_FONTTYPE位被设置,则该字体是一种光栅字体
    如果TRUETYPE_FONTTYPE位被设置,该字体是一种TrueType字体
    如果上述两位都未被设置,则该字体是一种向量字体

    DEVICE_FONTTYPE
     
    The font is a device-based font. If this value is not set, the font is a GDI-based font.
    当一种设备(如激光打印机)支持下载TrueType字体或该字体是一种驻留设备的字体,则DEVICE_FONTTYPE位被设置 1
    当设备是一种显示设备、点阵打印机或其他光栅设备,则该位为0。

    应用程序也可用DEVICE_FONTTYPE来区别图形设备接口(GDI)提供的光栅字体和设备提供的字体。
    GDI可以为GDI提供的光栅字体模拟粗体、斜体、下划线和删除线(strikeout)属性,但却不支持设备提供的字体。
    lParam

    The application-defined data passed by the EnumFontFamiliesEx function.

    Return value

    The return value must be a nonzero value to continue enumeration; to stop enumeration, the return value must be zero.

    Remarks

    An application must register this callback function by passing its address to the EnumFontFamiliesEx function.

    When the graphics mode on the device context is set to GM_ADVANCED using theSetGraphicsMode function and
    the DEVICE_FONTTYPE flag is passed to the FontType parameter, this function returns a list of type 1 and OpenType fonts on the system.
    When the graphics mode is not set to GM_ADVANCED, this function returns a list of type 1, OpenType, and TrueType fonts on the system.

    Unlike the EnumFontFamProc callback function, EnumFontFamExProc receives extended information about a font.
    The ENUMLOGFONTEX structure includes the localized name of the script (character set) and
    the NEWTEXTMETRICEX structure includes a font-coverage signature.

    The NEWTEXTMETRICEX structure contains information about a physical font.

    typedef struct tagNEWTEXTMETRICEX {
      NEWTEXTMETRIC ntmTm; // A NEWTEXTMETRIC structure.
      FONTSIGNATURE ntmFontSig; // A FONTSIGNATURE structure indicating the coverage of the font.
    } NEWTEXTMETRICEX;

    A FONTSIGNATURE structure indicating the coverage of the font.

    typedef struct tagFONTSIGNATURE {
      DWORD fsUsb[4];
      DWORD fsCsb[2];
    } FONTSIGNATURE, *PFONTSIGNATURE;

    Members

    fsUsb

    A 128-bit Unicode subset bitfield (USB) identifying up to 126 Unicode subranges.
    Each bit, except the two most significant bits, represents a single subrange.
    The most significant bit is always 1 and identifies the bitfield as a font signature;
    the second most significant bit is reserved and must be 0.
    Unicode subranges are numbered in accordance with the ISO 10646 standard.
    For more information, see Unicode Subset Bitfields.

    fsCsb

    A 64-bit, code-page bitfield (CPB) that identifies a specific character set or code page.
    Code pages are in the lower 32 bits of this bitfield.
    The high 32 are used for non-Windows code pages.
    For more information, see Code Page Bitfields.

    Remarks

    GDI relies on Windows code pages fitting within a 32-bit value.
    Furthermore, the highest 2 bits within this value are reserved for GDI internal use and may not be assigned to code pages.

    Code Page Bitfields

    Note  All locales do not support code pages. The bitfields described in this topic do not apply to Unicode locales.
    To determine supported scripts for a locale, your application can use the locale identifier constant LOCALE_SSCRIPTS with GetLocaleInfoEx.

    Note  The presence of a bit in a code page bitfield does not necessarily mean that all strings for a locale
    can be encoded in that code page without loss. To preserve data without loss, using Unicode UTF-8 or UTF-16 is recommended.

    BitCode pageDescription
    ANSI    
    0 1252 Latin 1
    1 1250 Latin 2: Central Europe
    2 1251 Cyrillic
    3 1253 Greek
    4 1254 Turkish
    5 1255 Hebrew
    6 1256 Arabic
    7 1257 Baltic
    8 1258 Vietnamese
    9 - 15   Reserved for ANSI
    ANSI and OEM    
    16 874 Thai
    17 932 Japanese, Shift-JIS
    18 936 Simplified Chinese (PRC, Singapore)
    19 949 Korean Unified Hangul Code (Hangul TongHabHyung Code)
    20 950 Traditional Chinese (Taiwan; Hong Kong SAR, PRC)
    21 1361 Korean (Johab)
    22 - 29   Reserved for alternate ANSI and OEM
    30 - 31   Reserved by system.
    OEM    
    32 - 46   Reserved for OEM
    47 1258 Vietnamese
    48 869 Modern Greek
    49 866 Russian
    50 865 Nordic
    51 864 Arabic
    52 863 Canadian French
    53 862  
    54 861 Icelandic
    55 860 Portuguese
    56 857 Turkish
    57 855 Cyrillic; primarily Russian
    58 852 Latin 2
    59 775 Baltic
    60 737 Greek; formerly 437G
    61 708; 720 Arabic; ASMO 708
    62 850 Multilingual Latin 1
    63 437 US

    ANSI code pages can be different on different computers, or can be changed for a single computer, leading to data corruption. For the most consistent results, applications should use Unicode, such as UTF-8 or UTF-16, instead of a specific code page.

    Identifier.NET NameAdditional information
    037 IBM037 IBM EBCDIC US-Canada
    437 IBM437 OEM United States
    500 IBM500 IBM EBCDIC International
    708 ASMO-708 Arabic (ASMO 708)
    709   Arabic (ASMO-449+, BCON V4)
    710   Arabic - Transparent Arabic
    720 DOS-720 Arabic (Transparent ASMO); Arabic (DOS)
    737 ibm737 OEM Greek (formerly 437G); Greek (DOS)
    775 ibm775 OEM Baltic; Baltic (DOS)
    850 ibm850 OEM Multilingual Latin 1; Western European (DOS)
    852 ibm852 OEM Latin 2; Central European (DOS)
    855 IBM855 OEM Cyrillic (primarily Russian)
    857 ibm857 OEM Turkish; Turkish (DOS)
    858 IBM00858 OEM Multilingual Latin 1 + Euro symbol
    860 IBM860 OEM Portuguese; Portuguese (DOS)
    861 ibm861 OEM Icelandic; Icelandic (DOS)
    862 DOS-862 OEM Hebrew; Hebrew (DOS)
    863 IBM863 OEM French Canadian; French Canadian (DOS)
    864 IBM864 OEM Arabic; Arabic (864)
    865 IBM865 OEM Nordic; Nordic (DOS)
    866 cp866 OEM Russian; Cyrillic (DOS)
    869 ibm869 OEM Modern Greek; Greek, Modern (DOS)
    870 IBM870 IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2
    874 windows-874 ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows)
    875 cp875 IBM EBCDIC Greek Modern
    932 shift_jis ANSI/OEM Japanese; Japanese (Shift-JIS)
    936 gb2312 ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)
    949 ks_c_5601-1987 ANSI/OEM Korean (Unified Hangul Code)
    950 big5 ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)
    1026 IBM1026 IBM EBCDIC Turkish (Latin 5)
    1047 IBM01047 IBM EBCDIC Latin 1/Open System
    1140 IBM01140 IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)
    1141 IBM01141 IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)
    1142 IBM01142 IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)
    1143 IBM01143 IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)
    1144 IBM01144 IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)
    1145 IBM01145 IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)
    1146 IBM01146 IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)
    1147 IBM01147 IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)
    1148 IBM01148 IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)
    1149 IBM01149 IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)
    1200 utf-16 Unicode UTF-16, little endian byte order (BMP of ISO 10646); available only to managed applications
    1201 unicodeFFFE Unicode UTF-16, big endian byte order; available only to managed applications
    1250 windows-1250 ANSI Central European; Central European (Windows)
    1251 windows-1251 ANSI Cyrillic; Cyrillic (Windows)
    1252 windows-1252 ANSI Latin 1; Western European (Windows)
    1253 windows-1253 ANSI Greek; Greek (Windows)
    1254 windows-1254 ANSI Turkish; Turkish (Windows)
    1255 windows-1255 ANSI Hebrew; Hebrew (Windows)
    1256 windows-1256 ANSI Arabic; Arabic (Windows)
    1257 windows-1257 ANSI Baltic; Baltic (Windows)
    1258 windows-1258 ANSI/OEM Vietnamese; Vietnamese (Windows)
    1361 Johab Korean (Johab)
    10000 macintosh MAC Roman; Western European (Mac)
    10001 x-mac-japanese Japanese (Mac)
    10002 x-mac-chinesetrad MAC Traditional Chinese (Big5); Chinese Traditional (Mac)
    10003 x-mac-korean Korean (Mac)
    10004 x-mac-arabic Arabic (Mac)
    10005 x-mac-hebrew Hebrew (Mac)
    10006 x-mac-greek Greek (Mac)
    10007 x-mac-cyrillic Cyrillic (Mac)
    10008 x-mac-chinesesimp MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac)
    10010 x-mac-romanian Romanian (Mac)
    10017 x-mac-ukrainian Ukrainian (Mac)
    10021 x-mac-thai Thai (Mac)
    10029 x-mac-ce MAC Latin 2; Central European (Mac)
    10079 x-mac-icelandic Icelandic (Mac)
    10081 x-mac-turkish Turkish (Mac)
    10082 x-mac-croatian Croatian (Mac)
    12000 utf-32 Unicode UTF-32, little endian byte order; available only to managed applications
    12001 utf-32BE Unicode UTF-32, big endian byte order; available only to managed applications
    20000 x-Chinese_CNS CNS Taiwan; Chinese Traditional (CNS)
    20001 x-cp20001 TCA Taiwan
    20002 x_Chinese-Eten Eten Taiwan; Chinese Traditional (Eten)
    20003 x-cp20003 IBM5550 Taiwan
    20004 x-cp20004 TeleText Taiwan
    20005 x-cp20005 Wang Taiwan
    20105 x-IA5 IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5)
    20106 x-IA5-German IA5 German (7-bit)
    20107 x-IA5-Swedish IA5 Swedish (7-bit)
    20108 x-IA5-Norwegian IA5 Norwegian (7-bit)
    20127 us-ascii US-ASCII (7-bit)
    20261 x-cp20261 T.61
    20269 x-cp20269 ISO 6937 Non-Spacing Accent
    20273 IBM273 IBM EBCDIC Germany
    20277 IBM277 IBM EBCDIC Denmark-Norway
    20278 IBM278 IBM EBCDIC Finland-Sweden
    20280 IBM280 IBM EBCDIC Italy
    20284 IBM284 IBM EBCDIC Latin America-Spain
    20285 IBM285 IBM EBCDIC United Kingdom
    20290 IBM290 IBM EBCDIC Japanese Katakana Extended
    20297 IBM297 IBM EBCDIC France
    20420 IBM420 IBM EBCDIC Arabic
    20423 IBM423 IBM EBCDIC Greek
    20424 IBM424 IBM EBCDIC Hebrew
    20833 x-EBCDIC-KoreanExtended IBM EBCDIC Korean Extended
    20838 IBM-Thai IBM EBCDIC Thai
    20866 koi8-r Russian (KOI8-R); Cyrillic (KOI8-R)
    20871 IBM871 IBM EBCDIC Icelandic
    20880 IBM880 IBM EBCDIC Cyrillic Russian
    20905 IBM905 IBM EBCDIC Turkish
    20924 IBM00924 IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)
    20932 EUC-JP Japanese (JIS 0208-1990 and 0121-1990)
    20936 x-cp20936 Simplified Chinese (GB2312); Chinese Simplified (GB2312-80)
    20949 x-cp20949 Korean Wansung
    21025 cp1025 IBM EBCDIC Cyrillic Serbian-Bulgarian
    21027   (deprecated)
    21866 koi8-u Ukrainian (KOI8-U); Cyrillic (KOI8-U)
    28591 iso-8859-1 ISO 8859-1 Latin 1; Western European (ISO)
    28592 iso-8859-2 ISO 8859-2 Central European; Central European (ISO)
    28593 iso-8859-3 ISO 8859-3 Latin 3
    28594 iso-8859-4 ISO 8859-4 Baltic
    28595 iso-8859-5 ISO 8859-5 Cyrillic
    28596 iso-8859-6 ISO 8859-6 Arabic
    28597 iso-8859-7 ISO 8859-7 Greek
    28598 iso-8859-8 ISO 8859-8 Hebrew; Hebrew (ISO-Visual)
    28599 iso-8859-9 ISO 8859-9 Turkish
    28603 iso-8859-13 ISO 8859-13 Estonian
    28605 iso-8859-15 ISO 8859-15 Latin 9
    29001 x-Europa Europa 3
    38598 iso-8859-8-i ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
    50220 iso-2022-jp ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
    50221 csISO2022JP ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
    50222 iso-2022-jp ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
    50225 iso-2022-kr ISO 2022 Korean
    50227 x-cp50227 ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
    50229   ISO 2022 Traditional Chinese
    50930   EBCDIC Japanese (Katakana) Extended
    50931   EBCDIC US-Canada and Japanese
    50933   EBCDIC Korean Extended and Korean
    50935   EBCDIC Simplified Chinese Extended and Simplified Chinese
    50936   EBCDIC Simplified Chinese
    50937   EBCDIC US-Canada and Traditional Chinese
    50939   EBCDIC Japanese (Latin) Extended and Japanese
    51932 euc-jp EUC Japanese
    51936 EUC-CN EUC Simplified Chinese; Chinese Simplified (EUC)
    51949 euc-kr EUC Korean
    51950   EUC Traditional Chinese
    52936 hz-gb-2312 HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)
    54936 GB18030 Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)
    57002 x-iscii-de ISCII Devanagari
    57003 x-iscii-be ISCII Bengali
    57004 x-iscii-ta ISCII Tamil
    57005 x-iscii-te ISCII Telugu
    57006 x-iscii-as ISCII Assamese
    57007 x-iscii-or ISCII Oriya
    57008 x-iscii-ka ISCII Kannada
    57009 x-iscii-ma ISCII Malayalam
    57010 x-iscii-gu ISCII Gujarati
    57011 x-iscii-pa ISCII Punjabi
    65000 utf-7 Unicode (UTF-7)
    65001 utf-8 Unicode (UTF-8)

    Unicode Subset Bitfields

    Bit   Unicode subrange   Description
    0 0000 - 007F Basic Latin
    1 0080 - 00FF Latin-1 Supplement
    2 0100 - 017F Latin Extended-A
    3 0180 - 024F Latin Extended-B
    4 0250 - 02AF IPA Extensions
    1D00 - 1D7F Phonetic Extensions
    1D80 - 1DBF Phonetic Extensions Supplement
    5 02B0 - 02FF Spacing Modifier Letters
    A700 - A71F Modifier Tone Letters
    6 0300 - 036F Combining Diacritical Marks
    1DC0 - 1DFF Combining Diacritical Marks Supplement
    7 0370 - 03FF Greek and Coptic
    8 2C80 - 2CFF Coptic
    9 0400 - 04FF Cyrillic
    0500 - 052F Cyrillic Supplement
    2DE0 - 2DFF Cyrillic Extended-A
    A640 - A69F Cyrillic Extended-B
    10 0530 - 058F Armenian
    11 0590 - 05FF Hebrew
    12 A500 - A63F Vai
    13 0600 - 06FF Arabic
    0750 - 077F Arabic Supplement
    14 07C0 - 07FF NKo
    15 0900 - 097F Devanagari
    16 0980 - 09FF Bengali
    17 0A00 - 0A7F Gurmukhi
    18 0A80 - 0AFF Gujarati
    19 0B00 - 0B7F Oriya
    20 0B80 - 0BFF Tamil
    21 0C00 - 0C7F Telugu
    22 0C80 - 0CFF Kannada
    23 0D00 - 0D7F Malayalam
    24 0E00 - 0E7F Thai
    25 0E80 - 0EFF Lao
    26 10A0 - 10FF Georgian
    2D00 - 2D2F Georgian Supplement
    27 1B00 - 1B7F Balinese
    28 1100 - 11FF Hangul Jamo
    29 1E00 - 1EFF Latin Extended Additional
    2C60 - 2C7F Latin Extended-C
    A720 - A7FF Latin Extended-D
    30 1F00 - 1FFF Greek Extended
    31 2000 - 206F General Punctuation
    2E00 - 2E7F Supplemental Punctuation
    32 2070 - 209F Superscripts And Subscripts
    33 20A0 - 20CF Currency Symbols
    34 20D0 - 20FF Combining Diacritical Marks For Symbols
    35 2100 - 214F Letterlike Symbols
    36 2150 - 218F Number Forms
    37 2190 - 21FF Arrows
    27F0 - 27FF Supplemental Arrows-A
    2900 - 297F Supplemental Arrows-B
    2B00 - 2BFF Miscellaneous Symbols and Arrows
    38 2200 - 22FF Mathematical Operators
    27C0 - 27EF Miscellaneous Mathematical Symbols-A
    2980 - 29FF Miscellaneous Mathematical Symbols-B
    2A00 - 2AFF Supplemental Mathematical Operators
    39 2300 - 23FF Miscellaneous Technical
    40 2400 - 243F Control Pictures
    41 2440 - 245F Optical Character Recognition
    42 2460 - 24FF Enclosed Alphanumerics
    43 2500 - 257F Box Drawing
    44 2580 - 259F Block Elements
    45 25A0 - 25FF Geometric Shapes
    46 2600 - 26FF Miscellaneous Symbols
    47 2700 - 27BF Dingbats
    48 3000 - 303F CJK Symbols And Punctuation
    49 3040 - 309F Hiragana
    50 30A0 - 30FF Katakana
    31F0 - 31FF Katakana Phonetic Extensions
    51 3100 - 312F Bopomofo
    31A0 - 31BF Bopomofo Extended
    52 3130 - 318F Hangul Compatibility Jamo
    53 A840 - A87F Phags-pa
    54 3200 - 32FF Enclosed CJK Letters And Months
    55 3300 - 33FF CJK Compatibility
    56 AC00 - D7AF Hangul Syllables
    57 D800 - DFFF Non-Plane 0.
    Note that setting this bit implies that there is at least one supplementary code point
    beyond the Basic Multilingual Plane (BMP)
    that is supported by this font. See Surrogates and Supplementary Characters.
    58 10900 - 1091F Phoenician
    59 2E80 - 2EFF CJK Radicals Supplement
    2F00 - 2FDF Kangxi Radicals
    2FF0 - 2FFF Ideographic Description Characters
    3190 - 319F Kanbun
    3400 - 4DBF CJK Unified Ideographs Extension A
    4E00 - 9FFF CJK Unified Ideographs
    20000 - 2A6DF CJK Unified Ideographs Extension B
    60 E000 - F8FF Private Use Area
    61 31C0 - 31EF CJK Strokes
    F900 - FAFF CJK Compatibility Ideographs
    2F800 - 2FA1F CJK Compatibility Ideographs Supplement
    62 FB00 - FB4F Alphabetic Presentation Forms
    63 FB50 - FDFF Arabic Presentation Forms-A
    64 FE20 - FE2F Combining Half Marks
    65 FE10 - FE1F Vertical Forms
    FE30 - FE4F CJK Compatibility Forms
    66 FE50 - FE6F Small Form Variants
    67 FE70 - FEFF Arabic Presentation Forms-B
    68 FF00 - FFEF Halfwidth And Fullwidth Forms
    69 FFF0 - FFFF Specials
    70 0F00 - 0FFF Tibetan
    71 0700 - 074F Syriac
    72 0780 - 07BF Thaana
    73 0D80 - 0DFF Sinhala
    74 1000 - 109F Myanmar
    75 1200 - 137F Ethiopic
    1380 - 139F Ethiopic Supplement
    2D80 - 2DDF Ethiopic Extended
    76 13A0 - 13FF Cherokee
    77 1400 - 167F Unified Canadian Aboriginal Syllabics
    78 1680 - 169F Ogham
    79 16A0 - 16FF Runic
    80 1780 - 17FF Khmer
    19E0 - 19FF Khmer Symbols
    81 1800 - 18AF Mongolian
    82 2800 - 28FF Braille Patterns
    83 A000 - A48F Yi Syllables
    A490 - A4CF Yi Radicals
    84 1700 - 171F Tagalog
    1720 - 173F Hanunoo
    1740 - 175F Buhid
    1760 - 177F Tagbanwa
    85 10300 - 1032F Old Italic
    86 10330 - 1034F Gothic
    87 10400 - 1044F Deseret
    88 1D000 - 1D0FF Byzantine Musical Symbols
    1D100 - 1D1FF Musical Symbols
    1D200 - 1D24F Ancient Greek Musical Notation
    89 1D400 - 1D7FF Mathematical Alphanumeric Symbols
    90 FF000 - FFFFD Private Use (plane 15)
    100000 - 10FFFD Private Use (plane 16)
    91 FE00 - FE0F Variation Selectors
    E0100 - E01EF Variation Selectors Supplement
    92 E0000 - E007F Tags
    93 1900 - 194F Limbu
    94 1950 - 197F Tai Le
    95 1980 - 19DF New Tai Lue
    96 1A00 - 1A1F Buginese
    97 2C00 - 2C5F Glagolitic
    98 2D30 - 2D7F Tifinagh
    99 4DC0 - 4DFF Yijing Hexagram Symbols
    100 A800 - A82F Syloti Nagri
    101 10000 - 1007F Linear B Syllabary
    10080 - 100FF Linear B Ideograms
    10100 - 1013F Aegean Numbers
    102 10140 - 1018F Ancient Greek Numbers
    103 10380 - 1039F Ugaritic
    104 103A0 - 103DF Old Persian
    105 10450 - 1047F Shavian
    106 10480 - 104AF Osmanya
    107 10800 - 1083F Cypriot Syllabary
    108 10A00 - 10A5F Kharoshthi
    109 1D300 - 1D35F Tai Xuan Jing Symbols
    110 12000 - 123FF Cuneiform
    12400 - 1247F Cuneiform Numbers and Punctuation
    111 1D360 - 1D37F Counting Rod Numerals
    112 1B80 - 1BBF Sundanese
    113 1C00 - 1C4F Lepcha
    114 1C50 - 1C7F Ol Chiki
    115 A880 - A8DF Saurashtra
    116 A900 - A92F Kayah Li
    117 A930 - A95F Rejang
    118 AA00 - AA5F Cham
    119 10190 - 101CF Ancient Symbols
    120 101D0 - 101FF Phaistos Disc
    121 10280 - 1029F Lycian
    102A0 - 102DF Carian
    10920 - 1093F Lydian
    122 1F000 - 1F02F Mahjong Tiles
    1F030 - 1F09F Domino Tiles
    123   Windows 2000 and later: Layout progress, horizontal from right to left
    124   Windows 2000 and later: Layout progress, vertical before horizontal
    125   Windows 2000 and later: Layout progress, vertical bottom to top
    126-127   Reserved for process-internal usage

    The NEWTEXTMETRIC structure contains data that describes a physical font.

    typedef struct tagNEWTEXTMETRIC {
      LONG  tmHeight;
      LONG  tmAscent;
      LONG  tmDescent;
      LONG  tmInternalLeading;
      LONG  tmExternalLeading;
      LONG  tmAveCharWidth;
      LONG  tmMaxCharWidth;
      LONG  tmWeight;
      LONG  tmOverhang;
      LONG  tmDigitizedAspectX;
      LONG  tmDigitizedAspectY;
      TCHAR tmFirstChar;
      TCHAR tmLastChar;
      TCHAR tmDefaultChar;
      TCHAR tmBreakChar;
      BYTE  tmItalic;
      BYTE  tmUnderlined;
      BYTE  tmStruckOut;
      BYTE  tmPitchAndFamily;
      BYTE  tmCharSet;
      DWORD ntmFlags;
      UINT  ntmSizeEM;
      UINT  ntmCellHeight;
      UINT  ntmAvgWidth;
    } NEWTEXTMETRIC, *PNEWTEXTMETRIC;

    Members

    tmHeight

    The height (ascent + descent) of characters.

    tmAscent

    The ascent (units above the base line) of characters.

    tmDescent

    The descent (units below the base line) of characters.

    tmInternalLeading

    The amount of leading (space) inside the bounds set by the tmHeight member.
    Accent marks and other diacritical characters may occur in this area.
    The designer may set this member to zero.

    tmExternalLeading

    The amount of extra leading (space) that the application adds between rows.
    Since this area is outside the font, it contains no marks and
    is not altered by text output calls in either OPAQUE or TRANSPARENT mode.
    The designer may set this member to zero.

    tmAveCharWidth

    The average width of characters in the font (generally defined as the width of the letter x).
    This value does not include overhang required for bold or italic characters.

    tmMaxCharWidth

    The width of the widest character in the font.

    tmWeight

    The weight of the font.

    tmOverhang

    The extra width per string that may be added to some synthesized fonts.
    When synthesizing some attributes, such as bold or italic, graphics device interface (GDI) or
    a device may have to add width to a string on both a per-character and per-string basis.
    For example, GDI makes a string bold by expanding the spacing of each character and overstriking by an offset value;
    it italicizes a font by shearing the string. In either case, there is an overhang past the basic string.
    For bold strings, the overhang is the distance by which the overstrike is offset.
    For italic strings, the overhang is the amount the top of the font is sheared past the bottom of the font.

    The tmOverhang member enables the application to determine how much of the character width
    returned by a GetTextExtentPoint32 function call on a single character is the actual character width
    and how much is the per-string extra width. The actual width is the extent minus the overhang.

    tmDigitizedAspectX

    The horizontal aspect of the device for which the font was designed.

    tmDigitizedAspectY

    The vertical aspect of the device for which the font was designed.
    The ratio of the tmDigitizedAspectX and tmDigitizedAspectY members
    is the aspect ratio of the device for which the font was designed.

    tmFirstChar

    The value of the first character defined in the font.

    tmLastChar

    The value of the last character defined in the font.

    tmDefaultChar

    The value of the character to be substituted for characters that are not in the font.

    tmBreakChar

    The value of the character to be used to define word breaks for text justification.

    tmItalic

    An italic font if it is nonzero.

    tmUnderlined

    An underlined font if it is nonzero.

    tmStruckOut

    A strikeout font if it is nonzero.

    tmPitchAndFamily

    The pitch and family of the selected font.

    The low-order bit (bit 0) specifies the pitch of the font.
    If it is 1, the font is variable pitch (or proportional).
    If it is 0, the font is fixed pitch (or monospace).

    Bits 1 and 2 specify the font type.
    If both bits are 0, the font is a raster font; ( 00 )
    if bit 1 is 1 and bit 2 is 0, the font is a vector font; ( 01 ) 
    if bit 1 is 0 and bit 2 is set, the font is some other type. ( 10 )
    if both bits are 1, the font is some other type. ( 11 )

    Bit 3 is 1 if the font is a device font; otherwise, it is 0.
    If it is 1, the font is a device font. 
    If it is 0, the font is not a device font. 

    The four high-order bits designate the font family.
    The tmPitchAndFamily member can be combined with the hexadecimal value 0xF0
    by using the bitwise AND operator and can then be compared with the font family names
    for an identical match. For more information about the font families, see LOGFONT.

      { tmPitchAndFamily flags }
      {$EXTERNALSYM TMPF_FIXED_PITCH}
      TMPF_FIXED_PITCH = 1;
      {$EXTERNALSYM TMPF_VECTOR}
      TMPF_VECTOR = 2;
      {$EXTERNALSYM TMPF_DEVICE}
      TMPF_DEVICE = 8;
      {$EXTERNALSYM TMPF_TRUETYPE}
      TMPF_TRUETYPE = 4;
    tmCharSet

    The character set of the font.

    ntmFlags

    Specifies whether the font is italic, underscored, outlined, bold, and so forth.
    May be any reasonable combination of the following values.

    BitNameMeaning
    0 NTM_ITALIC italic
    5 NTM_BOLD bold
    8 NTM_REGULAR regular
    16 NTM_NONNEGATIVE_AC no glyph in a font at any size has a negative A or C space.
    17 NTM_PS_OPENTYPE PostScript OpenType font
    18 NTM_TT_OPENTYPE TrueType OpenType font
    19 NTM_MULTIPLEMASTER multiple master font
    20 NTM_TYPE1 Type 1 font
    21 NTM_DSIG font with a digital signature.
    This allows traceability and ensures that the font has been tested and is not corrupted
    ntmSizeEM

    The size of the em square for the font.
    This value is in notional units (that is, the units for which the font was designed).

    ntmCellHeight

    The height, in notional units, of the font. This value should be compared with the value of the ntmSizeEM member.

    ntmAvgWidth

    The average width of characters in the font, in notional units.
    This value should be compared with the value of the ntmSizeEM member.

    Remarks

    The last four members of the NEWTEXTMETRIC structure are not included in the TEXTMETRIC structure;
    in all other respects, the structures are identical.

    The sizes in the NEWTEXTMETRIC structure are typically specified in logical units;
    that is, they depend on the current mapping mode of the display context.

    LOGFONT structure

    The LOGFONT structure defines the attributes of a font.

    typedef struct tagLOGFONT {
      LONG  lfHeight;
      LONG  lfWidth;
      LONG  lfEscapement;
      LONG  lfOrientation;
      LONG  lfWeight;
      BYTE  lfItalic;
      BYTE  lfUnderline;
      BYTE  lfStrikeOut;
      BYTE  lfCharSet;
      BYTE  lfOutPrecision;
      BYTE  lfClipPrecision;
      BYTE  lfQuality;
      BYTE  lfPitchAndFamily;
      TCHAR lfFaceName[LF_FACESIZE];
    } LOGFONT, *PLOGFONT;

    Members

    lfHeight

    The height, in logical units, of the font's character cell or character.
    The character height value (also known as the em height) is the character cell height value minus the internal-leading value.
    The font mapper interprets the value specified in lfHeight in the following manner.

    ValueMeaning
    > 0 The font mapper transforms this value into device units and matches it against the cell height of the available fonts.
    = 0 The font mapper uses a default height value when it searches for a match.
    < 0 The font mapper transforms this value into device units and matches its absolute value against the character height of the available fonts.

    For all height comparisons, the font mapper looks for the largest font that does not exceed the requested size.

    This mapping occurs when the font is used for the first time.

    For the MM_TEXT mapping mode, you can use the following formula to specify a height for a font with a specified point size:

    lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);

    lfWidth

    The average width, in logical units, of characters in the font.
    If lfWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts
    to find the closest match, determined by the absolute value of the difference.

    lfEscapement

    The angle, in tenths of degrees, between the escapement vector and the x-axis of the device.
    The escapement vector is parallel to the base line of a row of text.

    When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string
    independently of the orientation angle of the string's characters.

    When the graphics mode is set to GM_COMPATIBLE, lfEscapement specifies both the escapement and orientation.
    You should set lfEscapement and lfOrientation to the same value.

    lfOrientation

    The angle, in tenths of degrees, between each character's base line and the x-axis of the device.

    lfWeight

    The weight of the font in the range 0 through 1000.
    For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.

    The following values are defined for convenience.

    ValueWeight
    FW_DONTCARE 0
    FW_THIN 100
    FW_EXTRALIGHT 200
    FW_ULTRALIGHT 200
    FW_LIGHT 300
    FW_NORMAL 400
    FW_REGULAR 400
    FW_MEDIUM 500
    FW_SEMIBOLD 600
    FW_DEMIBOLD 600
    FW_BOLD 700
    FW_EXTRABOLD 800
    FW_ULTRABOLD 800
    FW_HEAVY 900
    FW_BLACK 900
    lfItalic

    An italic font if set to TRUE.

    lfUnderline

    An underlined font if set to TRUE.

    lfStrikeOut

    A strikeout font if set to TRUE.

    lfCharSet

    The character set. The following values are predefined. 

    ANSI_CHARSET
    BALTIC_CHARSET
    CHINESEBIG5_CHARSET
    DEFAULT_CHARSET
    EASTEUROPE_CHARSET
    GB2312_CHARSET
    GREEK_CHARSET
    HANGUL_CHARSET
    MAC_CHARSET
    OEM_CHARSET
    RUSSIAN_CHARSET
    SHIFTJIS_CHARSET
    SYMBOL_CHARSET
    TURKISH_CHARSET
    VIETNAMESE_CHARSET

    Korean language edition of Windows:

    JOHAB_CHARSET

    Middle East language edition of Windows:

    ARABIC_CHARSET
    HEBREW_CHARSET

    Thai language edition of Windows:

    THAI_CHARSET

    The OEM_CHARSET value specifies a character set that is operating-system dependent.

    DEFAULT_CHARSET is set to a value based on the current system locale.
    For example, when the system locale is English (United States), it is set as ANSI_CHARSET.

    Fonts with other character sets may exist in the operating system.
    If an application uses a font with an unknown character set,
    it should not attempt to translate or interpret strings that are rendered with that font.

    This parameter is important in the font mapping process.
    To ensure consistent results, specify a specific character set.
    If you specify a typeface name in the lfFaceName member,
    make sure that the lfCharSet value matches the character set of the typeface specified in lfFaceName.

    lfOutPrecision

    The output precision. The output precision defines how closely the output must match
    the requested font's height, width, character orientation, escapement, pitch, and font type.
    It can be one of the following values.

    ValueMeaning
    OUT_CHARACTER_PRECIS        Not used.
    OUT_DEFAULT_PRECIS Specifies the default font mapper behavior.
    OUT_DEVICE_PRECIS Instructs the font mapper to choose a Device font when the system
    contains multiple fonts with the same name.
    OUT_OUTLINE_PRECIS This value instructs the font mapper to choose from TrueType and other outline-based fonts.
    OUT_PS_ONLY_PRECIS Instructs the font mapper to choose from only PostScript fonts.
    If there are no PostScript fonts installed in the system, the font mapper returns to default behavior.
    OUT_RASTER_PRECIS Instructs the font mapper to choose a raster font when the system
    contains multiple fonts with the same name.
    OUT_STRING_PRECIS This value is not used by the font mapper, but it is returned when raster fonts are enumerated.
    OUT_STROKE_PRECIS This value is not used by the font mapper, but it is returned when TrueType,
    other outline-based fonts, and vector fonts are enumerated.
    OUT_TT_ONLY_PRECIS Instructs the font mapper to choose from only TrueType fonts.
    If there are no TrueType fonts installed in the system,
    the font mapper returns to default behavior.
    OUT_TT_PRECIS Instructs the font mapper to choose a TrueType font
    when the system contains multiple fonts with the same name.

    Applications can use the OUT_DEVICE_PRECIS, OUT_RASTER_PRECIS, OUT_TT_PRECIS, and OUT_PS_ONLY_PRECIS values
    to control how the font mapper chooses a font when the operating system contains more than one font with a specified name.
    For example, if an operating system contains a font named Symbol in raster and TrueType form,
    specifying OUT_TT_PRECIS forces the font mapper to choose the TrueType version.
    Specifying OUT_TT_ONLY_PRECIS forces the font mapper to choose a TrueType font,
    even if it must substitute a TrueType font of another name.

    lfClipPrecision

    The clipping precision.
    The clipping precision defines how to clip characters that are partially outside the clipping region.
    It can be one or more of the following values.

    For more information about the orientation of coordinate systems, see the description of the nOrientation parameter.

    ValueMeaning
    CLIP_CHARACTER_PRECIS      Not used.
    CLIP_DEFAULT_PRECIS Specifies default clipping behavior.
    CLIP_DFA_DISABLE Windows XP SP1: Turns off font association for the font. Note that this flag is not guaranteed to have any effect on any platform after Windows Server 2003.
    CLIP_EMBEDDED You must specify this flag to use an embedded read-only font.
    CLIP_LH_ANGLES When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed.

    If not used, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system.

    CLIP_MASK Not used.
    CLIP_DFA_OVERRIDE Turns off font association for the font. This is identical to CLIP_DFA_DISABLE, but it can have problems in some situations; the recommended flag to use is CLIP_DFA_DISABLE.
    CLIP_STROKE_PRECIS Not used by the font mapper, but is returned when raster, vector, or TrueType fonts are enumerated.

    For compatibility, this value is always returned when enumerating fonts.

    CLIP_TT_ALWAYS Not used.
    lfQuality

    The output quality.
    The output quality defines how carefully the graphics device interface (GDI) must attempt
    to match the logical-font attributes to those of an actual physical font.
    It can be one of the following values.

    ValueMeaning
    ANTIALIASED_QUALITY Font is always antialiased if the font supports it and the size of the font is not too small or too large.
    CLEARTYPE_QUALITY If set, text is rendered (when possible) using ClearType antialiasing method. See Remarks for more information.
    DEFAULT_QUALITY Appearance of the font does not matter.
    DRAFT_QUALITY Appearance of the font is less important than when PROOF_QUALITY is used. For GDI raster fonts,
    scaling is enabled, which means that more font sizes are available, but the quality may be lower.
    Bold, italic, underline, and strikeout fonts are synthesized if necessary.
    NONANTIALIASED_QUALITY Font is never antialiased.
    PROOF_QUALITY Character quality of the font is more important than exact matching of the logical-font attributes.
    For GDI raster fonts, scaling is disabled and the font closest in size is chosen.
    Although the chosen font size may not be mapped exactly when PROOF_QUALITY is used,
    the quality of the font is high and there is no distortion of appearance.
    Bold, italic, underline, and strikeout fonts are synthesized if necessary.

    If neither ANTIALIASED_QUALITY nor NONANTIALIASED_QUALITY is selected,
    the font is antialiased only if the user chooses smooth screen fonts in Control Panel.

    lfPitchAndFamily

    The pitch and family of the font.
    The two low-order bits specify the pitch of the font and can be one of the following values.

    • DEFAULT_PITCH
    • FIXED_PITCH
    • VARIABLE_PITCH
      {$EXTERNALSYM DEFAULT_PITCH}
      DEFAULT_PITCH = 0;
      {$EXTERNALSYM FIXED_PITCH}
      FIXED_PITCH = 1;
      {$EXTERNALSYM VARIABLE_PITCH}
      VARIABLE_PITCH = 2;
      {$EXTERNALSYM MONO_FONT}
      MONO_FONT = 8;

    Bits 4 through 7 of the member specify the font family and can be one of the following values.

    • FF_DECORATIVE
    • FF_DONTCARE
    • FF_MODERN
    • FF_ROMAN
    • FF_SCRIPT
    • FF_SWISS

    The proper value can be obtained by using the Boolean OR operator to join one pitch constant with one family constant.

    Font families describe the look of a font in a general way.
    They are intended for specifying fonts when the exact typeface desired is not available.
    The values for font families are as follows.

    ValueMeaning
    FF_DECORATIVE Novelty fonts. Old English is an example.
    FF_DONTCARE Use default font.
    FF_MODERN Fonts with constant stroke width (monospace), with or without serifs.
    Monospace fonts are usually modern. Pica, Elite, and CourierNew are examples.
    FF_ROMAN Fonts with variable stroke width (proportional) and with serifs. MS Serif is an example.
    FF_SCRIPT Fonts designed to look like handwriting. Script and Cursive are examples.
    FF_SWISS Fonts with variable stroke width (proportional) and without serifs. MS Sans Serif is an example.
    lfFaceName

    A null-terminated string that specifies the typeface name of the font.
    The length of this string must not exceed 32 TCHAR values, including the terminating NULL.
    The EnumFontFamiliesEx function can be used to enumerate the typeface names of all currently available fonts.
    If lfFaceName is an empty string, GDI uses the first font that matches the other specified attributes.

    Remarks

    The following situations do not support ClearType antialiasing:

    • Text is rendered on a printer.
    • Display set for 256 colors or less.
    • Text is rendered to a terminal server client.
    • The font is not a TrueType font or an OpenType font with TrueType outlines.
      For example, the following do not support ClearType antialiasing:

      Type 1 fonts,
      Postscript OpenType fonts without TrueType outlines,
      bitmap fonts,
      vector fonts, and
      device fonts.
    • The font has tuned embedded bitmaps, for any font sizes that contain the embedded bitmaps.
      For example, this occurs commonly in East Asian fonts.

    信息: 完成枚举系统字体

    http://support.microsoft.com/kb/99672/zh-cn

    完整枚举系统字体是一个两阶段的过程。作为家族名称以枚举系统中的所有字体的字体名称,应用程序应首先调用 EnumFontfamilies 用 NULL。
    然后,应用程序应采用每个字体名称,并调用 EnumFontFamilies 再次以获取样式名称 (对于 TrueType 字体) 或 (对于光栅字体) 的受支持的磅值。
    光栅和向量字体不支持样式的名称。由于 TrueType 和矢量字体是可连续缩放,不会枚举字体的磅值。

    下面的步骤详细说明了枚举:

      1. 若要列出每个可用的字体系列中的一种字体系列名称 (lpszFamily) 中调用 EnumFontFamilies 用 NULL。

      2. EnumFontFamProc 回调函数中,查看 nFontType 参数。

      3. 如果 nFontType 设置了 TRUETYPE_FONTTYPE 标志,然后调用 EnumFontFamilies 系列名称将设置为字体的类型名 ( ENUMLOGFONT结构的 lfFaceName)。
        对于每个样式名称调用一次回调函数。此枚举是所关注的应用程序中查找具有特定样式名称 (如"大纲") TrueType 字体的情况下非常有用。
        TrueType 字体可以不断扩展,因为它不需要枚举给定的字体的磅值。应用程序可以使用任何所需的点大小。
        如果应用程序列出枚举的 TrueType 字体,它可以只是在给定范围中选择一些具有代表性的磅值。
        所建议的"Windows 界面: 应用程序设计指南"(第 159,部分 8.4.1.4 页) 的点大小是
        8、 9、 10、 11、 12、 14、 16、 18、 20、 22、 24、 26、 28、 36、 48 和 72。
        使应用程序可确定该字体将出现相同的显示和打印机上显示和打印机),提供了所有 TrueType 字体。

      4. 如果 nFontType 设置了 RASTER_FONTTYPE 标志,然后调用 EnumFontFamilies 系列名称将设置为字体的类型名。为每个可用的字号大小调用一次回调函数。光栅字体的可用磅值的倍数仅在可调整。缩放的光栅字体通常是由于不吸引用户,应用程序可以选择将自己限制到可用的大小。因为 Microsoft Windows 版本 3.1 未定义为光栅字体的样式名,没有必要进行枚举的样式名称。

        如果 nFontType 也有设置了 DEVICE_FONTTYPE 标志,则当前的字体是光栅字体到打印机使用的打印机驱动程序可用。
        打印机可能这些字体,在硬件中也能够下载它们在必要的时候。使用这种字体的应用程序应该知道相似的光栅字体可能不可用,在显示设备上。
        反过来也是如此。

        如果未设置 DEVICE_FONTTYPE 标志,应用程序应注意一个相似的字体可能不是打印机上可用。
        为设备字体列出字体生成的字体软件包 (例如 Adobe 类型管理器 (ATM)。

      5. 如果 nFontType TRUETYPE_FONTTYPE 和 RASTER_FONTTYPE 标志集都没有,然后枚举的字体为矢量字体。
        矢量字体也是可连续缩放,因此没有要枚举的点大小。因为 Windows 3.1 不支持矢量字体的样式名称,但它们之间没有必要来枚举它们的样式名称。
        矢量字体通常使用的设备,如打印机不支持光栅字体。这些字体通常有一个较差的外观光栅设备上时,很多应用程序避免它们。

    磅和字号的关系:  

    磅    字号

    5     八号

    5.5   七号

    6.5   小六号

    7.5   六号

    9     小五号

    10.5  五号

    12    小四号

    14    四号

    15    小三号

    16    三号

    18    小二号

    22    二号

    24    小一号

    26    一号

    36    小初号

    42    初号


  • 相关阅读:
    206.反转链表
    gprof
    Java【Stream流、方法引用】学习笔记
    Java【函数式接口(Supplier、Comsumer、Predicate、Function)】学习笔记
    Python exec 内置语句
    Python sorted() 函数
    Python oct() 函数
    Python id() 函数
    Python dir() 函数
    软件测试的方法
  • 原文地址:https://www.cnblogs.com/shangdawei/p/3073886.html
Copyright © 2011-2022 走看看