3

I am writing a package in LaTeX, and would like to have basic macros (e.g. \vulture) for printing almost all the Egyptian hieroglyphs (e.g. U+13150 - Egyptian Hieroglyph G14 - Vulture).

As far as I checked, there is no font in CTAN that covers all the available hieroglyphs and also, I would like to be able to use Noto Sans Egyptian Hieroglyph font which is in .ttf format. After some research, I understand that in order to use TrueType fonts in LaTeX I need to convert them to formats that TeX can understand such as .tfm, .fd, .map  etc. but got lost. How do I make these non-latin characters and their fonts available for LaTeX?

I have checked the hieroglf package, some hieroglyphs are defined in this package but they are very limited, so this package has no use for me.

I have found similar questions:

but the answers suggest XeLaTeX and LuaTex, so they are not applicable in my case.

The package needs to be compatible with LaTeX, so I am not looking for solutions in XeLaTeX or LuaTeX.

Long story short, I want something like:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}    % I don't know if T1 supports Egyptian hieroglyphs.
\usepackage{mypackage}      % defines \vulture

\begin{document} \vulture % prints \end{document}

And be able to have the output:

in a pdf file.

Do you have any idea how to implement this?

aralto
  • 71
  • 1
    Can you maybe add why you need latex and not lua- or xelatex? – samcarter_is_at_topanswers.xyz Jan 05 '23 at 16:45
  • @samcarter_is_at_topanswers.xyz the package is intended for LaTeX, it has to work with LaTeX engine. Isn't it possible to work with non-latin characters in LaTeX? – aralto Jan 05 '23 at 16:53
  • 1
    well there are around 1000 character in this code block. So you would have to setup 4-5 fonts. Some info how to do it can be found in the fontinstallation guide, in https://tug.org/TUGboat/tb30-1/tb94thanh.pdf and in the pdftex manual. Easier would be to make lots of images and to include them with \includegraphics, see https://www.ctan.org/tex-archive/macros/latex/contrib/twemojis, where all symbols are in one large pdf. – Ulrike Fischer Jan 05 '23 at 17:13
  • When you say "LaTeX engine", do you mean the very old compiler that outputs DVI only? Honestly, trying to get this compiler to handle UTF8 properly is a losing battle, you'll hit many edge cases and font problems. LuaLaTeX and XeLaTeX use the same syntax, and handle UTF8 natively. – Miyase Jan 05 '23 at 17:16
  • 4
    it really makes no sense not to use a Unicode TeX such as lualatex for this, classic tex fonts can have at most characters 0-255 so arranging to use a Unicode font set such as Noto requires building dozens of custom fonts and arranging macros to map input to the right range. With lualatex, the Noto fonts "just work". lualatex is latex built from the same source but using luatex engine rather than etex or pdftex – David Carlisle Jan 05 '23 at 17:24
  • 1
    Follow up to my previous comment: … LuaLaTeX and XeLaTeX also handle TTF fonts natively (which David Carlisle also just said with much more precision). – Miyase Jan 05 '23 at 17:24
  • https://tex.stackexchange.com/questions/511121/hieroglyphs-in-unicode-in-a-reasonably-simple-way/511167#511167 – David Carlisle Jan 05 '23 at 19:30

1 Answers1

4

Using lualatex (or xelatex) you can directly use the truetype or opentype fonts with characters in Unicode order:

enter image description here

\documentclass{article}

\usepackage{fontspec} \setmainfont{Noto Sans} \newfontfamily\Hiero{NotoSansEgyptianHieroglyphs-Regular.ttf} \begin{document}

Some text.

{\Hiero

}

\end{document}

David Carlisle
  • 757,742
  • Thank you for your answer David, with Unicode TeX this problem can be handled easily. My concern is that the users of my package should be able to generate pdf files with (pdf)LaTeX if they do not have access to XeLaTeX or LuaLaTeX. Ulrike mentioned font installation, that is probably what I am looking for. But if I can't manage to find a solution then I think I will implement it with XeLaTeX. – aralto Jan 05 '23 at 19:57
  • 2
    @aralto asking users to install the multiple font, map and metric files needed for pdftex is much harder than asking them to use luatex (given the choice I would use luatex rather than xetex) – David Carlisle Jan 05 '23 at 20:03
  • 1
    @aralto it is rather hard to get access to pdflatex but not lualatex and xelatex. All three are part of texlive and miktex and very few people install a self-standing pdftex not part of a standard distributon – David Carlisle Jan 05 '23 at 20:21
  • Alright. I have one more question: How do I make sure that anyone who uses my package has the required font? Right now I am planning to use Noto Sans but I might change it to a custom font. Thanks for your replies. – aralto Jan 05 '23 at 20:25
  • @aralto simplest if it is not already in texlive is to document it I did not have this but I clicked the link in your question clicked download and then ran lualatex, it's hard to make it much simpler – David Carlisle Jan 05 '23 at 20:28