Coptic dictionary offline
If you’re interested in the Coptic language, you’ve likely come across the Coptic Dictionary Online. It’s a collaborative project involving multiple universities, aiming to bring Coptic lexicography into the 21st century. The initiative enriches the work on Egyptian Coptic by Walter Crum, providing crucial information on Greek Coptic from the Database and Dictionary of Greek Loanwords in Coptic project.
While I appreciate the search interface and linked example sentences from the Coptic Scriptorium corpus project, I also value the security and speed of having an offline copy of the data. This guarantees the information’s permanence, unaffected by the ever-changing trends of web technology and design. Unlike online tools that might vanish or degrade over time due to shifting technologies, an offline copy provides a stable and reliable resource that won’t be subject to the whims of digital evolution or funding uncertainties.
Therefore, armed with the powers of XSLT and automatic typesetting, I made the decision to return the entries of the Coptic dictionary to their origins: black letters on white pages. My usual choice for automatic typesetting would of course be LaTeX. But looking at the amount of complex Unicode text contained in the data and the sheer amount of entries, I could already hear the whimper of the XeLaTeX compiler being forced to labour for several minutes just to generate a single PDF document. In light of this, and having heard that there’s a new sheriff in town—faster, more programmable, and exceptionally Unicode-friendly—I opted to give Typst a go.
Typst simplifies the creation of macros for rendering extensive text by eliminating the need for repetitive coding. In contrast to LaTeX or LuaLaTeX, Typst treats common programming concepts such as loops, conditionals, and variables as first-class citizens. Notably, Typst goes a step further by allowing the direct loading of XML or other structured data. To harness this capability, I authored a small XSLT script to extract pertinent information from the TEI XML document provided by the creators of the Coptic Dictionary Online, converting it into an intermediate representation in the Typst macro language. A Typst script then reads this data and efficiently renders it to a PDF. An example of this can be seen in the following screenshot:
You can find the source code for my scripts in my GitHub repository and the generated PDF documents—one upright, one landscape for full-screen reading—on its releases page.