Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created February 13, 2025 10:33
Show Gist options
  • Save zr-tex8r/4a59cfdfc681d2f332384c3087d9ca45 to your computer and use it in GitHub Desktop.
Save zr-tex8r/4a59cfdfc681d2f332384c3087d9ca45 to your computer and use it in GitHub Desktop.
LaTeX: To use color variable fonts with LuaLaTeX
%#!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}
@zr-tex8r
Copy link
Author

The font “SCVarSnowman” is available at GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment