Code Monkey home page Code Monkey logo

firamath's Introduction

Fira Math

Build Status CTAN GitHub release

Fira Math is a sans-serif font with Unicode math support. This font is a fork of

Showcase

firamath-demo-2 firamath-demo-3 firamath-demo-4 firamath-demo-5

Installation

On your system

Download FiraMath-Regular.otf from the GitHub release page, then:

  • Windows
    1. Quit related programs, e.g. Microsoft Word.
    2. Double-click the font file to open it in the Font Previewer.
    3. Click Install bottom to install.
    4. You can also directly copy all the .otf font files into %WINDOWS%\Fonts\ to install them.
  • macOS
    1. Double-click on the font files in Finder.
    2. It will open in the font previewer. Click Install Font. It will open in the Font Book.
    3. Close the Font Book. The fonts should now be available.
    4. Details can be found in this article.
  • Linux
    1. Copy the .otf font files to your fonts directory.
    2. Run sudo fc-cache.

On the TeX distribution

  • If there are no special reasons, you should always install Fira Math via the package manager:

    • TeX Live: run tlmgr install firamath
    • MiKTeX: run mpm --admin --install=firamath

    Both distributions have GUI interfaces, you may enjoy them as well.

  • [NOT RECOMMENDED] Download firamath.tds.zip from CTAN or GitHub release page, extract it in the root of one of your TDS trees, then run mktexlsr and fc-cache to update the filename database and font cache.

Usage

Fira Math can be used in LaTeX, ConTeXt and Microsoft Word after installed on your OS (or the TeX distribution).

LaTeX

% Compiled with XeLaTeX or LuaLaTeX
\documentclass{article}
\usepackage{amsmath}
\usepackage[mathrm=sym]{unicode-math}
\setmathfont{Fira Math}

\begin{document}
\[
  \int_0^{\mathrm{\pi}} \sin x \, \mathrm{d}x = 2
\]
\end{document}

You may try the firamath-otf package as well. - Thanks Herbert Voß!

ConTeXt

% Compiled with ConTeXt MkIV
\definefontfamily [mainface] [rm] [FiraGO]  % Require FiraGO fonts
\definefontfamily [mainface] [mm] [Fira Math]
\setupbodyfont    [mainface]

\starttext
\startformula
  \int_0^{\mathrm{\pi}} \sin x \, \mathrm{d}x = 2
\stopformula
\stoptext

See https://tex.stackexchange.com/q/429621.

Microsoft Word

  1. Create a new equation. Then select the little additional settings corner.
  2. In the menu, change the Default font to Fira Math.
  3. In order for the changes to take effect, you will have to create a new equation environment (the current one will not be changed).
  4. To change the font in existing equations, select the equation text and select an OpenType math-enabled font (such as Fira Math).

See https://superuser.com/q/1114697.

Building from source

To build Fira Math, you may

python -m pip install -U pip
pip install -r requirements.txt
patch $(python -c "import os, glyphsLib; print(os.path.join(glyphsLib.__path__[0], 'builder', 'axes.py'))") scripts/axes.py.diff
python scripts/build.py

Note that Python 3.9+ is required. Since we are using the dev version of glyphsLib, it's better to use a Python virtual environment.

To edit the source files, Glyphs 3 is required.

Development builds

If you just want to download the latest development version, please try the artifacts in GitHub Actions.

Contributing

Issues and pull requests are always welcome.

License

This Font Software is licensed under the SIL Open Font License, Version 1.1.


Copyright © 2018–2023 by Xiangdong Zeng.

firamath's People

Contributors

bwiernik avatar dmey avatar phelypeoleinik avatar stone-zeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firamath's Issues

upright integrals

It seems that upright integrals are not scaled up as ordinary integrals.

    \setmathfont[Color=000066,Scale=MatchLowercase]{Fira Math}
    \setmathfont[range={"222B-"2233,"2A0B-"2A1C},StylisticSet=1]{Fira Math}

    \begin{equation}
    \label{2:06}
    n(r)
    =
    2  \int_{0}^{\infty } \dif{v} v
    \int_{-\arcsin(r/a)}^{+\arcsin(r/a)}
    \overline{f}(v,\alpha; r)\dif\alpha
    .
    \end{equation}

Missing math symbols: \star, \Im, \ddots, \vdots

Symbols for \star, \Im, \ddots, \vdots are rendered as question marks in boxes.

I used xelatex and the following preamble commands:

\usepackage[sfdefault,scaled=.85]{FiraSans}
\usepackage[mathrm=sym]{unicode-math}
\setmathfont[Scale=.85]{Fira Math}

Kelvin symbol runs away

