提取字形紧缩信息C ++ [英] Extracting Glyph Kerning Information C++

查看:142
本文介绍了提取字形紧缩信息C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在问完关于Uniscribe字形字距紧缩的问题 之后,我还没有收到答案,还需要进一步阅读google等,看来Uniscribe可能不支持从字体中提取字形字距调整信息.

After asking my previous question about Uniscribe glyph kerning, and not yet receiving an answer, plus further reading on google etc, it seems Uniscribe may not support extracting glyph kerning information from a font.

因此,我有一个简单的后续问题-是否有很好的示例(最好是使用某些C ++代码)从字体中提取指定字符串的字形紧缩信息?

I therefore have a simple followup question - are there any good examples (preferably with some C++ code) of extracting glyph kerning information for a specified string from a font?

在很多地方都提到Pango,QT或ICU都可以做到这一点,但是实际的文档太薄了,我正努力知道从哪里开始.

It's mentioned in various places that either Pango, QT or ICU are capable of doing this, but documentation is a bit thin on the ground and I'm struggling to know where to get started.

任何向我指出正确方向的帮助都将受到感激.我已经有适当的代码以所需的方式呈现字形,我只是在扩展字距调整信息之后,所以我可以将字形定位得更好.

Any help pointing me in the right direction gratefully received. I already have code in place to render the glyphs in the desired way, I am simply after the extended kerning information, so I can position the glyphs a little nicer.

谢谢

推荐答案

OpenType字体有两种不同的方式来指定字距调整信息,这两种方式都是可选的:

OpenType fonts have two different ways to specify kerning information, both of which are optional:

  1. 紧缩表,继承自TrueType.该表提供字距调整对信息(即,您应水平偏移特定字符对多少). Microsoft为此表提供了规范,并且还提供了一些Windows API函数,例如 GetKerningPair()

  1. The kern table, inherited from TrueType. This table supplies kerning pair information (i.e. how much you should horizontally offset a particular pair of characters). Microsoft provides specs for this table and also supplies some Windows API functions such as GetKerningPair() and GetFontData() that could help you extract values.

GPOS表是一个OpenType表,显然可以处理所有可能的字形定位形式.微软也为此表提供了一些规范,但老实说,我什至没有知道要从哪里开始...您可能想看看ICU如何处理这类事情.

The GPOS table, an OpenType table which apparently handles every conceivable form of glyph positioning. Microsoft also has some specs for this table, but honestly I don't even know where you'd begin... You'd probably want to look at how ICU handles this sort of stuff.

尽管我想从kern表中获取字距调整值远比GPOS表简单得多,但我在这方面的代码示例方面并没有发现太多.

I haven't found much in the way of code samples for any of this, though I'd imagine getting kerning values from the kern table is far simpler than the GPOS table.

这篇关于提取字形紧缩信息C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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