如何使用 Uniscribe API 调整字体宽度
请耐心等待,我是 Uniscribe 的新手,所以我希望这不是一个愚蠢的问题,但我一直无法在其他地方找到解决方案。所以,这里...
我正在尝试使用 Uniscribe API 来减小字体的宽度;也就是说,给定特定高度的特定字体,我希望能够将每个字符的宽度(以及所有相关的间距)减少一些用户定义的百分比。
我通过获取当前字体的 LOGFONT 结构并将 lfWidth 字段调整为其原始值的百分比,成功地实现了这一目标,而无需调用任何 Uniscribe 函数。我意识到这只是一个平均字符宽度,但它似乎达到了预期的结果。
但是,当我尝试使用 Uniscribe 执行相同的操作时,我注意到在调用 ScriptShape()
后,lfWidth
字段会重置为 0。因此,所有渲染的文本都使用其原始宽度输出。我无法解释为什么会出现这种情况或如何解决它。
有人知道是否有可能做我想做的事情吗?
Please bear with me, I am new to Uniscribe so I hope this isn't a dumb question but I have been unable to find the solution anywhere else. So, here goes...
I am trying to use the Uniscribe API to reduce the width of a font; that is, given a specific font of a particular height, I would like to be able to reduce the width of each character (and all the relevant spacings) by some user-defined percentage.
I have successfully achieved this without calling any Uniscribe functions by obtaining a LOGFONT
structure for the current font and adjusting the lfWidth
field to be a percentage of its original value. I realise that this is just an average character width but it seemed to have the desired result.
However, when I try to do the same thing using Uniscribe I've noticed that the lfWidth
field gets reset to 0 following calls to ScriptShape()
. As a result, all rendered text is output using its original width. I'm at a loss to explain why this is or what to do to get around it.
Does anybody have any idea if it's even possible to do what I am trying to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要从此处开始(查看生成字形信息部分),然后引导至 这个。
希望有帮助!
You might want to start here (look at the Generate Glyph Information Section), then lead to this.
Hope it helps!