\documentclass{article}
\usepackage[math-style=ISO, bold-style=ISO]{unicode-math}
\setmathfont{Fira Math}
\newcommand{\angstrom}{\,\symbol{8491}}
\newcommand{\kelvin}{\,\symbol{8490}}
\begin{document}
    $1\angstrom 3\kelvin$
\end{document}

The Kelvin symbol does not appear, nor does the "tofu" (the Kelvin symbol should have been added on Nov 18, 2018).
[XeTeX (MacTeX)]
image

Symbols missing in Non-Regular versions

First, let me thank you for all the work you put in here, especially also on the inclusion of more weights.

I just downloaded the 4.0-beta3 to try it out and found some symbols missing in the non-regular versions when using with unicode-math:

  • \nabla
  • \cdot
  • \hbar

Limit (\lim) operator

There appears to be no symbol for the lim operator, which I would expect to render basically just as the non-italic letters lim. Is there an easy workaround for this?

Migrating to Glyphs

After some trial on Glyphs, I plan to migrate to it from FontForge.

Fira Sans has provided the source files with unmerged paths, so I can use them for better interpolation. On the other hand, it has 8 masters with 2 axes (weight and width), which means there are much more work to do unfortunately.

The source file .glyphs is somehow much better than .ufo, and there are libraries to work with it (e.g. fontmake), although as a single file it may be very large.

Any suggestions or comments are welcomed here.

Math operators are small

This is a very similar issue from alerque/libertinus#63

The math operators are rather small compared to other math fonts. This might have been OK for the text font, but not so much for the math font.

IMHO Fira Math experiences the same flaws (in particular, the +, -, =, etc. signs are too small to be legible in math).

Below is the PDF file consisting of the changes made in alerque/libertinus#272

The priority of Fira Math at this stage is to include more glyphs. So it will be better to start drawing new glyphs in a larger design space.

More alphabets

Roman

  • Latin
    • upright
    • italic
    • bold
    • bold italic
  • Greek
    • upright
    • italic
    • bold
    • bold italic

Sans-serif

  • Latin
    • upright
    • italic
    • bold
    • bold italic
  • Greek
    • upright
    • italic
    • bold
    • bold italic

Typewriter

  • Latin
    • upright
    • italic
  • Greek
    • upright
    • italic

Blackboard

  • Latin
    • upright
    • italic
    • bold
    • bold italic
  • Greek
    • upright
    • italic
    • bold
    • bold italic

Script/calligraphic

  • Latin
    • upright
    • bold

Fraktur

  • Latin
    • upright
    • bold

Cross out means it's not in UNICODE.

CTAN submission ?

Wouldn't it be nice to have this font (and possibly a support style file) submitted to CTAN for inclusion in TeXlive ? I think it's too late for 2018, but it would be nice to have it in TeXlive 2019...

Script Small G (U+210A) is not really scripted

The script/calligraphic alphabets are under development (#14), but two script-like lowercase letters are already available in FiraMath v0.3.1.

If I understand correctly, in LaTeX with unicode-math, Script Small L U+2113 (which is in FiraMath v0.3.1) can be accessed via \ell, while Mathematical Script Small L U+1D4C1 (which is NOT in FiraMath v0.3.1) can be accessed via \mscrl. But, Script Small G U+210A (which is in FiraMath v0.3.1) has no math counterpart in Unicode, and it can be accessed via \mscrg.

The issue here is that the one existing math/text calligraphic lowercase is not calligraphic at all.

% !TeX program = XeLaTeX
\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Fira Math}[version=FM]
\setmathfont{TeX Gyre Termes Math}
\begin{document}
{$\ell$ \mathversion{FM} $\ell \enskip ☺$}\par
{$\mscrg$ \mathversion{FM} $\mscrg \enskip ☹$}
\end{document}

lg

Heights of superscripts and subscripts

I am trying the v0.3 otf release in MS Word these days and found the superscripts/subscripts are not behaving as expected:

default

Basically, regardless of extension of the delimiters themselves, the superscripts/subscripts will stay at the same height from the baseline. Are thay designed to behave in this way, or influenced by other factors?

Tabular figures

Currently Fira Math uses lining but proportional figures, as illustrated in the following example.

% Compile with XeLaTeX or LuaLaTeX
\documentclass{article}
% Fira Sans and Fira Math
\usepackage[sfdefault,lining,tabular]{FiraSans}
\usepackage[mathrm=sym]{unicode-math}
\setmathfont{Fira Math}
% newtx
%\usepackage{newtxtext}
%\usepackage{newtxmath}

