zoukankan      html  css  js  c++  java
  • font file CMAP

    fonttools

    pip install fonttools
    
    The character code points for a ttf/otf font are stored in the CMAP table.
    
    You can use ttx to generate a XML representation of the `CMAP` table. see here.
    
    You can run the command 
    ```bash
    ttx.exe -t cmap MyFont.ttf
    

    and it should output a file MyFont.ttx.
    Open it in a text editor and it should show you all the character code it found in the font.

    <?xml version="1.0" encoding="UTF-8"?>
    <ttFont sfntVersion="x00x01x00x00" ttLibVersion="4.21">
    
      <cmap>
        <tableVersion version="0"/>
        <cmap_format_4 platformID="0" platEncID="3" language="0">
          <map code="0xd" name="uni000D"/><!-- ???? -->
          <map code="0x20" name="space"/><!-- SPACE -->
          <map code="0x21" name="exclam"/><!-- EXCLAMATION MARK -->
          <map code="0x22" name="quotedbl"/><!-- QUOTATION MARK -->
          <map code="0x23" name="numbersign"/><!-- NUMBER SIGN -->
          <map code="0x24" name="dollar"/><!-- DOLLAR SIGN -->
          <map code="0x25" name="percent"/><!-- PERCENT SIGN -->
          <map code="0x26" name="ampersand"/><!-- AMPERSAND -->
          <map code="0x27" name="quotesingle"/><!-- APOSTROPHE -->
          <map code="0x28" name="parenleft"/><!-- LEFT PARENTHESIS -->
          <map code="0x29" name="parenright"/><!-- RIGHT PARENTHESIS -->
          <map code="0x2a" name="asterisk"/><!-- ASTERISK -->
          <map code="0x2b" name="plus"/><!-- PLUS SIGN -->
          <map code="0x2c" name="comma"/><!-- COMMA -->
          <map code="0x2d" name="hyphen"/><!-- HYPHEN-MINUS -->
          <map code="0x2e" name="period"/><!-- FULL STOP -->
          <map code="0x2f" name="slash"/><!-- SOLIDUS -->
          <map code="0x30" name="zero"/><!-- DIGIT ZERO -->
          <map code="0x31" name="one"/><!-- DIGIT ONE -->
          <map code="0x32" name="two"/><!-- DIGIT TWO -->
          <map code="0x33" name="three"/><!-- DIGIT THREE -->
          <map code="0x34" name="four"/><!-- DIGIT FOUR -->
    
  • 相关阅读:
    浅析C++:private、protected和public
    数据结构关于简单顺序表的构建(C++)
    小小的项目——简单的注释转换
    宏定义实现两数交换
    简易小程序(将字符型数据转换为浮点型数据)
    小小比较格式运算符及截图显示
    python __call__() 方法
    python_selenium简单的滑动验证码
    scrapy 爬虫学习二[中间件的学习]
    scrapy 爬虫学习一
  • 原文地址:https://www.cnblogs.com/Searchor/p/14529465.html
Copyright © 2011-2022 走看看