# Fix line spacing with the hieroglf package

I'm using the hieroglf package to display hieroglyphic characters. I need to display some of these characters in the same lines as regular text. The problem is that the hieroglf fonts seem to need more space, so extra space gets inserted between the line with hieroglyphics and the one above it. Example:

This is a normal line \\
This is a normal line. \\
This is a normal line.\\
This line \pmglyph{\HAi} has extra space above it. \\
So does this one. \pmglyph{\HSxxxix}\\
This one is fine.


How can I:

1. Force the line spacing to be "normal", even if this causes the lines to overlap?

2. Resize the hieroglyphs to "minimally" fit within the normal line spacing instead?

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – cfr Aug 10 '14 at 19:37

I'd rescale the hieroglyphs:

\documentclass{article}
\usepackage{hieroglf}

\DeclareFontFamily{OT1}{pmhg}{}
\DeclareFontShape{OT1}{pmhg}{m}{n}{ <-> s*[.55] pmhg }{}
\DeclareFontShape{OT1}{pmhg}{bx}{n}{ <-> ssub pmhg/m/n }{}
\DeclareFontShape{OT1}{pmhg}{b}{n}{ <-> ssub pmhg/m/n }{}
\DeclareFontShape{OT1}{pmhg}{m}{sl}{ <-> ssub pmhg/m/n }{}
\DeclareFontShape{OT1}{pmhg}{m}{it}{ <-> ssub pmhg/m/n }{}

\begin{document}
\noindent
This is a normal line. \\
This is a normal line.\\
This line \pmglyph{\HAi} has extra space above it. \\
So does this one. \pmglyph{\HSxxxix}\\
This one is fine.

\end{document}


There are probably far more elegant solutions, but you could try something like the following using the scalerel package. I've scaled to match the next size of text up because the results looked too small otherwise, but you could obviously adjust this to suit.

I use a save box to avoid complaints about inappropriate boxing/unboxing which seem to occur if I try to use the hieroglf commands directly in the scaling command.

\documentclass{article}
\usepackage{hieroglf,scalerel}
\newsavebox{\myhier}
\newcommand*\myhieroglf[2][\large]{%
\sbox{\myhier}{%
\pmglyph{#2}}%
{#1\scalerel*{\usebox{\myhier}}{X}}}
\begin{document}
This is a normal line \\
This is a normal line. \\
This is a normal line.\\
This line \pmglyph{\HAi} has extra space above it. \\
So does this one. \pmglyph{\HSxxxix}\\
This one is fine.\\
This one may be \myhieroglf{\HAi} OK.\\
\Large For larger text, adjust \myhieroglf[\LARGE]{\HSxxxix} appropriately.
\end{document}