网站首页  词典首页

请输入您要查询的函数:

 

术语 enumfontfamiliesex
释义 EnumFontFamiliesEx
语法:
int EnumFontFamiliesEx(
__in HDC hdc,
__in LPLOGFONT lpLogfont,
__in FONTENUMPROC lpEnumFontFamExProc,
__in LPARAM lParam,
DWORD dwFlags
);
EnumFontFamiliesEx功能
该EnumFontFamiliesEx函数枚举所有独特的命名系统中匹配的LOGFONT结构中指定的字体特征的字体。 EnumFontFamiliesEx枚举的字体名称的字体,字符集,或两者兼而有之。
参数
hdc [in]
一个句柄,设备上下文。
lpLogfont [in]
一个 LOGFONT结构,其中包含有关信息的字体枚举指针。该函数检查以下成员。
MemberDescription
lfCharsetIf设置为DEFAULT_CHARSET,函数枚举所有唯一命名的所有字符集的字体。 (如果有两个具有相同名称的字体,只有一个枚举。)如果设置为一个有效的字符集值,函数枚举指定的字符集的字体。
lfFaceNameIf设置为空字符串,该函数列举了每个可用字体名称一种字体。如果设置为一个有效的字体名称,该函数枚举具有指定名称的所有字体。
lfPitchAndFamilyMust设置为零的操作系统的所有语言版本。
lpEnumFontFamExProc [in]
阿应用程序定义的回调函数指针。有关详细信息,请参阅EnumFontFamExProc功能。
lparam的 [in]
应用程序定义的值。通过这个函数值的回调函数以及字体信息。
dwFlags
这个参数是不使用,必须为零。
返回值
返回值是最后一个值的回调函数返回。此值取决于家庭的字体为指定的设备可用。
备注
该EnumFontFamiliesEx函数不使用标签的字体名称来识别字符集。相反,它总是通过正确的字体名称和一个单独的字符集值回调函数。枚举函数的lfCharset和LOGFONT结构lfFacename成员的价值观为基础的字体。
正如EnumFontFamilies,EnumFontFamiliesEx枚举所有字体样式。并非所有的字体样式覆盖相同的字符集。例如,Fontorama加粗可能包含的ANSI,希腊语和西里尔字母,但Fontorama倾斜可能只包含ANSI字符。由于这个原因,最好不要以为一指定的字体涵盖了特定的字符集,即使它是ANSI字符集。下表显示为lfCharset的价值观和lfFacename各种组合的结果。
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 fontEnumerates 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 fontEnumerates 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, 6, "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, 6, "Arial" );
if (FAILED(hr))
{
// TODO: write error handler
}
lf.lfCharSet = ANSI_CHARSET;

为EnumFontFamilies和EnumFontFamiliesEx的回调函数非常相似。主要的区别在于,ENUMLOGFONTEX结构包括一个脚本领域。
请注意,根据lfCharSet和lfFaceName的价值观,EnumFontFamiliesEx将相同的字体枚举多次因为有不同的字体的字符集。这可以创建字体可负担给用户广泛的名单。例如,世纪课本字体可以显示,波罗的海,西,希腊,土耳其,和西里尔字符集。为了避免这种情况,应用程序应过滤列表中的字体。
许多东亚语言的字体有两种字体名称:英文名称和本地化的名称。 EnumFonts,EnumFontFamilies和EnumFontFamiliesEx返回英文字体名称,如果系统区域设置不匹配字体的语言。
当设备上下文上的图形模式设置为GM_ADVANCED使用SetGraphicsMode功能和DEVICE_FONTTYPE标志传递给FontType参数,此函数返回一个类型为1和系统的OpenType字体的列表。图形模式时,未设置为GM_ADVANCED,此函数返回一个类型为1的OpenType名单,并在系统的TrueType字体。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode和ANSI namesEnumFontFamiliesExW(Unicode)和EnumFontFamiliesExA(ANSI)的
参见
字体和文字概述
字体和文本函数
EnumFontFamExProc
EnumFonts
EnumFontFamilies
逻辑字体
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==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.
Syntax
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.
lpLogfont [in]
A pointer to a LOGFONT structure that contains information about the fonts to enumerate. The function examines the following members.
MemberDescription
lfCharsetIf 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.
lfFaceNameIf 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.
lfPitchAndFamilyMust 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 EnumFontFamilies , EnumFontFamiliesEx 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 and lfFacename.
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 fontEnumerates 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 fontEnumerates 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, 6, "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, 6, "Arial" );
if (FAILED(hr))
{
// TODO: write error handler
}
lf.lfCharSet = ANSI_CHARSET;
The callback functions for EnumFontFamilies and EnumFontFamiliesEx are very similar. The main difference is that the ENUMLOGFONTEX structure includes a script field.
Note, based on the values of lfCharSet and lfFaceName, EnumFontFamiliesEx 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. EnumFonts , EnumFontFamilies, 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.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
Unicode and ANSI namesEnumFontFamiliesExW (Unicode) and EnumFontFamiliesExA (ANSI)
See Also
Fonts and Text Overview
Font and Text Functions
EnumFontFamExProc
EnumFonts
EnumFontFamilies
LOGFONT
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd162620(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:49