Code Monkey home page Code Monkey logo

Comments (11)

stone-zeng avatar stone-zeng commented on June 22, 2024 2

I hope this is what you want:

image

The code can be found in test/font-test.tex.

from firamath.

stone-zeng avatar stone-zeng commented on June 22, 2024 1

Still I need to point out that, the tabular numbers in Fira Sans do look like that in Fira Mono, but they are actually not exactly identical (you may check the paths and points' position). Whether 1 has serif or not and whether 4 is closed or open, are both determined by the original design of Fira Sans.

You may try the following code, and I never use Fira Mono here:

\documentclass{article}
\usepackage{fontspec}
\setsansfont{FiraSans-Regular.otf}

\begin{document}
\sffamily

\verb|default   | 0123456789 \par
\verb|lnum      | {\addfontfeature{Numbers=Lining} 0123456789} \par
\verb|onum      | {\addfontfeature{Numbers=OldStyle} 0123456789} \par
\verb|pnum      | {\addfontfeature{Numbers=Proportional} 0123456789} \par
\verb|tnum      | {\addfontfeature{Numbers=Monospaced} 0123456789} \par
\verb|lnum+pnum | {\addfontfeature{Numbers=Lining,Numbers=Proportional} 0123456789} \par
\verb|onum+pnum | {\addfontfeature{Numbers=OldStyle,Numbers=Proportional} 0123456789} \par
\verb|lnum+tnum | {\addfontfeature{Numbers=Lining,Numbers=Monospaced} 0123456789} \par
\verb|onum+tnum | {\addfontfeature{Numbers=OldStyle,Numbers=Monospaced} 0123456789}

\end{document}

image

Anyway, I can add both serif/sans serif 1 and closed/open 4 as different stylistic sets.

from firamath.

stone-zeng avatar stone-zeng commented on June 22, 2024

I don't think that using mono-spaced (or tabular) numbers in math mode is a good choice. But I can still add this feature, as well as the old style and tabular old style numbers.

By the way, FiraSans already has tabular numbers, and it looks like FiraMono (e.g. 1 has a serif), but not Fira Mono.

from firamath.

sunnyssk avatar sunnyssk commented on June 22, 2024

As far as I notice, in MS Word, other math fonts like Latin Modern Math, Libertinus Math and Cambria Math all use monospaced numbers by default (in and out of math mode), and for LM Math the width is of exactly 1 \ensp, which makes them easy to be aligned in column. I do not know the details of the mapping, or whether it has something to do with the serif font style, but it seems not a bad idea to have monospaced numbers in math font by default?

from firamath.

hvoss49 avatar hvoss49 commented on June 22, 2024

from firamath.

stone-zeng avatar stone-zeng commented on June 22, 2024

Have checked several fonts. I will make the numbers to be mono-spaced by default then.

from firamath.

RuixiZhang42 avatar RuixiZhang42 commented on June 22, 2024

Thank you for all the positive comments!

To clarify my original post, I was suggesting adjusting the bounding width (not the font). Right now, text tabular figures (old style and lining) are Fira Mono, while text proportional figures (old style and lining) are Fira Sans. IMHO, making mono-spaced math figures by changing figures to Fira Mono look-alike is a bad idea (e.g., the serif 1 in a sans font). The glyphs should stay the same except for their widths.

from firamath.

RuixiZhang42 avatar RuixiZhang42 commented on June 22, 2024

This is more than perfect! I noticed the extra effort made to guarantee that bold figures share the same width with the regular ones.

Is the decimal point . (or , in some other countries) in regular and bold weights of the same width too?

from firamath.

stone-zeng avatar stone-zeng commented on June 22, 2024

In Fira Math, period and . comma , have the same width (240/1000 em), but not the same as digits (560/1000 em). They do not have bold version (I mean in fira-math-regular).

In XITS Math and Latin Modern Math, the width of . and , is exactly one half of the digits, but I think it's more likely to be a design, rather than a convention or a standard.

from firamath.

RuixiZhang42 avatar RuixiZhang42 commented on June 22, 2024

Thank you for the detailed explanation. I absolutely agree that it’s a matter of design. It doesn’t matter if . and , are of the same width with the digits, as long as they are consistent. You may want to make bold . and bold , to be 240/1000 em wide (in future releases like FiraMath-Bold).

from firamath.

bwiernik avatar bwiernik commented on June 22, 2024

I did not check the widths, but it would also be nice if mid space (U+2005) [or thin space (U+2009)] and narrow no-break space (U+202F) were also the same width and . and , to ensure consistency if the SI-standard space is used as a digit-group separator rather than . or ,.

from firamath.

Related Issues (20)

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.