生成所有字形的表格 - 包括名称、Unicode 等元数据

生成所有字形的表格 - 包括名称、Unicode 等元数据

答案使用 XeTeX 生成字形表循环遍历字体中的字符位置,并输出一个字形(及其序数),如果该位置被分配了字形,该字形有时与 Unicode 位置相同。一些字形可能由多个 Unicode 代码点共享。一些 Unicode 代码点被分配了多个字形,可能是由智能字体功能选择的。此外,Unicode 的位置比 16 位所能容纳的要多(如 Open Type)。

我可以使用字体编辑器查找分配给字形的名称,这些名称可能符合 Adob​​e 的字形命名标准,但经常会偏离该标准,尤其是对于替代字形(点后缀)和非罗马字符。尽管如此,我还是想使用 XeLaTeX 打印出包含该信息的可自定义字形列表。

我怎样才能调整@LeoLiu 的代码(下面重复)来显示除序数之外的字形名称?

\documentclass[landscape]{article}
\usepackage{geometry}
\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage{multicol}
\setlength{\columnseprule}{0.4pt}
\setlength{\parindent}{0pt}
\usepackage{multido}
\begin{document}

\begin{multicols}{10}
\multido{\i=0+1}{"10000}{% from 0x0000 to 0xFFFF
  \iffontchar\font\i
    \makebox[3em][l]{\i}%
    \symbol{\i}\endgraf
  \fi
}
\end{multicols}

\end{document}

JFTR,碰巧的是libertine包装文档指导已经包含了字形列表,但它们可能已经过时了,我也想为其他字体做这件事。前者有一些可能相关的代码,因为它似乎可以生成字形列表,但我不明白(我猜是魔法cathode):

