douqiang6448 2011-03-15 14:47
浏览 604

OTF,TTF字体cmap表

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?

  • 写回答

2条回答 默认 最新

  • dongyuan7110 2011-03-15 14:56
    关注

    The simplest way is just to draw the characters on to an image using the font definition.

    Have a look at the definition for imagettftext() - trying to perform the rendering yourself from glyph outlines is not advisable.

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100