从C ++ / Windows中获取名称和样式的字体文件路径 [英] Get a font filepath from name and style in C++/Windows

查看:295
本文介绍了从C ++ / Windows中获取名称和样式的字体文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的一个项目中实现FreeType 2,因此在我的系统上需要用于字体的文件路径。我需要一个仅使用字体名称和所需字体样式(例如粗体斜体)的解决方案,然后返回字体的文件路径。 b
$ b

我已经尝试了这个答案堆栈溢出问题,但它不适用于Windows 7(也可能在Vista上),但显然我需要一个解决方案,在这些系统和未来的系统。

解决方案

请问为什么你需要一个物理文件的路径?


I'm currently implementing FreeType 2 in a project of mine and thus need the filepaths for Fonts on my system. I need a solution that only takes the fonts name and the desired font style (eg. bold or italic) and then returns the filepath for the font.

I already tried the answer from this Stack Overflow question, but it doesn't work on Windows 7 (and probably neither on Vista), but obviously I need a solution that works on these systems and future systems as well.

解决方案

May I ask why do you need the path to a physical file?

这篇关于从C ++ / Windows中获取名称和样式的字体文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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