# lualatex: Need help with using different fonts

I could need some start-up aid with using fonts in lualatex. I have 3 questions (sorry):

A) I want to use a nice mainfont for normal text. The lmodern-default was nice with pdflatex, but the default now looks ugly: the f's overlap, see MWE and output. Seems not to be a ligature issue (I don't want to use ligatures at all!)

Update (solved): I'm a german writer, and I don't see ligatures anywhere in german texts, so I want to disable them in mine, too, of course. The link from phg (http://tex.stackexchange.com/a/103242/14066) does the trick!

\defaultfontfeatures{Ligatures={NoCommon, NoRequired, NoContextual, NoHistoric, NoDiscretionary}}
\setmainfont{Latin Modern Roman}


microtype-package with command \DisableLigatures[f]{ encoding = * } + babel-package doesn't give the expected output.

The selnolig-package with commands \nolig{f[fil]}{f|x} \nolig{Th}{T|h} also works.

B) Besides the mainfont I want something highlightning for musical compositions.

Update: To set this right: I want to have my default font in \textsc, slightly slanted (\textsl?) and with small letterspacing. I'm not sure, if I can use microtype for this. I've tried it, but it doesn't change the letterspacing. Also it didn't work to combine \textsc and \textsl.

C) I need to write a lot of musical symbols, that's why I switched to lualatex, so I can embed music fonts. But if I try it, I can't get it to work. I've tried it with BravuraText, found here: http://www.smufl.org/fonts. The funny fact is, that I can't see any of the written letters in the output, and I can't see the font properly in the Win7-character map (charmap), but I can see it in OpenWriter...

Update (solved): Thx to Will Robertson, Bernard (see answers) and Thérèse.

fontforge or fontmatrix can be used to inspect the font.

The best things about B) and C) would be, if I could use simple commands like \composition{Brandenburgische Konzerte} and \fortissimo.

MWE:

\documentclass[ngerman]{article}
\usepackage{fontspec}

\begin{document}
asdfff asf aft afft
\fontspec{BravuraText}
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

\end{document}


Output:

