Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am importing a custom font that I made into my document, and compiling it using XeLaTeX. Let's call the font "MyFont" for sake of argument.

\font\myfont="MyFont" at 12pt

{\myfont Hello, world!}


So the result is the character associated with "H" is displayed first, then the character associated with "e", etc. Since this specific font is actually an approximation of an ancient runic script, the displayed characters have some analogies to sounds in English, but not always of a single letter. For instance, one letter sounds something like the English amalgamation "ngh", and some just like "a".

As such, I would like to be able to type {\myfont a{ngh}} and have only two symbols appear. I'm using curly brackets around the "ngh" to show that that is one symbol in the imported font, but it could be any other delimiter.

The symbols are approximations of one, two, or three english letters. Any help in this direction is appreciated!

share|improve this question
Font mapping seems the way to go. Should all ngh groups point to the same character in the font? – egreg Jan 25 '13 at 23:40
@egreg Not sure what you mean by "groups". I have distinct characters "ngh", "nh", "nn", "n" and "h" that have similar English expressions. And there are no capital letters, just lowercase and punctuation. – jlv Jan 26 '13 at 4:07
For instance, can you have nn that represents the double character for n or does any nn combination represent a single character? – egreg Jan 26 '13 at 9:43
you can define ngh as a ligature if it is an OpenType fonts. – Herbert Jan 26 '13 at 10:52

1 Answer 1

up vote 4 down vote accepted

First of all you should never use \font directly in LaTeX (or XeLaTeX, which differs just by what engine is used). The fontspec interface is much better.




{\myfont abcnghd}

{\myfont abc/nn/d}


Here is the result (I used Junicode instead of your runic font).

enter image description here

You'll notice that abcnghd in the first line has become "abcZd" and abc/nn/d in the second "abcYd". How did I do it?

I prepared a file by copying the standard file that you can surely find in your TeX distribution and modifying it to read

; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"


; ligatures from Knuth's original CMR fonts
U+002D U+002D           <>  U+2013  ; -- -> en dash
U+002D U+002D U+002D    <>  U+2014  ; --- -> em dash

U+0027          <>  U+2019  ; ' -> right single quote
U+0027 U+0027   <>  U+201D  ; '' -> right double quote
U+0022           >  U+201D  ; " -> right double quote

U+0060          <>  U+2018  ; ` -> left single quote
U+0060 U+0060   <>  U+201C  ; `` -> left double quote

U+0021 U+0060   <>  U+00A1  ; !` -> inverted exclam
U+003F U+0060   <>  U+00BF  ; ?` -> inverted question

; additions supported in T1 encoding
U+002C U+002C   <>  U+201E  ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C   <>  U+00AB  ; << -> LEFT POINTING GUILLEMET
U+003E U+003E   <>  U+00BB  ; >> -> RIGHT POINTING GUILLEMET

; ADDITIONS FOR JimboBimbo start here    
; ligatures for the runic font

U+006E U+0067 U+0068        <> U+005A ; ngh -> Z
U+002F U+006E U+006E U+002F <> U+0059 ; /nn/ -> Y

It should be clear that this mapping transforms every ngh cluster into a Z and every /nn/ cluster into Y. The font is loaded with the Mapping=jimbo specification, so this will be done only for that font.

The mapping file should be compiled with the teckit_compile utility:


will produce a jimbo.tec file that you should keep in the working directory (or any other in the XeTeX search tree).

What input form should you prefer? It depends on you. If every ngh cluster should be transformed into Z, just use the first form, which is easier to input. Otherwise, choose a non used character (here I chose /) for grouping clusters.

share|improve this answer
Very nice, this worked perfectly for me. Instead of the Scale option of \newfontface, I used SizeFeatures={Size=10}, which makes it easier for me to integrate this font with English text, the size of which is specified in pt, which seems also to be what the 10 refers to in size. And I used / to group clusters as you suggested, because there are separate letters "n", "g" and "h" that might appear together. Thanks! – jlv Jan 26 '13 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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