3

I'm using a special font family for penmanship called ZNuscript. Some of the versions of this font include ruled lines that help to guide children in forming their letters. It displays just fine for any character other than a space.

If I write a sentence in LibreOffice using the font, the spaces appear as normal: ZNuscript in LibreOffice

But when I use the same font in Overleaf using the XeLaTeX compiler, the spaces appear without guidelines: ZNuscript in Overleaf

I have tried using underscores, but in this font, they are almost double the width of a regular space.

Please have a look at this relevant Overleaf project to see the font files and code.

1
  • You'll need an active space character which will likely break your document. – Henri Menke Jan 16 '20 at 5:33
4

You can do it with an active space character, but this has some issues as you can see in the output.

\documentclass{article}
\usepackage{fontspec}

\newfontface\tracingfont[Path=fonts/]{ZNuscriptDottedGuidedNL}

\begingroup
\catcode`\ =13
\gdef\installactivespace{\catcode`\ =13\def {\char"20\hskip0pt\relax}}%
\endgroup
\newcommand\tracing{\begingroup\installactivespace\dotracing}
\newcommand\dotracing[1]{\tracingfont#1\endgroup}

\begin{document}
  \huge
  \tracing{Here    are some spaces and if the line is too long it breaks but leaves spaces behind.}
\end{document}

enter image description here

1
  • Thank you for this. For my purposes, sentences using these guidelines would never extend beyond one line as I'm using them for writing worksheets. Is that the only issue? Also, could you explain a bit more about the relevant pieces of your code? – cbunn Jan 16 '20 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.