I have managed to get the cmap
from the OTF file, which looks like this:
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"
}
Now, I need to generate character map using PHP GD or any other way. PHP GD preferred, though. How do convert letter in format 0x21 to something that would look like letter?