Created
February 13, 2025 10:33
-
-
Save zr-tex8r/4a59cfdfc681d2f332384c3087d9ca45 to your computer and use it in GitHub Desktop.
LaTeX: To use color variable fonts with LuaLaTeX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!lualatex | |
\documentclass{article} | |
\usepackage[a6paper, scale=0.88]{geometry} | |
\usepackage{fontspec} | |
% Font available at https://github.com/zr-tex8r/SCVarSnowman | |
\newfontface\fSCVS{SCVarSnowman.ttf}[Renderer=HarfBuzz] | |
\newcommand*{\cItem}[1]{% | |
\item \makebox[5em][l]{\ttfamily MOOD=#1}% | |
% 'MOOD' axis: +100=smiling .. 0=neutral .. -100=frowning | |
{\fSCVS\addfontfeatures{RawFeature={+axis={MOOD=#1}}}% | |
\LARGE ☃⛄% with a red muffler | |
{\addfontfeatures{StylisticSet=3}☃⛄}% ss03 green | |
{\addfontfeatures{StylisticSet=4}☃⛄}% ss04 blue | |
{\addfontfeatures{StylisticSet=5}☃⛄}% ss05 yellow | |
{\addfontfeatures{StylisticSet=6}☃⛄}}%ss06 purple | |
} | |
\begin{document} | |
\begin{itemize} | |
\cItem{-100} | |
\cItem{-50} | |
\cItem{0} | |
\cItem{50} | |
\cItem{100} | |
\end{itemize} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The font “SCVarSnowman” is available at GitHub.