如何在 Xe|Lua|La|TeX 中使用 SBS 字体并指定要替换的单词?

如何在 Xe|Lua|La|TeX 中使用 SBS 字体并指定要替换的单词?

无废话 无(SBS)字体使用(当前仅有三种)连字来替换硬编码到字体内部字形替换表中的单词。

如何在 Xe|Lua|La|TeX 中使用 SBS 字体并指定要替换的单词?

答案1

这个 MWE 演示了一个简单的想法,你不需要成为一个“摇滚明星程序员“:只需使用 fontspec 和 luaLaTeX...

\documentclass[12pt]{article}

\usepackage{filecontents,fontspec}
\begin{filecontents*}{sbs100demo.fea}
    languagesystem DFLT dflt;
    languagesystem latn dflt;

    lookup demo_bs {
        sub N S A                                           by uniE602;
    } demo_bs;

    lookup demo_bulls {
        sub S i c h e r h e i t                             by  uniE601;
        sub g e h e i m                                     by  uniE601;
    } demo_bulls;

    lookup demo_bfs {
        sub V o r r a t s d a t e n s p e i c h e r u n g   by  uniE600;
    } demo_bfs;

    feature demo {
        lookup demo_bs;
        lookup demo_bulls;
        lookup demo_bfs;
    } demo;
\end{filecontents*}

\setmainfont[%
    Extension = .ttf ,
    Path = C:/SansBullshitSans/ ,
    FeatureFile=sbs100demo.fea,
    RawFeature={+demo},
    UprightFont = {*},
]{SansBullshitSans}

\begin{document}
    Der NSA-Ausschuss berät geheim.

    Sicherheit dank Vorratsdatenspeicherung!
\end{document}

有关字体特征文件语法的更多详细信息,请参阅 Adob​​e 的OpenType 字体功能规范

相关内容