所有系统字体和字体颜色的数组. [英] Array of all the systems fonts and font colors.

查看:72
本文介绍了所有系统字体和字体颜色的数组.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我只是想知道是否有人知道一种方便的方法来获取两个不同数组中的所有字体名称和字体颜色.

我正在尝试使用Win32 C/C ++创建文本编辑器,并且希望在组合框中显示所有字体和字体颜色.


感谢您的宝贵时间,
robNO.

Hi all,

I am just wondering if anybody knows of a convenient way to get all the names of fonts and font colors in two different arrays.

I am attempting to make a text editor using win32 C/C++ and I would like to display all the fonts and font colors in a combo boxes.


Thanks for your time,
robNO.

推荐答案



您可以使用 EnumFontFamilies函数 [ ^ ]并提供 EnumFontFamProc回调函数 [ IDWriteFontCollection [字体枚举示例 [ GetSystemPaletteEntries函数 [浏览器显示统计信息 [颜色:安全调色板 [ ^ ] (请注意1996年的日期)

最好的祝福,
-David Delaune
Hi,

You can enumerate fonts by using the EnumFontFamilies function[^] and supplying an EnumFontFamProc callback function[^].

or

On Windows Vista SP2 and above you could use the IDWriteFontCollection[^]. Font Enumeration Sample[^].

[Update 03, December, 2011]
Sorry, I forgot about the color part of the question. You could use the GetSystemPaletteEntries function[^] to retrieve the system palette associated with the device context... but realistically... this is a non-issue in the year 2011.

Browser Display Statistics[^] : 97% of the world is capable of displaying 24+ bits of color.

If you want to support the remaining 3% you should read some old articles such as: Colors: The Safety Palette[^] (Notice the date of 1996)

Best Wishes,
-David Delaune


字体没有颜色,它们只是形状.在设备上下文上显示字符时,可以使用从此信息中选择的RGB宏来设置颜色 [ ^ ].
Fonts don''t have colours they are merely shapes. When displaying characters on a device context you set the colours using the RGB macro selected from this information[^].


这篇关于所有系统字体和字体颜色的数组.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