\newcommand*{\measurewidth}[1]{{%
  $#1$: \setbox0=\hbox{$#1$}\the\wd0\relax}}

\begin{document}
Math: $2018$.\par
Text: 2018.\par
\measurewidth{0}\par
\measurewidth{1}\par
\measurewidth{2}\par
\measurewidth{3}\par
\measurewidth{4}\par
\measurewidth{5}\par
\measurewidth{6}\par
\measurewidth{7}\par
\measurewidth{8}\par
\measurewidth{9}
\end{document}

Although proportional figures are appropriate in text, tabular figures are more suitable for price lists, stock listings and sums in mathematics textbooks, etc. Try the newtxtext and newtxmath packages for a comparison. In general, proportional figures lead to misalignment within tables.

Note that the lining and tabular options of FiraSans causes text figures to be taken from Fira Mono, which is not desired.

I was wondering if, by default, math figures can be made “mono-spaced” by adjusting their bounding boxes; that is, using Fira Sans figures but with fixed glyph width.

Optical sizes via ssty suggestions

Disclaimer

I am not a type designer. My suggestions are based on my experience and my untrained eyes.

Background

It can be observed that many well-designed math fonts come with 3 optical sizes, which are separately used in text-size, script-size and script-script-size, respectively. (The commercial Minion Math has 5 optical sizes)

mathfonts
From left to right: MathTime Professional 2 (lite, Type 1 Font), Cambria Math (commercial, Microsoft, OTF), TeX Gyre Pagella Math (OTF), and TeX Gyre Termes Math (OTF). The latter three OpenType fonts utilize the ssty feature to access the un-coded script-level glyphs. (MathTime Professional 2 and Minion Math use separate font files so they are irrelevant here)

There are two noticeable characteristics:

  • The width of the glyph widens as the point size decreases.
  • The strokes of the glyph thicken as the point size decreases.

Take the upright capital letter E in TeX Gyre Termes Math for example (I find the choice of not thickening the horizontal strokes questionable):

U+0045 Text-size Script-size Script-script-size
Slot 37 2278 2279
Horizontal advance 611 692 779
Vertical stroke thickness 102 112 123
Bottom horizontal stroke thickness 37 37 37

Current situation for Fira Math

Please compare the following two examples:

fira
The FiraMath v0.3.1 output is shown on the left, while certain “wizardry” is used to produce the output on the right (using graphic tools).

More specifically, I used Fira GO Medium Italic for the second-level script, and interpolated between Fira GO Italic and Fira GO Medium Italic for the first-level script. To me, the 3 weights looked just right (or perhaps too much?). However, it would be even better to have wider (not just thicker) script-level characters.

Further reading

Arrows don't line up with mhchem package

When using the mhchem package to write chemical equations the arrows don't line up properly. The problem exists in both the Light and standard weights. I didn't check the other weights. Here is an MWE:

%! TEX program = lualatex
\documentclass[varwidth=true, border=10pt, convert={size=640x}]{standalone}
\usepackage[version=4]{mhchem}
\usepackage{unicode-math}
\setmainfont{Fira Sans Light}
\setmathfont{Fira Math Light}

\begin{document}
\ce{A <=> B + C}
\vspace{5mm}
\ce{A <-->[long forward]B + C}
\vspace{5mm}
\ce{X <-->Y + Z}
\end{document}

arrows-1

Remove U+FEFF ZERO WIDTH NO-BREAK SPACE

At present U+FEFF ZERO WIDTH NO-BREAK SPACE is leave as an empty glyph (only in regular weight). Should I keep this, or simply remove it? Do I need to consider such special things when design a font?

\vdots glyph is not rendered

Thank you for elegant font, I love this font.

I found lacking font even if the glyph is used in the test case.
You can reproduce this issue by this code.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{Fira Math}
\begin{document}
\(\vdots\cdots\ldots\)
\end{document}

When I used XITS Math instead of Fira Math, latex rendered it expectedly.
Could you add the glyph for \vdots ?


For readers,
Your can keep using this font temporary by the following code.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{Fira Math}
\setmathfont[range={"22EE}]{XITS Math}
\begin{document}
\(\vdots\cdots\ldots\)
\end{document}

More over and under symbols

Use automated script to generate more sizes:

  • Over square bracket
  • Over parenthesis
  • Over curly bracket
  • Over tortoise shell bracket
  • Under square bracket
  • Under parenthesis
  • Under curly bracket
  • Under tortoise shell bracket

and large accents:

  • \hat / \widehat (◌̂)
  • \tilde / \widetilde (◌̃)
  • \overbar / \wideoverbar (◌̅)
  • \breve / \widebreve (◌̆)
  • \check / \widecheck (◌̌)
  • \cev / \overleftarrow (◌⃖)
  • \vec / \overrightarrow (◌⃗)
  • \leftharpoonaccent / \overleftharpoon (◌⃐)
  • \rightharpoonaccent / \overrightharpoon (◌⃑)
  • \overleftrightarrow (◌⃡)
  • \wideutilde (◌̰)
  • \mathunderbar (◌̲)
  • \underleftrightarrow (◌͍)
  • \underrightharpoondown (◌⃬)
  • \underleftharpoondown (◌⃭)
  • \underleftarrow (◌⃮)
  • \underrightarrow (◌⃯)

Font dimensions related to \overline

Related TeX.SX posts:


LuaTeX correctly implements \Umathoverbarkern, \Umathoverbarrule and \Umathoverbarvgap to construct an \overline object. However, XeTeX fails to use \fontdimen55, \fontdimen54 and \fontdimen53.

In my experiment, it seems that XeTeX uses \fontdimen54, \fontdimen54 and 3\fontdimen54 for kern, rule and vgap, respectively, according to most other OpenType math fonts. But this conjecture fails for Fira Math:

% !TeX program = LuaLaTeX % <- Everything lines up perfectly
% !TeX program = XeLaTeX %  <- Not good for Fira Math
\documentclass{article}
\usepackage{unicode-math}
\setmathfont[version=L]{Latin Modern Math}
\setmathfont[version=P]{TeX Gyre Pagella Math}
\setmathfont[version=T]{TeX Gyre Termes Math}
\setmathfont[version=F]{[FiraMath-Regular.otf]}% in the v0.4-beta-1 collection
\makeatletter
\def\test@overbarkern@fontdimen{55}% Not used. XeTeX mistake?
\def\test@overbarrule@fontdimen{54}
\def\test@overbarvgap@fontdimen{53}% Not used. XeTeX mistake?
\def\test@@family{2}
\def\test@overbarkern#1{\fontdimen\test@overbarrule@fontdimen
    \ifx#1\displaystyle\textfont
    \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont\fi\fi\fi \test@@family}
\def\test@overbarrule#1{\fontdimen\test@overbarrule@fontdimen
    \ifx#1\displaystyle\textfont
    \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont\fi\fi\fi \test@@family}
% The following is very likely an XeTeX engine-wise mistake,
% but it works for most other OTF math fonts.
\def\test@overbarvgap#1{\thr@@\fontdimen\test@overbarrule@fontdimen
    \ifx#1\displaystyle\textfont
    \else\ifx#1\textstyle\textfont
        \else\ifx#1\scriptstyle\scriptfont
        \else\scriptscriptfont\fi\fi\fi \test@@family}
\ifx\XeTeXcharclass\@undefined
    % LuaTeX primitives
    \global\let\test@overbarkern\Umathoverbarkern
    \global\let\test@overbarrule\Umathoverbarrule
    \global\let\test@overbarvgap\Umathoverbarvgap
\fi
\newcommand*\test{\mathpalette\test@stuff{xyz}}
\def\test@stuff#1#2{%
    \vbox{\hrule\@height0.1\p@\hbox{$\m@th#1\overline{#2}$}}\,%
    \vbox{%
    \hrule\@height0.1\p@
    \kern\test@overbarkern#1%
    \hrule\@height\test@overbarrule#1%
    \hbox{\vbox{%
        \kern\test@overbarvgap#1%
        \hbox{$\m@th#1#2$}%
    }}%
    },%
}
\newcommand*\dotest[1]{%
    \begingroup
    \mathversion{#1}%
    $\displaystyle\test$ $\textstyle\test$ $\scriptstyle\test$ $\scriptscriptstyle\test$%
    \endgroup
}
\makeatother

\begin{document}
\dotest{L}\par
\dotest{P}\par
\dotest{T}\par
\dotest{F}
\end{document}

XeLaTeX output:
output

With LuaLaTeX, everything lines up perfectly no matter which math font is used.


Font issue v.s. engine issue

I think it is rather clear that the XeTeX engine still implements the wrong math font dimensions. However, even with the “wrong” dimensions used, all TeX Gyre Math fonts as well as Latin Modern Math pass the above test (did not test STIX2 or XITS yet).

This suggests maybe there is something wrong with Fira Math, but I honestly do not know.

Multi-weight math font support in MS Word

It seems that MS Word does not support multi-weight math font. Only 4/5 weights can be found in the "Equation Options" (Bold version is missing). And at the same time, FiraMath-Regular can't be used normally.

Note that the family name of FiraMath-Regular and FiraMath-Bold are both Fira Math, so I guess it's related to this point.

Migrating to .ufo

The Unified Font Object (UFO) is a cross-platform, cross-application, human readable, future proof format for storing font data.

As the Font Development Best Practices suggested, new font project may adopt the open and platform-neutral ufo standard.

However, ufo uses single files for each glyph, which is more difficult and slow to manage with Git (that's why I changed from sfdir to sfd). Furthermore, the XML format contains much more redundant strings (e.g. the tag name) and will take more space. On the other hand, FontForge does not support using ufo as the native format (at present), so we need extra procedures if using it.

In a word, I don't plan to migrate to .ufo in the near future. But I'm still considering other possibilities (e.g. using Glyphs or Trufont instead of FontForge, maybe?).

Extensible delimiters/radicals suggestions

This is a follow-up discussion from latex3/unicode-math#277

The \left<del>...\right<del> algorithm from TeX has two default parameters: \delimiterfactor=901 and \delimitershortfall=5pt. The former \delimiterfactor implies that the delimiter will be as at least 90.1% tall as the content inside.

Here are 3 main suggestions regarding the extensible delimiters in Fira Math:

  1. Leave size 1 as is.
    The current size 1 delimiters/radicals are designed at 1.319em. This is perfect for the Fira family, since the preferred line spacing for Fira is 1.4 times the font size. See mozilla/Fira#67 (comment) and mozilla/Fira#189 (comment) Moreover, this size should be between 1.4×0.901=1.2614 em and 1.4 em, confirming that 1.319 em is perfect ;-)
  2. Make size 2 and up to be integer quarter multiples of size 1.
    Currently, the ratios between size 2 and up and size 1 are rather peculiar: 1.249, 1.497, 1.746, 1.995 and so on. In TeX, the default \Big, \bigg and \Bigg are exactly 1.5, 2 and 2.5 times of \big. It would be nice to have size 2 and up to be exactly 1.25, 1.5, 1.75, 2 and so on. In particular, users are likely to define \newcommand\vast{\bBigg@{3}} and \newcommand\Vast{\bBigg@{3.5}}. See https://tex.stackexchange.com/a/6796 and https://liam.page/2018/11/09/the-bigger-than-bigger-delimiter-in-LaTeX/ (in Chinese, @Liam0205)
  3. Either consider removing even sizes or instruct users to issue \delimiterfactor=945.
    Due to the default \delimiterfactor=901, the many intermediate even-numbered sizes would cause problem: If the content is size-8 tall, then size-7 delimiter will be used. In fact, this happens for all size 8 and up. The threshold is given by the last pair of size-14 and 15: \delimiterfactor needs to be bigger than 1000×4.25/4.5. The other consideration is the following: In TeX, it is advised not to (ab)use \left\right. The use of manual sizing is recommended. Note that the intermediate sizes are not accessible by manual sizing \big and friends anyway.
\documentclass{article}
\usepackage{xcolor,amsmath,unicode-math}
\setmathfont{FiraMath-Regular.otf}
\makeatletter
\ExplSyntaxOn
\tl_new:N \g_@@_big_to_normal_size_ratio_tl
\tl_gset:Nn \g_@@_big_to_normal_size_ratio_tl
  {
    \fp_eval:n { 1.319 / 0.990 } % FiraMath-Regular.otf
  }
\addto@hook\every@math@size{%
  \global\big@size \g_@@_big_to_normal_size_ratio_tl\ht\Mathstrutbox@
  \global\advance\big@size \g_@@_big_to_normal_size_ratio_tl\dp\Mathstrutbox@ }
\ExplSyntaxOff
\def\big{\bBigg@{1}}
\def\Big{\bBigg@{1.497}}
\def\bigg{\bBigg@{1.995}}
\def\Bigg{\bBigg@{2.492}}
\def\vast{\bBigg@{2.989}}
\def\vastl{\mathopen\vast}\def\vastm{\mathrel\vast}\def\vastr{\mathclose\vast}
\def\Vast{\bBigg@{3.487}}
\def\Vastl{\mathopen\Vast}\def\Vastm{\mathrel\Vast}\def\Vastr{\mathclose\Vast}
\def\VAST{\bBigg@{3.984}}
\def\VASTl{\mathopen\VAST}\def\VASTm{\mathrel\VAST}\def\VASTr{\mathclose\VAST}
\def\VASTT{\bBigg@{4.482}}
\def\VASTTl{\mathopen\VASTT}\def\VASTTm{\mathrel\VASTT}\def\VASTTr{\mathclose\VASTT}
\makeatother
\newcommand*\testbig[1]{%
  \vcenter{\hrule height0.990em width0.4pt}%
  #1%
  \vcenter{\color{red}\hrule  height1.319em width0.4pt}%
  \bigr#1%
  \vcenter{\color{blue}\hrule height1.647em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height1.975em width0.4pt}%
  \Bigr#1%
  \vcenter{\color{blue}\hrule height2.303em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height2.631em width0.4pt}%
  \biggr#1%
  \vcenter{\color{blue}\hrule height2.959em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height3.287em width0.4pt}%
  \Biggr#1%
  \vcenter{\color{blue}\hrule height3.615em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height3.943em width0.4pt}%
  \vastr#1%
  \vcenter{\color{blue}\hrule height4.271em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height4.599em width0.4pt}%
  \Vastr#1%
  \vcenter{\color{blue}\hrule height4.927em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height5.255em width0.4pt}%
  \VASTr#1%
  \vcenter{\color{blue}\hrule height5.583em width0.4pt}\,%
  \vcenter{\color{red}\hrule  height5.912em width0.4pt}%
  \VASTTr#1%
}
\delimiterfactor=945\relax % need to be > 1000*5.583/5.912
\parindent=0pt\relax
\begin{document}
$\testbig)$
$\testbig\rangle$
$\testbig\}$\par
Note:\par
1.\ Normal size is shown (black).\par
2.\ Only ext.\ sizes~1, 3, 5, \dots, 15 (red) are shown.\par
3.\ Too many intermediate sizes (blue), causing\\
\verb|\delimiterfactor=945| must be issued.
\end{document}

gh

Some incorrectly mapped characters

First of all, congratulations on Fira Math appearing in the newest unimath-symbols.pdf since v0.8n of unicode-math!!!

I glanced through that comprehensive list provided by unimath-symbols.pdf and found 4 incorrectly mapped characters so far:

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{[FiraMath-Regular.otf]}[version=F]% either v0.3.1 or v0.4-beta-2
\setmathfont{latinmodern-math.otf}[version=L]
\setmathfont{texgyrepagella-math.otf}[version=P]
\setmathfont{STIX2Math.otf}[version=S]
\newcommand*\compare[1]{%
  \texttt{\string#1} &
  \mathversion{F}$#1$ &
  \mathversion{L}$#1$ &
  \mathversion{P}$#1$ &
  \mathversion{S}$#1$%
}
\renewcommand*\arraystretch{1.2}
\usepackage{array}
\begin{document}
\begin{tabular}{>{\ttfamily}llllll}
USV & Command name & F & L & P & S \\
\hline
U+025DE & \compare\lrarc \\
U+025DF & \compare\llarc \\
U+021CB & \compare\leftrightharpoons \\
U+021CC & \compare\rightleftharpoons \\
\end{tabular}
\end{document}

ppp

An update to the CTAN version (without multiple weights if they are not ready) would be great.

Make some math operators monospaced

Some math operators should be monospaced because of the requirement for alignment in formulae. Note that not all the binary/relation characters should be monospaced, e.g. need to be longer than < (at least in Fira Math).

See #39.

Bold version

Using the FiraMath-Bold I'll get with

\documentclass[border=5mm,preview,varwidth]{standalone}
\usepackage{amsmath}
\usepackage[no-math]{fontspec}
\usepackage[math-style=ISO,bold-style=ISO,mathrm=sym]{unicode-math}
\setsansfont{Fira Sans}
\setmathfont{FiraMath-Regular.otf}%
\setmathfont[version=bold]{FiraMath-Bold.otf}%
%\setmathfont[version=bold]{FiraMath-Bold2.otf}
\begin{document}
\[ \hat{f}(\omega) = \frac1{\sqrt{2\symup{\pi}}} \int\limits_{-\infty}^{+\infty} f(x) 
\symup{e}^{-\symup{i}\omega x} \sin(x)\, \symup dx \]

\boldmath
\[ \hat{f}(\omega) = \frac1{\sqrt{2\symup{\pi}}} \int\limits_{-\infty}^{+\infty} f(x) 
\symup{e}^{-\symup{i}\omega x} \sin(x) \,\symup dx \]
\end{document}

bildschirmfoto vom 2018-06-30 10-57-04

Creating a bold version from the FiraMath-Regular by changing the weight and saving it as [FiraMath-Bold2.otf](http://archiv.dante.de/~herbert/FiraMath-Bold2.otf) I'll get

bildschirmfoto vom 2018-06-30 10-57-35

IS this the intended behaviour of your bold version?

Enhancement of the python script

Something need to do:

  • Optimize metric (see @YuanshengZhao's MassCalc.ipynb in Garamond Math)
  • Update MATH contants and vertical/horizontal variants and constructions via FontForge's interface
  • Overlap and round before building
  • Check/validate/test after building
  • Re-implement of braces_interpolate
  • Put common functions/constants etc into something like utils.py _common.py

Issues related to multiple weights

I have merged weights branch into master, but there are still numerous problems. If you have found any problems (except for the known issues listed below), please comment here.

Known issues:

  • Only few of the basic glyphs have been created. I need some time to cover them.
  • Interpolated points are not rounded to integer, and overlapped paths are not removed.
  • Now the metrics are just from the original FiraGO/FiraSans, but should be modified for math.
  • For primes, ssty2 is identical to ssty1. See latex3/unicode-math#503.
  • Mathematical Capital Theta Symbols are not correct.

More delimiters

Both normal and large version

  • Parenthesis
  • Flattened parenthesis
  • Square bracket
  • Curly bracket
  • Angle, double angle
  • Vertical line, double/triple vertical line
  • Floor, ceiling
  • Curly bracket section ,
  • Tortoise shell bracket ,
  • White parenthesis ,
  • white square bracket ,
  • White curly bracket ,
  • White tortoise shell bracket ,
  • Image bracket ,
  • Binding bracket ,
  • Square/cube/fourth root

Only normal version

  • Corners

Real Math Italic?

This is probably asking too much from an open-source project, but I think it is worth mentioning nonetheless.

Professional math fonts seem to set their math italic slightly different from the corresponding text italic. To quote from the designer of the (expensive) Minion Math:

… with a real Math Italic alphabet (wider than Text Italic, and with special kerning).

For an extended read, please refer to Fonts for Mathematics (PDF), Minion Math — The Design of a New Math Font Family (YouTube) and Is there a perfect maths font?.

Examples

I have collected 3 examples reflecting the above claim. Unfortunately, the TeX Gyre collection does not follow this design guide AFAICT. In the following pictures, text italics are in red, math italics are in blue.

cm
Computer Modern Italic versus Computer Modern Math Italic

times
Times New Roman Italic versus MathTime Professional 2

stix2
STIX2 Text Italic versus STIX2 Math Italic

Light Version

A light version would be useful, particularly for use with Metropolis theme, which uses Fira Sans Light.

More glyphs

  • \hbar
  • \propto
  • extensible arrows
  • arrows
  • \parallel, perp
  • \in, \ni
  • \mathbb
  • \mathcal
  • stylistic set for 1 and 4
  • large root
  • \bigcup

Inconsistent horizontal advances for hyphens

There is inconsistency within the four hyphens:

Unicode Horizontal advance
U+002D 403
U+00AD 403
U+2010 327
U+2011 327

Please consider fixing U+2010 and U+2011 so that their horizontal advances are also 403.

Possibly wrong mapping of characters in OpenType output

I haven't looked into any source file yet, just had a test in MS Word. It seems that for italic characters the following three glyphs are mapped to wrong places:

"\varepsilon" 1D716
"\phi" 1D719
"\varrho" 1D71A

Hope they could be corrected.

OTF-v0.2: wrong intersection behavior in \oint, \oiint and \oiiint

Nice to see these new characters implemented, however there are problems related with them.

Please see the screenshot below for details. The problem is found in the v0.2 OTF release.
intersect

This problem also seem to exist in the arrows with a slash (U+219A, U+219B, U+21AE).

More big operators

Summation, product, etc.

  • Sum
  • Prod
  • Coprod
  • Mathbb sum
  • Wedge
  • Vee
  • Cap
  • Cup
  • Square-cap
  • Square-cup
  • O-dot
  • O-plus
  • O-times
  • Cup-dot
  • Cup-plus
  • Solidus
  • Reverse solidus
  • Up tack
  • Down tack
  • Times

Integrals

  • \int
  • \iint
  • \iiint
  • \iiiint
  • \oint
  • \oiint
  • \oiiint
  • (Anti-)clockwise integral
  • (Anti-)clockwise contour integral
  • Integral with overbar/underbar

  • Consider to modify the shape of integrals

The \mid glyph, and strange behavior of : and \colon

According to Issue 2, \parallel is not yet available (as of today), and neither is \mid. However, according to fontdef.dtx:

\DeclareMathSymbol{\parallel}{\mathrel}{symbols}{"6B}
\DeclareMathSymbol{\mid}{\mathrel}{symbols}{"6A}
\DeclareMathDelimiter{\Vert}
   {\mathord}{symbols}{"6B}{largesymbols}{"0D}
\DeclareMathDelimiter{\vert}
   {\mathord}{symbols}{"6A}{largesymbols}{"0C}

suggesting that the \parallel and \mid commands point to the same corresponding glyph of \Vert and \vert, respectively. Nevertheless, using unicode-math yields missing glyph. Is it possible to simply “steal” the existing glyph of \Vert and \vert, and be done with \parallel and \mid?

Furthermore, it seems that : and \colon won’t show up unless one specifies option colon=literal to the package unicode-math. But colon=literal changes the spacing of :.

% Compiled with XeLaTeX or LuaLaTeX
\documentclass{article}
\usepackage{amsmath}
\let\amsmathcolon\colon
\usepackage[sfdefault]{FiraSans}
\usepackage[mathrm=sym]{unicode-math}% colon=literal
\setmathfont{Fira Math}% FiraMath v0.2.2
\renewcommand*\colon{\mathpunct{:}}

\begin{document}
$a : b$, $a \amsmathcolon b$, $a \mid b$, $a \parallel b$

$a : b$, $a \colon b$, $a \mathrel{\vert} b$, $a \mathrel{\Vert} b$
\end{document}

Output for default colon behavior or colon=TeX:

colon=TeX

Output for colon=literal:

colon=literal

Roadmap for multiple-weight

I think it's time to add more weights.

Weight Units CSS Bold weight Units CSS
Light 58 300 Regular 92 400
Regular 92 400 Bold 158 700
Medium 128 500 Heavy 198 900
Bold 158 700 Ultra 222 950

Something need to consider:

  • Whether the bold weights are suitable (mathbf, e.g. for vectors and matrices)?
  • Are these four weights enough?
  • Should I add the condensed version (in FiraSans, but not in FiraGO)?

root \sqrt

Look for the a in the root:

bildschirmfoto vom 2018-06-26 14-11-36

\listfiles
\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{FIRA Math}
\begin{document}
	$xy \sqrt[a]{b}$
\end{document}

up-to-date TL2018 and FIRA Math

*File List*
standalone.cls    2018/03/26 v1.3a Class to compile TeX sub-files standalone
shellesc.sty    2016/06/07 v0.02a unified shell escape interface for LaTeX
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
   ifpdf.sty    2017/03/15 v3.2 Provides the ifpdf switch
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
standalone.cfg    2018/03/26 v1.3a Default configuration file for 'standalone' c
lass
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
luatex85.sty    2016/06/15 v1.4 pdftex aliases for luatex
pdftexcmds.sty    2018/01/30 v0.27 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
unicode-math.sty    2018/02/02 vv0.8l Unicode maths in XeLaTeX and LuaLaTeX
   expl3.sty    2018-06-14 L3 programming layer (loader) 
expl3-code.tex    2018-06-14 L3 programming layer 
l3pdfmode.def    2018-06-14 v L3 Experimental driver: PDF mode
unicode-math-luatex.sty    2018/02/02 vv0.8l Unicode maths in XeLaTeX and LuaLaT
eX
  xparse.sty    2018-05-12 L3 Experimental document command parser
l3keys2e.sty    2018-05-12 LaTeX2e option processing using LaTeX3 keys
fontspec.sty    2017/11/09 v2.6g Font selection for XeLaTeX and LuaLaTeX
fontspec-luatex.sty    2017/11/09 v2.6g Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
   tuenc.def    2017/04/05 v2.0i Standard LaTeX file
fontspec.cfg
filehook.sty    2011/10/12 v0.5d Hooks for input files
  fix-cm.sty    2015/01/14 v1.1t fixes to LaTeX
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
lualatex-math.sty    2017/06/15 v1.7 Patches for mathematics typesetting with Lu
aLaTeX
etoolbox.sty 

Pi and Tau enhancements

I think the Tau and Pi small letter could be much more legible with this harmonious modifications.
Latter, I will propose enhancements on the others Greek letters.
pi and tau 2

\circ glyph is missing

Firamath does not provide a character for \circ. See the following example:

\listfiles
\documentclass{article}
\usepackage{amsmath}
\usepackage[mathrm=sym]{unicode-math}
\setmathfont{Fira Math}

\begin{document}
\Huge
20\,${}^{\circ}$C
\end{document}

...Rolf

Variable font support

Since I have been working on the multiple weight family of Fira Math, is there any possibility to create a variable font based on this family?

The main difficulties are:

  1. I don't know whether OpenType MATH table is compatible with variable fonts or not.
  2. At present, it seems no TeX engine can support variable fonts, see https://tex.stackexchange.com/q/355104.
  3. FontForge does not support it.

However, I still think it important and valuable to create an (experimental) variable math font first. At least, the TeX implementation will need a real typeface to test.

Some references:

  1. OpenType font variations - Typography | Microsoft Docs
  2. The Typekit Blog | Variable fonts, a new kind of font for flexible design
  3. Introducing OpenType Variable Fonts – VariableFonts.io – Medium
  4. Adobe Variable Font Prototype
  5. I Can Variable Font

Related issues:

  1. Support for OpenType Variable Fonts - latex3/fontspec#321

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.