User Tools

Site Tools


fonts_characters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
fonts_characters [2022-09-21 12:27:25]
mi created
fonts_characters [2022-09-27 17:09:36] (current)
mi
Line 2: Line 2:
  
 == List all characters in font == List all characters in font
 +=== ttx
 +
 +  $ sudo apt install fonttools
 +
 +<​code>​$ ttx -t cmap -o - /​usr/​share/​fonts/​truetype/​Arial/​arial.ttf
 +Dumping "/​usr/​share/​fonts/​truetype/​Arial/​arial.ttf"​ to "​-"​...
 +Dumping '​cmap'​ table...
 +<?xml version="​1.0"​ encoding="​UTF-8"?>​
 +<ttFont sfntVersion="​\x00\x01\x00\x00"​ ttLibVersion="​4.5">​
 +
 +  <​cmap>​
 +    <​tableVersion version="​0"/>​
 +    <​cmap_format_4 platformID="​0"​ platEncID="​3"​ language="​0">​
 +      <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="​0xfef8"​ name="​afii62837"/><​!-- ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM -->
 +      <map code="​0xfef9"​ name="​afii62838"/><​!-- ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM -->
 +      <map code="​0xfefa"​ name="​afii62839"/><​!-- ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM -->
 +      <map code="​0xfefb"​ name="​afii62840"/><​!-- ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM -->
 +      <map code="​0xfefc"​ name="​afii62841"/><​!-- ARABIC LIGATURE LAM WITH ALEF FINAL FORM -->
 +      <map code="​0xfffc"​ name="​uniFFFC"/><​!-- OBJECT REPLACEMENT CHARACTER -->
 +    </​cmap_format_4>​
 +  </​cmap>​
 +</​ttFont>​
 +</​code>​
 +
 +<​code>​$ ttx -t cmap -o - /​usr/​share/​fonts/​truetype/​Arial/​arial.ttf \
 +  | perl -C -ne '/ code="​0x(.*?​)"/​ && printf "%04s %s\n", $1, chr(hex $1)'
 +Dumping "/​usr/​share/​fonts/​truetype/​Arial/​arial.ttf"​ to "​-"​...
 +Dumping '​cmap'​ table...
 +0020  ​
 +0021 !
 +0022 "
 +0023 #
 +0024 $
 +0025 %
 +0026 &
 +0027 '
 +0028 (
 +0029 )
 +...
 +fef4 ﻴ
 +fef5 ﻵ
 +fef6 ﻶ
 +fef7 ﻷ
 +fef8 ﻸ
 +fef9 ﻹ
 +fefa ﻺ
 +fefb ﻻ
 +fefc ﻼ
 +fffc 
 +</​code>​
 +
 +=== otfinfo
 +
 +* [[https://​unix.stackexchange.com/​a/​247114/​7286|How to find out which unicode codepoints are defined in a TTF file?]]
 +* [[https://​unix.stackexchange.com/​questions/​595756/​how-to-list-all-supported-glyphs-of-a-given-font|How to list all supported glyphs of a given font]]
 +
 +<​code>#​ sudo apt install lcdf-typetools
 +# or on Mac
 +# brew install lcdf-typetools</​code>​
 +
 +  $ otfinfo -u /​usr/​share/​fonts/​truetype/​Arial/​arial.ttf | head
 +  uni0020 3 space
 +  uni0021 4 exclam
 +  uni0022 5 quotedbl
 +  uni0023 6 numbersign
 +  uni0024 7 dollar
 +  ...
 +  uniFEF9 1017 afii62838
 +  uniFEFA 1018 afii62839
 +  uniFEFB 1019 afii62840
 +  uniFEFC 1020 afii62841
 +  uniFFFC 863 uniFFFC
 +  uniFFFF 0 .notdef
 +
 +=== Perl Font::​FreeType
 +
 +* https://​stackoverflow.com/​a/​15905540/​111036
 +
 +  $ sudo apt install libfont-freetype-perl
 +
 +<​code>​$ perl -C -MFont::​FreeType -e '​Font::​FreeType->​new->​face(shift)->​foreach_char( sub {
 +          $c=$_->​char_code(); ​ printf "%04X %s\n", $c, chr($c);
 +        } );' ​ /​usr/​share/​fonts/​truetype/​Arial/​arial.ttf
 +0020  ​
 +0021 !
 +0022 "
 +0023 #
 +0024 $
 +0025 %
 +0026 &
 +0027 '
 +...
 +FEFA ﻺ
 +FEFB ﻻ
 +FEFC ﻼ
 +FFFC 
 +</​code>​
 +
  
 == List characters in file == List characters in file
/docs/dokuwiki/data/attic/fonts_characters.1663756045.txt.gz · Last modified: 2022-09-21 12:27:25 by mi