Friday, January 24, 2014

Medieval Cyrillic fonts in LaTeX (or XeLaTeX)

Links: tfm font install :: ttf fonts available :: old bulgarian lcyw

NB: A short note about WYSIWYG processor LibreOffice is at bottom.

Although analysts of Medieval Russian want to author text in modern Russian typefaces, they want their software to convert selected passages into Old Slavonic typefaces, change formatting, scale the text, and so on. These tasks could theoretically be accomplished in any good word processor. LaTeX with its immense formatting flexibility, would presumably be near the top of such a list but, unfortunately, straightforward LaTeX configuration solutions appear difficult to locate for older Cyrillic typefaces. Here's an outline of some of the steps I took.

LaTeX - installed cyrillic fonts

LaTeX font files have an associated .tfm file. Find their directory by following the variable (TEXMFLOCAL) which points to it. The list of directories for various fonts is underneath it...
$ kpsewhich --var-value TEXMFLOCAL
$ ls ~/latex/2013/texmf-dist/fonts/tfm/
$ cd latex/2013/texmf-dist/doc/fonts/
Inside here, we can see most any of the codes we need for the \renewcommand{\sfdefault}{some code}\normalfont command. I don't know of any definitive listing of all of them, but some have Cyrillic characters and some don't, eg Cantarell has Cyrillics and its code is "fca". To switch to Cantarell
For proper line breaks, it's additionally good to point out "\textcyrillic{}", eg.
And of course code is needed at the top of the TEX document:

pdflatex - packages

In a TexLive installation, Old Slavonic text pasted from this posting compiled in pdflatex with the following headers...

Russian text block
...however T2A coding is not a solution because it produced mostly Ukrainian versions instead of OCS. Close, but no cigar. Substituting T2C did slightly better, for example with "theta", but otherwise mostly produced Serbian versions. X2 coding provided only one dot over the "I", and so on. So we were left with pieces of success, but mostly failure (with respect to OCS), in each option. Unless I've overlooking something, it's possible one would have to build their own glyphs to properly code the OCS using pdflatex. Further, we'd still have run T1 coding if we have English (latin alphabet) portions in the document.

pdflatex - take two

I decided to seek from an Old Bulgarian angle. A Macro was located here, which included an INS with the DTX.
$ kpsewhich --var-value TEXMFHOME
$ unzip -d ~/texmf
$ texhash

xelatex - packages

Using xelatex, the following compiled...



\setmainfont{DejaVu Sans}

Russian text block
... but produces a severe, sans-serif Ukrainian.


LibreOffice - ttf

For WYSIWYG, a partial solution is true-type fonts. We can obtain fonts here for some medieval slavic fonts. One researcher particularly liked "dilyan.ttf", and "BukyVede-Regular.ttf"; he said they were accurate except for lacking diacritics. I explained he could place TTF's into LibreOffice /usr/share/fonts or ~/.fonts, directory (I prefer ~./fonts); they were immediately available on his font list the next time he opened LibreOffice.

No comments: