Skip to content

Instantly share code, notes, and snippets.

@wspr
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wspr/4e5957b72c306ab63816 to your computer and use it in GitHub Desktop.
Save wspr/4e5957b72c306ab63816 to your computer and use it in GitHub Desktop.
\documentclass[a4paper]{article}
\usepackage{fontspec,multicol}
\usepackage[margin=2cm]{geometry}
\begin{document}
\ExplSyntaxOn
\DeclareDocumentCommand \fontrange { m m m +m }
{
\group_begin:
\cs_set:Npn \__typeset:nnn ##1 ##2 ##3 {#4}
\fontspec{#1}
\int_step_inline:nnnn {#2} {1} {#3}
{
\iffontchar\font ##1\relax
\__typeset:nnn {##1} { \int_to_Hex:n {##1} } { \char ##1 \relax }
\fi
}
\group_end:
}
\ExplSyntaxOff
\begin{multicols}{5}
\fontrange{xits-math.otf}{1}{"FFFFF}
{ \texttt{\small U+#2}:\quad #3\par}
% #1 = glyph slot, decimal
% #2 = glyph slot, hex
% #3 = char
\end{multicols}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment