0

Before I start, I want to note that I don't know very much about (La)TeX's font system and find it to be very confusing and not very well-documented. I've read the "fntguide", but that only gives very short examples for all the available commands and doesn't explain the rules behind them in detail. Similarly, I've found the documentation for fontspec and unicode-math to be lacking (for example, \setmathfont in unicode-math has a range option that can be used when a compatible OpenType font is not available, but that is described on half a page with no comprehensive overview of its syntax). I'm willing to learn, but I've had severe difficulties finding any kind of detailed material.

I'm using LuaLaTeX (TeX Live 2013), if that's important.

Now, onto the actual question: I'm having trouble trying to get two different text and math fonts to play well together. As my text font, I want to use Comfortaa. However, since that font doesn't seem to be usable as a math font, I've tried finding another math font that fits. Note that the document(s) I'm trying to create are intended for a "fun and games" trip, so the intended effect is different than for e.g. a technical document.

I've tried using Iwona as a math font. To get \mathbb, I've used the corresponding symbols from Furier (as shown in this question). My minimal example is the following:

\documentclass{minimal}

\usepackage[math]{iwona}
\DeclareFontFamily{U}{futm}{}
\DeclareFontShape{U}{futm}{m}{n}{<-> fourier-bb}{}
\DeclareMathAlphabet{\mathbb}{U}{futm}{m}{n}

\usepackage[no-math]{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Comfortaa}
\setsansfont{Comfortaa}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{amsmath}

\begin{document}
$a$a $x$x

$A$A $X$X

$0$0

$\mathbb{N}$N

\[\forall \varepsilon > 0\ \exists n_0 \in \mathbb{N} \text{ such that } \forall n > n_0: |a_n - a| < \varepsilon \Leftrightarrow a_n \text{ converges to } a\]
\end{document}

However, the font sizes don't match: Font size mismatch Both Iwona and the Fourier symbols are too small compared to Comfortaa.

Now, I could of course scale down Comfortaa using fontspec (\setmainfont[Scale=<factor>]{Comfortaa}), but what if I want to scale up because I don't want smaller letters? I've also tried \DeclareMathSizes{t-size}{mt-size}{s-size}{ss-size} (as in this question about how to scale math fonts), but that has had no effect at all for some reason.

I've seen this question, but my problem is not that I can't use Iwona, but that the font size is off.

So I found this question about different math fonts and their sizes and, looking into the *.fd files for Iwona, modified my minimal example as follows:

\documentclass{minimal}

\usepackage[math]{iwona}
\DeclareFontFamily{U}{futm}{}
\DeclareFontShape{U}{futm}{m}{n}{<-> s*[1.15] fourier-bb}{}
\DeclareMathAlphabet{\mathbb}{U}{futm}{m}{n}

\DeclareFontFamily{OML}{iwona}{}
\DeclareFontShape{OML}{iwona}{m}{n}{<-> s*[1.15] rm-iwonar}{}
\DeclareFontShape{OML}{iwona}{m}{it}{<-> s*[1.15] mi-iwonari}{}
\DeclareFontShape{OML}{iwona}{b}{it}{<-> s*[1.15] mi-iwonabi}{}
\DeclareFontShape{OML}{iwona}{bc}{it}{<-> s*[1.15] mi-iwonacbi}{}
\DeclareFontShape{OML}{iwona}{ebc}{it}{<-> s*[1.15] mi-iwonachi}{}
\DeclareFontShape{OML}{iwona}{lc}{it}{<-> s*[1.15] mi-iwonacli}{}
\DeclareFontShape{OML}{iwona}{sbc}{it}{<-> s*[1.15] mi-iwonacmi}{}
\DeclareFontShape{OML}{iwona}{c}{it}{<-> s*[1.15] mi-iwonacri}{}
\DeclareFontShape{OML}{iwona}{eb}{it}{<-> s*[1.15] mi-iwonahi}{}
\DeclareFontShape{OML}{iwona}{l}{it}{<-> s*[1.15] mi-iwonali}{}
\DeclareFontShape{OML}{iwona}{sb}{it}{<-> s*[1.15] mi-iwonami}{}
\DeclareFontShape{OML}{iwona}{bx}{n}{<->ssub *[1.15] iwona/b/n}{}
\DeclareFontShape{OML}{iwona}{bx}{it}{<->ssub *[1.15] iwona/b/it}{}
\DeclareFontShape{OML}{iwona}{bx}{sc}{<->ssub *[1.15] iwona/b/sc}{}
\DeclareFontShape{OML}{iwona}{bx}{scit}{<->ssub *[1.15] iwona/b/scit}{}

\DeclareFontFamily{OMS}{iwona}{}
\DeclareFontShape{OMS}{iwona}{b}{n}{<-> s*[1.15] sy-iwonabz}{}
\DeclareFontShape{OMS}{iwona}{bc}{n}{<-> s*[1.15] sy-iwonacbz}{}
\DeclareFontShape{OMS}{iwona}{ebc}{n}{<-> s*[1.15] sy-iwonachz}{}
\DeclareFontShape{OMS}{iwona}{lc}{n}{<-> s*[1.15] sy-iwonaclz}{}
\DeclareFontShape{OMS}{iwona}{sbc}{n}{<-> s*[1.15] sy-iwonacmz}{}
\DeclareFontShape{OMS}{iwona}{c}{n}{<-> s*[1.15] sy-iwonacrz}{}
\DeclareFontShape{OMS}{iwona}{eb}{n}{<-> s*[1.15] sy-iwonahz}{}
\DeclareFontShape{OMS}{iwona}{l}{n}{<-> s*[1.15] sy-iwonalz}{}
\DeclareFontShape{OMS}{iwona}{sb}{n}{<-> s*[1.15] sy-iwonamz}{}
\DeclareFontShape{OMS}{iwona}{m}{n}{<-> s*[1.15] sy-iwonarz}{}
\DeclareFontShape{OMS}{iwona}{bx}{n}{<->ssub *[1.15] iwona/b/n}{}
\DeclareFontShape{OMS}{iwona}{bx}{it}{<->ssub *[1.15] iwona/b/it}{}
\DeclareFontShape{OMS}{iwona}{bx}{sc}{<->ssub *[1.15] iwona/b/sc}{}
\DeclareFontShape{OMS}{iwona}{bx}{scit}{<->ssub *[1.15] iwona/b/scit}{}

\DeclareFontFamily{OMX}{iwona}{}
\DeclareFontShape{OMX}{iwona}{b}{n}{<-> s*[1.15] ex-iwonab}{}
\DeclareFontShape{OMX}{iwona}{bc}{n}{<-> s*[1.15] ex-iwonacb}{}
\DeclareFontShape{OMX}{iwona}{ebc}{n}{<-> s*[1.15] ex-iwonach}{}
\DeclareFontShape{OMX}{iwona}{lc}{n}{<-> s*[1.15] ex-iwonacl}{}
\DeclareFontShape{OMX}{iwona}{sbc}{n}{<-> s*[1.15] ex-iwonacm}{}
\DeclareFontShape{OMX}{iwona}{c}{n}{<-> s*[1.15] ex-iwonacr}{}
\DeclareFontShape{OMX}{iwona}{eb}{n}{<-> s*[1.15] ex-iwonah}{}
\DeclareFontShape{OMX}{iwona}{l}{n}{<-> s*[1.15] ex-iwonal}{}
\DeclareFontShape{OMX}{iwona}{sb}{n}{<-> s*[1.15] ex-iwonam}{}
\DeclareFontShape{OMX}{iwona}{m}{n}{<-> s*[1.15] ex-iwonar}{}
\DeclareFontShape{OMX}{iwona}{bx}{n}{<->ssub *[1.15] iwona/b/n}{}
\DeclareFontShape{OMX}{iwona}{bx}{it}{<->ssub *[1.15] iwona/b/it}{}
\DeclareFontShape{OMX}{iwona}{bx}{sc}{<->ssub *[1.15] iwona/b/sc}{}
\DeclareFontShape{OMX}{iwona}{bx}{scit}{<->ssub *[1.15] iwona/b/scit}{}

\usepackage[no-math]{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Comfortaa}
\setsansfont{Comfortaa}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{amsmath}

\begin{document}
$a$a $x$x

$A$A $X$X

$0$0

$\mathbb{N}$N

\[\forall \varepsilon > 0\ \exists n_0 \in \mathbb{N} \text{ such that } \forall n > n_0: |a_n - a| < \varepsilon \Leftrightarrow a_n \text{ converges to } a\]
\end{document}

With the following result: Second attempt Now, that worked well enough, but for some reason, the numbers were not scaled while the other glyphs were.

Now, my question is

  1. if there's a better way to scale Iwona than the one I've used,
  2. why the numerals were not scaled and how to scale them as well,
  3. if there's maybe a better font I could use for math with Comfortaa.

A final note for this question: I'm not merely asking to find a practical solution, I'm also trying to learn more about LaTeX's font system – e.g., how does one scale any arbitrary font?

  • 1
    Scale down Comfortaa and use a bigger global font size. But beware that the appearance of Iwona Math next to Comfortaa doesn't seem the best (big understatement). – egreg Nov 11 '14 at 22:44
  • @egreg How do I use a bigger global font size with the usual classes (scrartcl etc.) than 12pt? Do you perhaps have a suggestion for a better font for Comfortaa? Also, I'd still be interested to learn more about LaTeX fonts. What happened to the numerals and is there really no (good) way to scale fonts like Iwona? – Socob Nov 11 '14 at 22:48
  • 12pt is already very large. Unfortunately, there are not many sans serif fonts for math to choose from. And, if I can express my opinion, Comfortaa is not good as a text font. – egreg Nov 11 '14 at 22:51
  • @egreg As I've mentioned before, the question arose from trying to create some instructions for games during a trip, so I'd like to use a relatively large font. I noticed that the selection of sans serif math fonts is lacking, but since a serif font would be completely out of place, I'm left with little choice. Because of the purpose of the document, only a casual font is appropriate, and many other sans-serif fonts seemed to "serious". Though that's a matter of taste, I guess. Finally, if Comfortaa is not a good text font – since it's not a math font, does that mean it's not good at all? ;-) – Socob Nov 11 '14 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.