在fontspec
宏包的文档中有:
使用otfinfo -h
可知:
'Otfinfo' reports information about an OpenType font to standard output.
Options specify what information to print.
Usage: C:\texlive\2024\bin\windows\otfinfo.exe [-sfzpg | OPTIONS] [OTFFILES...]
Query options:
-s, --scripts Report font's supported scripts.
-f, --features Report font's GSUB/GPOS features.
-z, --optical-size Report font's optical size information.
-p, --postscript-name Report font's PostScript name.
-a, --family Report font's family name.
-v, --font-version Report font's version information.
-i, --info Report font's names and designer/vendor info.
-g, --glyphs Report font's glyph names.
-t, --tables Report font's OpenType tables.
-u, --unicode Report font's supported Unicode code points.
--variable Report variable font information.
-T, --dump-table NAME Output font's 'NAME' table.
Other options:
--script=SCRIPT[.LANG] Set script used for --features [latn].
-V, --verbose Print progress information to standard error.
-h, --help Print this message and exit.
-q, --quiet Do not generate any error messages.
--version Print version number and exit.
Report bugs to <ekohler@gmail.com>.
我不太理解的是示例命令:
otfinfo -i `kpsewhich lmroman10-regular.otf`
我在终端的默认路径下使用提示:
otfinfo -i kpsewhich lmroman10-regular.otf
C:\texlive\2024\bin\windows\otfinfo.exe: kpsewhich: No such file or directory
C:\texlive\2024\bin\windows\otfinfo.exe: lmroman10-regular.otf: No such file or directory
然而如果我先运行kpsewhich lmroman10-regular.otf
,可以得到:
c:/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf
然后使用 otfinfo -i c:/texlive/2024/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf
则一切正常:
Family: LM Roman 10
Subfamily: Regular
Full name: LMRoman10-Regular
PostScript name: LMRoman10-Regular
Preferred family: Latin Modern Roman
Preferred subfamily: 10 Regular
Mac font menu name: LM Roman 10 Regular
Version: Version 2.004;PS 2.004;hotconv 1.0.49;makeotf.lib2.0.14853
Unique ID: 2.004;UKWN;LMRoman10-Regular
Trademark: Please refer to the Copyright section for the font trademark attribution notices.
Copyright: Copyright 2003, 2009 B. Jackowski and J. M. Nowacki (on behalf of TeX users groups). This work is released under the GUST Font License -- see http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt for details.
Vendor ID: UKWN
Permissions: Unknown (12)
我有两个问题:
otfinfo -i `kpsewhich lmroman10-regular.otf`
食用姿势哪里不对?otfinfo
理应只能用于.otf
(opentype)文件,那么对于.ttf
,.woff
和.ttc
字体文件是否有类似的命令获取这个Preferred family
?其中 `<command>`
的语法为命令替换,仅在macOS
以及*nix
系统下可用,windows
的Powershell
不支持该语法,但git bash
支持。
感谢Eureka老师的补充,powershell
下 $(<command>)
的syntax
有效:
otfinfo -i $(kpsewhich lmroman10-regular.otf)
Family: LM Roman 10
Subfamily: Regular
Full name: LMRoman10-Regular
PostScript name: LMRoman10-Regular
Preferred family: Latin Modern Roman
Preferred subfamily: 10 Regular
Mac font menu name: LM Roman 10 Regular
Version: Version 2.004;PS 2.004;hotconv 1.0.49;makeotf.lib2.0.14853
Unique ID: 2.004;UKWN;LMRoman10-Regular
Trademark: Please refer to the Copyright section for the font trademark attribution notices.
Copyright: Copyright 2003, 2009 B. Jackowski and J. M. Nowacki (on behalf of TeX users groups). This work is released under the GUST Font License -- see http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt for details.
Vendor ID: UKWN
Permissions: Unknown (12)