-
Neither of the Bravura fonts appears to provide glyphs for ASCII codepoints, that’s why you can’t see any of the basic Latin letters. Also see here for a way to suppress ligatures with Fontspec. –  phg May 25 at 21:49
To disable f-ligatures globally under pdfLaTeX, you could load the microtype package and issue the command \DisableLigatures[f]{ encoding = * }. To disable f-ligatures globally under LuaLaTeX, you could load the selnolig package without a language option and issue the command \nolig{f[fil]}{f|x}. (Full disclosure: I'm the main author of the selnolig package.) –  Mico May 25 at 22:04
What you show in the image are Latin Modern’s ligatures, even if you didn’t want to use them. They aren’t to my taste (neither is Latin Modern), but one reason for ligatures is to prevent glyphs from crashing into each other. So you probably want to find a font with more pleasing ligatures, using selnolig to use them only as appropriate in German, rather than to disable ligatures altogether. And if you’re writing about Bach, I’d choose a font that, while appropriate for contemporary use, suggests the baroque era (perhaps Mauritius?). –  Thérèse May 26 at 0:00
I like Latin Modern although I sometimes wish it was just a little thicker in places but only for photocopying reasons. It prints fine. And it has every shape and style of more-or-less everything (4 styles of figures, small caps, italic small caps, matching maths etc.). Not saying it is perfect but I just think people tend to 'not like' it just because it is the default. (Given some of the things people want to use instead...) –  cfr May 26 at 2:13
@Manuel - Font designers generally seem to work under the impression that combinations such as ff, fi, and fl will always be typeset as ligatures; hence, no special kerning information seems to be provided to handle unligated cases. The method employed by babel finesses this point by always inserting a bit of whitespace -- 0.03em, to be precise -- between the characters whose ligatures are suppressed. This method is fine for some character combinations, notably fl, but it's not for others, say, ff, which (to me at least) look better without the extra whitespace. :-( –  Mico May 26 at 5:04

As mentioned by Bernard, the only good way to access the music glyphs in this font is to ask for them by glyph slot. Depending on your use-case, it will probably make most sense to write a macro to simplify this to some degree; I'd recommend something like:

\documentclass[a4paper]{article}
\usepackage{fontspec}
\setmainfont{Times}

\newcommand\musicwholenote    {\char"1D15D\relax}
\newcommand\musichalfnote     {\char"1D15E\relax}
\newcommand\musicquarternote  {\char"1D15F\relax}
\newcommand\musiceighthnote   {\char"1D160\relax}
\newcommand\musicsixteenthnote{\char"1D161\relax}

\newfontface\musicfont{Bravura}
\newcommand\music[1]{{\musicfont \csname music#1\endcsname}}

\begin{document}
hello \music{wholenote} \music{halfnote} \music{quarternote} \music{eighthnote}\music{sixteenthnote}
\end{document}


Note you choose whichever text font you wish with \setmainfont, and then the music symbols come explicitly from Bravura.

If you end up writing a significant number of glyph definitions, I recommend somehow sharing that information to help other people in the same situation. For example, you could add this font to TeX Live (it's free enough, I believe) and provide a package that has the named glyph slot definitions.

-
Thank you for your answer!! Mapping all the symbols will be the hardest part, but I think it's worth it. I thought about share the macro/write a package. But before all that - can you recommend any software to insepect the font? (Win7) As I said, my charmap seems to be very useless for this job. –  musicman May 26 at 4:59
@musicman To inspect the font, fontforge is the best free program I’ve seen. fontmatrix, though much less powerful than fontforge and not well documented, does far more than the average font-viewer. –  Thérèse May 26 at 6:16
Thank you! fontmatrix seems to be the right candidate for me. –  musicman May 26 at 6:34
I'll accept your answer, since it's the most comprehensive solution. Thank you. –  musicman May 26 at 6:44
You can also use XeTeX or LuaTeX: gist.github.com/wspr/4e5957b72c306ab63816 . Perhaps this is something I should add to fontspec. –  Will Robertson May 26 at 23:18

I can use this font with either lualatex or xelatex, but to obtain the glyphs I have to enter their U-code. So you should define a command at least for each of the glyphs you want to use, such as \newcommand*\trebleclef{\char"E050}. That's a rather long job, as there are 3127 glyphs, of which only the first five belong to standard TeX fonts. Apart from these they belong to the range U-E000 to U-F55D 5I suppose this is standardised).

Anyway, here is the code I used to get an example:

\documentclass[12pt, ngerman]{article}

\usepackage{fontspec}

\begin{document}
asdfff asf aft afft
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\

\fontspec{BravuraText}

\end{document}


-
"I suppose this is standardised" — nope, this glyph range is denoted "private use", so you need a custom mapping (somehow) to each desired glyph. –  Will Robertson May 26 at 0:45
There is a standardisationCf. this document: –  Bernard May 26 at 1:09
@ Will Robertson: Cf. this document: unicode.org/charts/PDF/U1D100.pdf. However I don't understand how, e.g., the U-1D11E code for the treble clef has become for this font U-E050. –  Bernard May 26 at 1:17
Sure, but the unicode music range has fewer than 224 glyphs, whereas this music font is extremely comprehensive. So all the extra glyphs that aren't in unicode are placed in the private use area. –  Will Robertson May 26 at 2:57
Thx for your answer and the replies. The unicode music symbols are nice, but they are way too less. In fact, you'd have to deal with some music fonts to get what you want... –  musicman May 26 at 5:46

For the music fonts you can use the lilyglyphs package (in TeXLive) which gives you a comprehensive means to access the Emmentaler music font used in the Lilypond music engraving software.

-
That's a nice package, but Emmentaler has way less symbols than Bravura, and Bravura will be developed further... –  musicman May 26 at 15:56
"Way less symbols" is a bit of a misstatement. Lilypond takes existing Emmentaler glyphs and combines them to get what it needs where Bravura makes these combinations into single glyphs. Lilyglyphs makes it easy to create these combinations as well. Also, Emmentaler continues to be developed and the lilyglyphs package can be expanded as needed with whatever glyph combinations you want all of which can be added to the base package (the project maintainer wants people to send in their creations). Also, also, Bravura is missing some glyphs that Emmentaler already has. –  bfootdav May 26 at 16:14
Thanks for your arguments :-) –  musicman May 26 at 16:29