# Getting ligatures of Qv with Linux Libertine

In old texts in Danish, the letter combination Qv was common and more or less worked like Qu in English. Now the code

\documentclass{memoir}

\usepackage{fontspec}

\setmainfont[Ligatures={Common}]{Linux Libertine O}

\begin{document}
Quarante.

Qvinde.
\end{document}


produces a ligature in the letter combination Qu, but not in Qv (see below). Is it possible to get the lower Q to look like the upper Q without having to modify Linux Libertine manually. I actually assume the answer is "no", but it never hurts to ask.

• Your assumption is correct, I'm afraid. In order to get the long tail, the Q must be followed by u. Make a feature request to the developers of Linux Libertine. On the other hand, I think it's possible to define a “feature file” that defines new ligatures for usage with LuaTex. Jan 25 '15 at 11:30
• Technically, I guess it would be possible to make some command \Qtail which was really Qu with the u removed somehow (using some TeX commands), but with the tail taking up no space. However, I am not sure how stable such a solution would be; it might produce bad typography. Jan 25 '15 at 11:39
• I can't see how it's possible to tweak anything in TeX to get the long tailed 'Q' before a 'v', because the font doesn't provide a long tailed 'Q' as a character at all. It only gives you 'Qu', which is encoded in the font as a single glyph. Jan 25 '15 at 11:59
• Yes, but I think that you could probably use tikz or a similar program to put a white box in front of the u, then insert a v instead and put it all into the main text. Thus we would get a command \Qv where the Q had a tail. But it would be an ugly hack and likely cause typographic problems. Jan 25 '15 at 12:02
• @Gaussler The long tail Q is defined only in combination with u; it's the character with index 2398, “longtail Q+u”. Jan 25 '15 at 12:02

The long tailed Q is not an independent glyph in Linux Libertine; it is actually bundled with the u in one single character. As a consequence, you have to create the glyph. I'm not an expert on Fontforge, but it is quite straightforward.

1. Go to the font download page in sourceforge and get the source files; http://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.3.0/

2. Open LinLibertine_R.sfd with FontForge

3. Go to the glyph Q_u [View > Goto]

4. Select everything in the glyph and copy it

5. Open an empty unicode slot [the one next to the small capital z, for instance] and paste it.

6. Select and delete the u form

7. Go to the v glyph, copy reference it and paste it back on the new unicode slot. Place the referenced v accordingly, i.e. with the same distance to the right line as in the Q_u glyph. In this case: 15.

1. Open Element > Glyph info and name it Q_v

2. Open Element > Font info > Lookups > GSUB > 'liga' Standardligaturen > 'liga' Standardligaturen 1

3. Create a new ligature: On the left row, add Q_v. On the right row, add Q, space, v

1. Open File > Generate Fonts. Select a directory. Choose OpenType CFF and Force glyph names to TeX. Name it LinLibertine_R.otf. Save. Ignore the FontForge complains regarding Extrema points, etc.

2. Create a backup of your system Linux Libertine fonts. Delete the original fonts and replace them with the new ones. To check that it is working.

\documentclass[12pt]{article} \usepackage{fontspec} \setmainfont[Mapping=tex-text,Ligatures=TeX]{Linux Libertine O} \begin{document} Qvest \end{document}

1. Now you have the glyph only for the roman letter. Repeat the instructions for a) the Capital small cap+small cap [Q_u.sc] b) the lower small caps [q.sc_u.sc]
2. You're done with the regular file. Now do the same with the italics, the bold, the bold italics and the Display family.

EDIT 1

I've modified the regular font (including the small caps of Qv and qv). To do: italics, bold, etc.

EDIT 2

1. Open Metrics > Kern by Classes > 'kern' Small Caps

2. Search in the first row containing the v.sc Class. Add Q_v.sc and q.sc_v.sc glyphs

3. Repeat with the metrics of Latin and Q_v.

• Wow, then it is a lot easier than I thought. Have you in fact already done it (for the non-small cap version), since you provide a screenshot? Can I have the file? Jan 25 '15 at 15:42
• It works perfectly for me --- in XeLaTeX. But once I switch to LuaLaTeX, it disappears again. Any good idea why? Jan 25 '15 at 16:38
• And yes, I have run texhash. Jan 25 '15 at 16:45
• @Gaussler. No idea why, because I don't use LuaLatex. On the other hand, I've added a link in the answer to the modified font, including the small caps Jan 25 '15 at 16:58
• run luaotfload-tool --update --force Jan 25 '15 at 17:01

This is ugly like hell and needs a lot of adjustment in order to work. Furthermore, it is likely to produce horrible results in long passages of text and to break down all of the wonderful typesetting features of LaTeX. However, I couldn't miss this chance to prove egreg wrong. :-D

(Even if he obviously already knew this was possible and could do it much more elegantly than I.)

\documentclass{memoir}

\usepackage{tikz}

\usepackage{fontspec}

\setmainfont[Ligatures={Common}]{Linux Libertine O}

\newcommand*\Qv{%
\mbox{}%\raisebox{-0.365\height}[0pt][0pt]{%
\raisebox{-0.26\height}[\height][0pt]{%
\begin{tikzpicture}[x=1pt,y=1pt]
\node[inner sep=0pt,outer sep=0pt] at (0,0) {Qu};
\node[fill=white,inner sep=0.5pt] at (3.6,0) {v};
\end{tikzpicture}}\hspace{-3pt}%
}

\begin{document}
Quarante.

Qvinde.

\Qv{}inde.
\end{document}


• @egreg Never say never! (In fact, I think you never did.) Jan 25 '15 at 12:30
• You aren't removing the “u”, just overpainting it with white. What if the background color is different? ;-) Jan 25 '15 at 13:30
• It shouldn't be difficult for the maintainers of Linux Libertine to add a Q_v glyph and a new stylistic variant for using it on demand. Jan 25 '15 at 13:34
• @Gaussler I was also unable to submit a request there once, so I just submitted it as a bug instead: sourceforge.net/p/linuxlibertine/bugs/300 Jan 25 '15 at 14:30
• @Gaussler -- Quite the opposite in fact: u was usually used for both u and v until about the seventeenth/eighteenth century. Where a "v" was used was when the initial u or v started the word (e.g., "unde" would usually be written vnde; but a word like "universitas" would be written like vniuersitas). I don't mean to suggest it never happened, but the vast preponderance of the evidence goes the other way.
– jon
Mar 15 '15 at 2:37