\renewcommand\DeclareTextGlyphY[3]{%
  \makebox[2.5cm]{\LARGE\strut\fbox{\biolinumKeyGlyph{#2}}} #2\\}%
\catcode`\_=12%
\begin{multicols}{2}
\par\noindent
\input{LinBiolinum_K}
\end{multicols}

更新:这是来自(针对 XeTeX 和 LuaTeX)的代码libertine.sty,它由上面的代码改编:

\providecommand*\DeclareTextGlyphY[3]{%
  % \DeclareTextGlyphY{fxl}{s_t}{64262}
  % #1=basefont #2=glyphname, #3=position
  \def\lib@temp{#1}%
  \ifx\lib@temp\lib@fxl \@namedef{#1@#2}{{\libertine\char#3\relax}}\else%
    \ifx\lib@temp\lib@fxb \@namedef{#1@#2}{{\biolinum\char#3\relax}}\else%
      \ifx\lib@temp\lib@fxk \@namedef{#1@#2}{{\biolinumkey\char#3\relax}}\else%
        \ifx\lib@temp\lib@fxi \@namedef{#1@#2}{{\libertineInitial\char#3\relax}}\else%
  \fi\fi\fi\fi}
%
\input{LinLibertine_R}
\input{LinBiolinum_R}
\input{LinBiolinum_K}
\input{LinLibertine_I}
%
\DeclareRobustCommand*\libertineGlyph[1]{\@nameuse{LinLibertine_R@#1}}
\DeclareRobustCommand*\biolinumGlyph[1]{\@nameuse{LinBiolinum_R@#1}}
\DeclareRobustCommand*\biolinumKeyGlyph[1]{\@nameuse{LinBiolinum_K@#1}}
\DeclareRobustCommand*\libertineInitialGlyph[1]{\@nameuse{LinLibertine_I@#1}}

文件LinLibertine_R.texLinBiolinum_R.texLinBiolinum_K.texLinLibertine_I.tex包含大量\DeclareTextGlyphY调用,没有其他内容。

答案1

使用 XeTeX 您可以通过名称获取字形,但我认为不可能将名称映射到 Unicode 点,这无论如何都没有意义,因为一个代码点可以对应多个字形。

方法如下:如果你知道名称,比如说zero.slash,你可以用以下方式打印字形

\XeTeXglyph\XeTeXglyphindex"zero.slash"<space>

我得到了 Linux Libertine O 的字形名称列表

otfinfo -g `kpsewhich LinLibertine_R.otf` > libert.list

生成文本文件

.notdef
space
exclam
quotedbl
numbersign
dollar
percent
ampersand
quotesingle
parenleft
parenright
asterisk
...
longs_t
s_t
uniFFFD
u1D538
u1D539
u1D53B
u1D53C
u1D53D
u1D53E
u1D540
u1D541
u1D542
u1D543
u1D544
u1D546
u1D547
u1D54A
u1D54B
u1D54C
u1D54D
u1D54E
u1D54F
u1D550

然后使用 XeLaTeX 运行以下 LaTeX 文档:它只是循环遍历文件并将行提供给映射函数。

\documentclass{article}
\usepackage{xparse,fontspec,multicol}
\usepackage[a4paper,margin=2cm]{geometry}
\ExplSyntaxOn
\NewDocumentCommand{\printlist}{m}
 {
  \crissov_print_list:n { #1 }
 }

\ior_new:N \g_crissov_input_stream
\cs_new_protected:Npn \crissov_print_list:n #1
 {
  \ior_open:Nn \g_crissov_input_stream { #1 }
  \ior_str_map_inline:Nn \g_crissov_input_stream
   {
    \makebox[2.5em][l]{\XeTeXglyph\XeTeXglyphindex"##1"~}
    {\footnotesize(##1)}\par
   }
 }
\ExplSyntaxOff

\setlength{\parindent}{0pt}

\begin{document}
\fontspec{Linux Libertine O}
\begin{multicols}{3}
\printlist{libert.list}
\end{multicols}
\end{document}

这是最后一页的图片:

在此处输入图片描述

请注意,最后一个字形从未出现,我认为这是由于 XeTeX 中的一个错误。

答案2

修正答案

此版本具有 Unicode 块和字形列表:

Unicode 块

字形列表

平均能量损失

\documentclass{article}
\usepackage[table]{xcolor}
\pagecolor{brown!3}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{pgffor}
\usepackage{luacode}
\usepackage{etoolbox}
\usepackage{multicol}
\newtoggle{printastring}
\setlength{\columnsep}{0.3cm} \setlength{\columnseprule}{1pt}

\newfontfamily\flab{Noto Serif}% for labels

\let\nc\newcommand

\nc\mypathname{C:/Windows/Fonts/}
\nc\myext{.ttf}
\nc\myfilename{xxx}
\nc\myfont{\mypathname\myfilename\myext}


\nc\fstartrange{97}
\nc\fendrange{122}

\begin{luacode}
    function printmysample(mystart, myfinish)
--  tex.sprint(myfont)
--local f = fontloader.open(myfont)
local glyphs = {}
for i = 0, f.glyphmax - 1 do
   local g = f.glyphs[i]
   if g then
       table.insert(glyphs, {name = g.name, unicode = g.unicode})
   end
end
table.sort(glyphs, function (a,b) return (a.unicode < b.unicode) end)
--   tex.sprint('Sample\\\\')
--tex.sprint(f.glyphmax .. ' glyphs\\\\')
for i = 1, #glyphs do
   if (glyphs[i].unicode > 0) then
      if (glyphs[i].unicode >= mystart ) then
      if (glyphs[i].unicode <= myfinish ) then
                tex.sprint("\\Uchar" .. glyphs[i].unicode .. "\\ ")
           end
           end
   end
end
--fontloader.close(f)

    end
\end{luacode}

\nc\doprintmysample[2]{%
\begin{quotation}
\noindent\directlua{printmysample(#1 ,#2)}
\end{quotation}
\par\bigskip
}






\begin{luacode}
    function openmyfont(xxx)
      f = fontloader.open(xxx)
      tex.sprint("{\\flab\\section{" .. f.fullname .. "}}")
      tex.sprint("{\\flab " .. f.fullname .. ", " .. f.glyphcnt .. " chars}\\par\\bigskip")
 end
\end{luacode}


\begin{luacode}
    function closemyfont(xxx)
        fontloader.close(f)
  end
\end{luacode}

%=================

%=================
\begin{luacode}
    function printglyphliste()
    tex.sprint("\\subsection{Glyph List}")
    tex.sprint("\\begin{multicols}{6}")
local glyphs = {}
local ck = 0
local pc = 0
for i = 0, f.glyphmax - 1 do
   local g = f.glyphs[i]
   if g then
       table.insert(glyphs, {name = g.name, unicode = g.unicode})
   end
end
table.sort(glyphs, function (a,b) return (a.unicode < b.unicode) end)

for i = 1, #glyphs do
   if (glyphs[i].unicode > 0) then
--              tex.sprint("\\Uchar" .. glyphs[i].unicode .. "\\ ")
                    tex.sprint("{\\centering\\noindent\\begin{tabular}{c}\\huge{\\color{blue}\\Uchar" .. glyphs[i].unicode .. "}\\\\ { \\usefont{T1}{lmr}{m}{n}\\tiny\\detokenize{" .. glyphs[i].name .. "}}\\\\ { \\usefont{T1}{lmr}{m}{n}\\tiny\\colorbox{blue!8}{" .. glyphs[i].unicode .. "}}\\\\\\hline\\end{tabular} \\par}")
   end
end
    tex.sprint("{\\usefont{T1}{lmr}{m}{n}\\tiny [End of List]}\\par")
    tex.sprint("\\end{multicols}")
end
\end{luacode}

%=================
\begin{luacode}
    function printmyblocke(blockstart,blockfinish,blockname)
local glyphs = {}
local ck = 0
local pc = 0
for i = 0, f.glyphmax - 1 do
   local g = f.glyphs[i]
   if g then
       table.insert(glyphs, {name = g.name, unicode = g.unicode})
   end
end
table.sort(glyphs, function (a,b) return (a.unicode < b.unicode) end)
for i = 1, #glyphs do
   if (glyphs[i].unicode > 0) then
      if (glyphs[i].unicode >= blockstart ) then
      if (glyphs[i].unicode <= blockfinish ) then
      if (blockname == 'Combining Diacritical Marks') 
          or (blockname == 'Combining Diacritical Marks Supplement') 
            then -- a holder for the mark
                tex.sprint("o\\Uchar" .. glyphs[i].unicode .. "\\ ")
                else
                tex.sprint("\\Uchar" .. glyphs[i].unicode .. "\\ ")
                end
          ck = ck + 1
           end
           end
   end
end
--  pc = ck / (blockfinish-blockstart+1) * 100
--  tex.sprint(f.fullname .. "\\par")
    if ck > 0 then
        tex.sprint("\\par {\\flab - " .. blockname .. "}\\par\\par  \\bigskip")
--      tex.sprint(ck .. " out of [" .. blockfinish-blockstart+1 .. "] chars:  " .. pc .. "\\par")
        end
--  fontloader.close(f)
    end
\end{luacode}



\nc\doprmb[3]{%
{\directlua{printmyblocke(#1,#2,#3)}}
}



\nc\wiafprintchars[1]{%
\doopenmyfont{#1}
\doprintmysample{\fstartrange}{\fendrange}
\subsection{Unicode Blocks}
\doprmb{125184}{125279}{'Adlam'}
\doprmb{65792}{65855}{'Aegean Numbers'}
\doprmb{71424}{71487}{'Ahom'}
\doprmb{128768}{128895}{'Alchemical Symbols'}
\doprmb{64256}{64335}{'Alphabetic Presentation Forms'}
\doprmb{82944}{83583}{'Anatolian Hieroglyphs'}
\doprmb{119296}{119375}{'Ancient Greek Musical Notation'}
\doprmb{65856}{65935}{'Ancient Greek Numbers'}
\doprmb{65936}{65999}{'Ancient Symbols'}
\doprmb{1536}{1791}{'Arabic'}
\doprmb{2208}{2303}{'Arabic Extended-A'}
\doprmb{126464}{126719}{'Arabic Mathematical Alphabetic Symbols'}
\doprmb{64336}{65023}{'Arabic Presentation Forms-A'}
\doprmb{65136}{65279}{'Arabic Presentation Forms-B'}
\doprmb{1872}{1919}{'Arabic Supplement'}
\doprmb{1328}{1423}{'Armenian'}
\doprmb{8592}{8703}{'Arrows'}
\doprmb{68352}{68415}{'Avestan'}
\doprmb{6912}{7039}{'Balinese'}
\doprmb{42656}{42751}{'Bamum'}
\doprmb{92160}{92735}{'Bamum Supplement'}
\doprmb{0}{127}{'Basic Latin'}
\doprmb{92880}{92927}{'Bassa Vah'}
\doprmb{7104}{7167}{'Batak'}
\doprmb{2432}{2559}{'Bengali'}
\doprmb{72704}{72815}{'Bhaiksuki'}
\doprmb{9600}{9631}{'Block Elements'}
\doprmb{12544}{12591}{'Bopomofo'}
\doprmb{12704}{12735}{'Bopomofo Extended'}
\doprmb{9472}{9599}{'Box Drawing'}
\doprmb{69632}{69759}{'Brahmi'}
\doprmb{10240}{10495}{'Braille Patterns'}
\doprmb{6656}{6687}{'Buginese'}
\doprmb{5952}{5983}{'Buhid'}
\doprmb{118784}{119039}{'Byzantine Musical Symbols'}
\doprmb{66208}{66271}{'Carian'}
\doprmb{66864}{66927}{'Caucasian Albanian'}
\doprmb{69888}{69967}{'Chakma'}
\doprmb{43520}{43615}{'Cham'}
\doprmb{5024}{5119}{'Cherokee'}
\doprmb{43888}{43967}{'Cherokee Supplement'}
\doprmb{129536}{129647}{'Chess Symbols'}
\doprmb{69552}{69599}{'Chorasmian'}
\doprmb{13056}{13311}{'CJK Compatibility'}
\doprmb{65072}{65103}{'CJK Compatibility Forms'}
\doprmb{63744}{64255}{'CJK Compatibility Ideographs'}
\doprmb{194560}{195103}{'CJK Compatibility Ideographs Supplement'}
\doprmb{11904}{12031}{'CJK Radicals Supplement'}
\doprmb{12736}{12783}{'CJK Strokes'}
\doprmb{12288}{12351}{'CJK Symbols and Punctuation'}
\doprmb{19968}{40959}{'CJK Unified Ideographs'}
\doprmb{13312}{19903}{'CJK Unified Ideographs Extension A'}
\doprmb{131072}{173791}{'CJK Unified Ideographs Extension B'}
\doprmb{173824}{177983}{'CJK Unified Ideographs Extension C'}
\doprmb{177984}{178207}{'CJK Unified Ideographs Extension D'}
\doprmb{178208}{183983}{'CJK Unified Ideographs Extension E'}
\doprmb{183984}{191471}{'CJK Unified Ideographs Extension F'}
\doprmb{196608}{201551}{'CJK Unified Ideographs Extension G'}
\doprmb{768}{879}{'Combining Diacritical Marks'}
\doprmb{6832}{6911}{'Combining Diacritical Marks Extended'}
\doprmb{8400}{8447}{'Combining Diacritical Marks for Symbols'}
\doprmb{7616}{7679}{'Combining Diacritical Marks Supplement'}
\doprmb{65056}{65071}{'Combining Half Marks'}
\doprmb{43056}{43071}{'Common Indic Number Forms'}
\doprmb{9216}{9279}{'Control Pictures'}
\doprmb{11392}{11519}{'Coptic'}
\doprmb{66272}{66303}{'Coptic Epact Numbers'}
\doprmb{119648}{119679}{'Counting Rod Numerals'}
\doprmb{73728}{74751}{'Cuneiform'}
\doprmb{74752}{74879}{'Cuneiform Numbers and Punctuation'}
\doprmb{8352}{8399}{'Currency Symbols'}
\doprmb{67584}{67647}{'Cypriot Syllabary'}
\doprmb{1024}{1279}{'Cyrillic'}
\doprmb{11744}{11775}{'Cyrillic Extended-A'}
\doprmb{42560}{42655}{'Cyrillic Extended-B'}
\doprmb{7296}{7311}{'Cyrillic Extended-C'}
\doprmb{1280}{1327}{'Cyrillic Supplement'}
\doprmb{66560}{66639}{'Deseret'}
\doprmb{2304}{2431}{'Devanagari'}
\doprmb{43232}{43263}{'Devanagari Extended'}
\doprmb{9984}{10175}{'Dingbats'}
\doprmb{71936}{72031}{'Dives Akuru'}
\doprmb{71680}{71759}{'Dogra'}
\doprmb{127024}{127135}{'Domino Tiles'}
\doprmb{113664}{113823}{'Duployan'}
\doprmb{74880}{75087}{'Early Dynastic Cuneiform'}
\doprmb{78896}{78911}{'Egyptian Hieroglyph Format Controls'}
\doprmb{77824}{78895}{'Egyptian Hieroglyphs'}
\doprmb{66816}{66863}{'Elbasan'}
\doprmb{69600}{69631}{'Elymaic'}
\doprmb{128512}{128591}{'Emoticons'}
\doprmb{127232}{127487}{'Enclosed Alphanumeric Supplement'}
\doprmb{9312}{9471}{'Enclosed Alphanumerics'}
\doprmb{12800}{13055}{'Enclosed CJK Letters and Months'}
\doprmb{127488}{127743}{'Enclosed Ideographic Supplement'}
\doprmb{4608}{4991}{'Ethiopic'}
\doprmb{11648}{11743}{'Ethiopic Extended'}
\doprmb{43776}{43823}{'Ethiopic Extended-A'}
\doprmb{4992}{5023}{'Ethiopic Supplement'}
\doprmb{8192}{8303}{'General Punctuation'}
\doprmb{9632}{9727}{'Geometric Shapes'}
\doprmb{128896}{129023}{'Geometric Shapes Extended'}
\doprmb{4256}{4351}{'Georgian'}
\doprmb{7312}{7359}{'Georgian Extended'}
\doprmb{11520}{11567}{'Georgian Supplement'}
\doprmb{11264}{11359}{'Glagolitic'}
\doprmb{122880}{122927}{'Glagolitic Supplement'}
\doprmb{66352}{66383}{'Gothic'}
\doprmb{70400}{70527}{'Grantha'}
\doprmb{880}{1023}{'Greek and Coptic'}
\doprmb{7936}{8191}{'Greek Extended'}
\doprmb{2688}{2815}{'Gujarati'}
\doprmb{73056}{73135}{'Gunjala Gondi'}
\doprmb{2560}{2687}{'Gurmukhi'}
\doprmb{65280}{65519}{'Halfwidth and Fullwidth Forms'}
\doprmb{12592}{12687}{'Hangul Compatibility Jamo'}
\doprmb{4352}{4607}{'Hangul Jamo'}
\doprmb{43360}{43391}{'Hangul Jamo Extended-A'}
\doprmb{55216}{55295}{'Hangul Jamo Extended-B'}
\doprmb{44032}{55215}{'Hangul Syllables'}
\doprmb{68864}{68927}{'Hanifi Rohingya'}
\doprmb{5920}{5951}{'Hanunoo'}
\doprmb{67808}{67839}{'Hatran'}
\doprmb{1424}{1535}{'Hebrew'}
\doprmb{56192}{56319}{'High Private Use Surrogates'}
\doprmb{55296}{56191}{'High Surrogates'}
\doprmb{12352}{12447}{'Hiragana'}
\doprmb{12272}{12287}{'Ideographic Description Characters'}
\doprmb{94176}{94207}{'Ideographic Symbols and Punctuation'}
\doprmb{67648}{67679}{'Imperial Aramaic'}
\doprmb{126064}{126143}{'Indic Siyaq Numbers'}
\doprmb{68448}{68479}{'Inscriptional Pahlavi'}
\doprmb{68416}{68447}{'Inscriptional Parthian'}
\doprmb{592}{687}{'IPA Extensions'}
\doprmb{43392}{43487}{'Javanese'}
\doprmb{69760}{69839}{'Kaithi'}
\doprmb{110848}{110895}{'Kana Extended-A'}
\doprmb{110592}{110847}{'Kana Supplement'}
\doprmb{12688}{12703}{'Kanbun'}
\doprmb{12032}{12255}{'Kangxi Radicals'}
\doprmb{3200}{3327}{'Kannada'}
\doprmb{12448}{12543}{'Katakana'}
\doprmb{12784}{12799}{'Katakana Phonetic Extensions'}
\doprmb{43264}{43311}{'Kayah Li'}
\doprmb{68096}{68191}{'Kharoshthi'}
\doprmb{101120}{101631}{'Khitan Small Script'}
\doprmb{6016}{6143}{'Khmer'}
\doprmb{6624}{6655}{'Khmer Symbols'}
\doprmb{70144}{70223}{'Khojki'}
\doprmb{70320}{70399}{'Khudawadi'}
\doprmb{3712}{3839}{'Lao'}
\doprmb{7680}{7935}{'Latin Extended Additional'}
\doprmb{256}{383}{'Latin Extended-A'}
\doprmb{384}{591}{'Latin Extended-B'}
\doprmb{11360}{11391}{'Latin Extended-C'}
\doprmb{42784}{43007}{'Latin Extended-D'}
\doprmb{43824}{43887}{'Latin Extended-E'}
\doprmb{128}{255}{'Latin-1 Supplement[h]'}
\doprmb{7168}{7247}{'Lepcha'}
\doprmb{8448}{8527}{'Letterlike Symbols'}
\doprmb{6400}{6479}{'Limbu'}
\doprmb{67072}{67455}{'Linear A'}
\doprmb{65664}{65791}{'Linear B Ideograms'}
\doprmb{65536}{65663}{'Linear B Syllabary'}
\doprmb{42192}{42239}{'Lisu'}
\doprmb{73648}{73663}{'Lisu Supplement'}
\doprmb{56320}{57343}{'Low Surrogates'}
\doprmb{66176}{66207}{'Lycian'}
\doprmb{67872}{67903}{'Lydian'}
\doprmb{69968}{70015}{'Mahajani'}
\doprmb{126976}{127023}{'Mahjong Tiles'}
\doprmb{73440}{73471}{'Makasar'}
\doprmb{3328}{3455}{'Malayalam'}
\doprmb{2112}{2143}{'Mandaic'}
\doprmb{68288}{68351}{'Manichaean'}
\doprmb{72816}{72895}{'Marchen'}
\doprmb{72960}{73055}{'Masaram Gondi'}
\doprmb{119808}{120831}{'Mathematical Alphanumeric Symbols'}
\doprmb{8704}{8959}{'Mathematical Operators'}
\doprmb{119520}{119551}{'Mayan Numerals'}
\doprmb{93760}{93855}{'Medefaidrin'}
\doprmb{43968}{44031}{'Meetei Mayek'}
\doprmb{43744}{43775}{'Meetei Mayek Extensions'}
\doprmb{124928}{125151}{'Mende Kikakui'}
\doprmb{68000}{68095}{'Meroitic Cursive'}
\doprmb{67968}{67999}{'Meroitic Hieroglyphs'}
\doprmb{93952}{94111}{'Miao'}
\doprmb{10176}{10223}{'Miscellaneous Mathematical Symbols-A'}
\doprmb{10624}{10751}{'Miscellaneous Mathematical Symbols-B'}
\doprmb{9728}{9983}{'Miscellaneous Symbols'}
\doprmb{11008}{11263}{'Miscellaneous Symbols and Arrows'}
\doprmb{127744}{128511}{'Miscellaneous Symbols and Pictographs'}
\doprmb{8960}{9215}{'Miscellaneous Technical'}
\doprmb{71168}{71263}{'Modi'}
\doprmb{42752}{42783}{'Modifier Tone Letters'}
\doprmb{6144}{6319}{'Mongolian'}
\doprmb{71264}{71295}{'Mongolian Supplement'}
\doprmb{92736}{92783}{'Mro'}
\doprmb{70272}{70319}{'Multani'}
\doprmb{119040}{119295}{'Musical Symbols'}
\doprmb{4096}{4255}{'Myanmar'}
\doprmb{43616}{43647}{'Myanmar Extended-A'}
\doprmb{43488}{43519}{'Myanmar Extended-B'}
\doprmb{67712}{67759}{'Nabataean'}
\doprmb{72096}{72191}{'Nandinagari'}
\doprmb{6528}{6623}{'New Tai Lue'}
\doprmb{70656}{70783}{'Newa'}
\doprmb{1984}{2047}{'NKo'}
\doprmb{8528}{8591}{'Number Forms'}
\doprmb{110960}{111359}{'Nushu'}
\doprmb{123136}{123215}{'Nyiakeng Puachue Hmong'}
\doprmb{5760}{5791}{'Ogham'}
\doprmb{7248}{7295}{'Ol Chiki'}
\doprmb{68736}{68863}{'Old Hungarian'}
\doprmb{66304}{66351}{'Old Italic'}
\doprmb{68224}{68255}{'Old North Arabian'}
\doprmb{66384}{66431}{'Old Permic'}
\doprmb{66464}{66527}{'Old Persian'}
\doprmb{69376}{69423}{'Old Sogdian'}
\doprmb{68192}{68223}{'Old South Arabian'}
\doprmb{68608}{68687}{'Old Turkic'}
\doprmb{9280}{9311}{'Optical Character Recognition'}
\doprmb{2816}{2943}{'Oriya'}
\doprmb{128592}{128639}{'Ornamental Dingbats'}
\doprmb{66736}{66815}{'Osage'}
\doprmb{66688}{66735}{'Osmanya'}
\doprmb{126208}{126287}{'Ottoman Siyaq Numbers'}
\doprmb{92928}{93071}{'Pahawh Hmong'}
\doprmb{67680}{67711}{'Palmyrene'}
\doprmb{72384}{72447}{'Pau Cin Hau'}
\doprmb{43072}{43135}{'Phags-pa'}
\doprmb{66000}{66047}{'Phaistos Disc'}
\doprmb{67840}{67871}{'Phoenician'}
\doprmb{7424}{7551}{'Phonetic Extensions'}
\doprmb{7552}{7615}{'Phonetic Extensions Supplement'}
\doprmb{127136}{127231}{'Playing Cards'}
\doprmb{57344}{63743}{'Private Use Area'}
\doprmb{68480}{68527}{'Psalter Pahlavi'}
\doprmb{43312}{43359}{'Rejang'}
\doprmb{69216}{69247}{'Rumi Numeral Symbols'}
\doprmb{5792}{5887}{'Runic'}
\doprmb{2048}{2111}{'Samaritan'}
\doprmb{43136}{43231}{'Saurashtra'}
\doprmb{70016}{70111}{'Sharada'}
\doprmb{66640}{66687}{'Shavian'}
\doprmb{113824}{113839}{'Shorthand Format Controls'}
\doprmb{71040}{71167}{'Siddham'}
\doprmb{3456}{3583}{'Sinhala'}
\doprmb{70112}{70143}{'Sinhala Archaic Numbers'}
\doprmb{65104}{65135}{'Small Form Variants'}
\doprmb{110896}{110959}{'Small Kana Extension'}
\doprmb{69424}{69487}{'Sogdian'}
\doprmb{69840}{69887}{'Sora Sompeng'}
\doprmb{72272}{72367}{'Soyombo'}
\doprmb{688}{767}{'Spacing Modifier Letters'}
\doprmb{65520}{65535}{'Specials'}
\doprmb{7040}{7103}{'Sundanese'}
\doprmb{7360}{7375}{'Sundanese Supplement'}
\doprmb{8304}{8351}{'Superscripts and Subscripts'}
\doprmb{10224}{10239}{'Supplemental Arrows-A'}
\doprmb{10496}{10623}{'Supplemental Arrows-B'}
\doprmb{129024}{129279}{'Supplemental Arrows-C'}
\doprmb{10752}{11007}{'Supplemental Mathematical Operators'}
\doprmb{11776}{11903}{'Supplemental Punctuation'}
\doprmb{129280}{129535}{'Supplemental Symbols and Pictographs'}
\doprmb{983040}{1048575}{'Supplementary Private Use Area-A'}
\doprmb{1048576}{1114111}{'Supplementary Private Use Area-B'}
\doprmb{120832}{121519}{'Sutton SignWriting'}
\doprmb{43008}{43055}{'Syloti Nagri'}
\doprmb{129648}{129791}{'Symbols and Pictographs Extended-A'}
\doprmb{129792}{130047}{'Symbols for Legacy Computing'}
\doprmb{1792}{1871}{'Syriac'}
\doprmb{2144}{2159}{'Syriac Supplement'}
\doprmb{5888}{5919}{'Tagalog'}
\doprmb{5984}{6015}{'Tagbanwa'}
\doprmb{917504}{917631}{'Tags'}
\doprmb{6480}{6527}{'Tai Le'}
\doprmb{6688}{6831}{'Tai Tham'}
\doprmb{43648}{43743}{'Tai Viet'}
\doprmb{119552}{119647}{'Tai Xuan Jing Symbols'}
\doprmb{71296}{71375}{'Takri'}
\doprmb{2944}{3071}{'Tamil'}
\doprmb{73664}{73727}{'Tamil Supplement'}
\doprmb{94208}{100351}{'Tangut'}
\doprmb{100352}{101119}{'Tangut Components'}
\doprmb{101632}{101775}{'Tangut Supplement'}
\doprmb{3072}{3199}{'Telugu'}
\doprmb{1920}{1983}{'Thaana'}
\doprmb{3584}{3711}{'Thai'}
\doprmb{3840}{4095}{'Tibetan'}
\doprmb{11568}{11647}{'Tifinagh'}
\doprmb{70784}{70879}{'Tirhuta'}
\doprmb{128640}{128767}{'Transport and Map Symbols'}
\doprmb{66432}{66463}{'Ugaritic'}
\doprmb{5120}{5759}{'Unified Canadian Aboriginal Syllabics'}
\doprmb{6320}{6399}{'Unified Canadian Aboriginal Syllabics Extended'}
\doprmb{42240}{42559}{'Vai'}
\doprmb{65024}{65039}{'Variation Selectors'}
\doprmb{917760}{917999}{'Variation Selectors Supplement'}
\doprmb{7376}{7423}{'Vedic Extensions'}
\doprmb{65040}{65055}{'Vertical Forms'}
\doprmb{123584}{123647}{'Wancho'}
\doprmb{71840}{71935}{'Warang Citi'}
\doprmb{69248}{69311}{'Yezidi'}
\doprmb{42128}{42191}{'Yi Radicals'}
\doprmb{40960}{42127}{'Yi Syllables'}
\doprmb{19904}{19967}{'Yijing Hexagram Symbols'}
\doprmb{72192}{72271}{'Zanabazar Square'}
\directlua{printglyphliste()}
\doclosemyfont
}





\nc\doopenmyfont[1]{%
\directlua{openmyfont('#1')}}


\nc\doclosemyfont{%
\directlua{closemyfont()}}







%===============================
\nc\tag[1]{{\color{blue}\usefont{T1}{lmtt}{m}{n}\small\fcolorbox{blue!80}{blue!5}{#1}}~~}

\newcounter{fontcounter}

%===============





\begin{document}


\nc\wiafshowblocks[4]{%1=path,2=ext,3=file,4=font
\expandafter\newfontface\csname f#4\endcsname{#3}[
  Path=#1,
  Extension=#2,
  UprightFont=*,
]
\csname f#4\endcsname
\togglefalse{printastring}
\wiafprintchars{#1#3#2}% unicode blocks, then glyph list
}



\wiafshowblocks{c:/windows/fonts/}{.ttf}{\detokenize{LinBiolinum_R_G}}{lbgr}

\end{document}

原始答案

作为参考,Lualatex 解决方案。

Lualatex 可以访问字形名称和编号(以及其他内容),因此,通过使用 lua 代码访问字体结构并循环遍历字形,我们可以通过字形列表视图查看字体中的内容:

列表

列表

平均能量损失

\documentclass{article}
\usepackage[table]{xcolor}
\pagecolor{brown!3}
\usepackage{graphicx}
\usepackage{fontspec}
\usepackage{pgffor}
\usepackage{luacode}
\usepackage{etoolbox}
\usepackage{multicol}
\newtoggle{printastring}
\setlength{\columnsep}{0.3cm} \setlength{\columnseprule}{1pt}

\newfontfamily\flab{Noto Serif}% for labels

\let\nc\newcommand

\nc\mypathname{C:/Windows/Fonts/}
\nc\myext{.ttf}
\nc\myfilename{xxx}
\nc\myfont{\mypathname\myfilename\myext}


\nc\fstartrange{97}
\nc\fendrange{122}

\begin{luacode}
    function printmysample(mystart, myfinish)
--  tex.sprint(myfont)
--local f = fontloader.open(myfont)
local glyphs = {}
for i = 0, f.glyphmax - 1 do
   local g = f.glyphs[i]
   if g then
       table.insert(glyphs, {name = g.name, unicode = g.unicode})
   end
end
table.sort(glyphs, function (a,b) return (a.unicode < b.unicode) end)
--   tex.sprint('Sample\\\\')
--tex.sprint(f.glyphmax .. ' glyphs\\\\')
for i = 1, #glyphs do
   if (glyphs[i].unicode > 0) then
      if (glyphs[i].unicode >= mystart ) then
      if (glyphs[i].unicode <= myfinish ) then
                tex.sprint("\\Uchar" .. glyphs[i].unicode .. "\\ ")
           end
           end
   end
end
--fontloader.close(f)

    end
\end{luacode}

\nc\doprintmysample[2]{%
\begin{quotation}
\noindent\directlua{printmysample(#1 ,#2)}
\end{quotation}
\par\bigskip
}






\begin{luacode}
    function openmyfont(xxx)
      f = fontloader.open(xxx)
      tex.sprint("{\\flab\\section{" .. f.fullname .. "}}")
      tex.sprint("{\\flab " .. f.fullname .. ", " .. f.glyphcnt .. " chars}\\par\\bigskip")
 end
\end{luacode}


\begin{luacode}
    function closemyfont(xxx)
        fontloader.close(f)
  end
\end{luacode}

%=================

%=================
\begin{luacode}
    function printglyphliste()
    tex.sprint("\\subsection{Glyph List}")
    tex.sprint("\\begin{multicols}{6}")
local glyphs = {}
local ck = 0
local pc = 0
for i = 0, f.glyphmax - 1 do
   local g = f.glyphs[i]
   if g then
       table.insert(glyphs, {name = g.name, unicode = g.unicode})
   end
end
table.sort(glyphs, function (a,b) return (a.unicode < b.unicode) end)

for i = 1, #glyphs do
   if (glyphs[i].unicode > 0) then
--              tex.sprint("\\Uchar" .. glyphs[i].unicode .. "\\ ")
                    tex.sprint("{\\centering\\noindent\\begin{tabular}{c}\\huge{\\color{blue}\\Uchar" .. glyphs[i].unicode .. "}\\\\ { \\usefont{T1}{lmr}{m}{n}\\tiny\\detokenize{" .. glyphs[i].name .. "}}\\\\ { \\usefont{T1}{lmr}{m}{n}\\tiny\\colorbox{blue!8}{" .. glyphs[i].unicode .. "}}\\\\\\hline\\end{tabular} \\par}")
   end
end
    tex.sprint("{\\usefont{T1}{lmr}{m}{n}\\tiny [End of List]}\\par")
    tex.sprint("\\end{multicols}")
end
\end{luacode}






\nc\wiafprintchars[1]{%
\doopenmyfont{#1}
\doprintmysample{\fstartrange}{\fendrange}
\directlua{printglyphliste()}
\doclosemyfont
}





\nc\doopenmyfont[1]{%
\directlua{openmyfont('#1')}}


\nc\doclosemyfont{%
\directlua{closemyfont()}}







%===============================
\nc\tag[1]{{\color{blue}\usefont{T1}{lmtt}{m}{n}\small\fcolorbox{blue!80}{blue!5}{#1}}~~}

\newcounter{fontcounter}

%===============





\begin{document}


\nc\wiafshowblocks[4]{%1=path,2=ext,3=file,4=font
\expandafter\newfontface\csname f#4\endcsname{#3}[
  Path=#1,
  Extension=#2,
  UprightFont=*,
]
\csname f#4\endcsname
\togglefalse{printastring}
\wiafprintchars{#1#3#2}% unicode blocks, then glyph list
}



\wiafshowblocks{c:/windows/fonts/}{.ttf}{\detokenize{LinBiolinum_R_G}}{lbgr}

\end{document}

代码在一定程度上改编自本网站上的其他各种答案。

删除了 Unicode 代码块打印的冗长代码,以使其不超过 30k 个字符的限制(直到我可以将其缩小)。

相关内容