【发布时间】:2011-07-15 20:52:05
【问题描述】:
我已设法从 OTF 文件中获取 cmap,如下所示:
object(SimpleXMLElement)#4 (3) {
["tableVersion"]=>
object(SimpleXMLElement)#5 (1) {
["@attributes"]=>
array(1) {
["version"]=>
string(1) "0"
}
}
["cmap_format_4"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#6 (3) {
["@attributes"]=>
array(3) {
["platformID"]=>
string(1) "0"
["platEncID"]=>
string(1) "3"
["language"]=>
string(1) "0"
}
["map"]=>
array(222) {
[0]=>
object(SimpleXMLElement)#9 (1) {
["@attributes"]=>
array(2) {
["code"]=>
string(4) "0x20"
["name"]=>
string(5) "space"
}
}
[1]=>
object(SimpleXMLElement)#11 (1) {
["@attributes"]=>
array(2) {
["code"]=>
string(4) "0x21"
["name"]=>
string(6) "exclam"
}
现在,我需要使用 PHP GD 或任何其他方式生成字符映射。不过,首选 PHP GD。如何将 0x21 格式的字母转换成看起来像字母的东西?
【问题讨论】:
-
您可能需要检查字体的不同 Unicode CMAP 以查看它们是否不同。例如,如果您正在查看 Windows CMAP,但 FreeType 使用 Apple CMAP,而后者恰好被破坏,则某些字形将无法访问。