stipub / stixfonts

OpenType Unicode fonts for Scientific, Technical, and Mathematical texts
SIL Open Font License 1.1
686 stars 41 forks source link

doc: suggest sans and monospace fonts to pair with STIX Two #228

Open mdeff opened 2 years ago

mdeff commented 2 years ago

Per the README:

The STIX fonts do not contain fixed-width or sans serif text faces.

While I understand the project's scope has to be limited, monospace is heavily used in scientific/technical/mathematical writing for code snippets, and sans serif is used for slides and posters (some authors also use it for headings).

Which sans and monospace fonts would you recommend to pair with STIX Two? That question has been asked on Tex Stack Exchange too. It would be useful to provide an authoritative answer on the README.

I believe it should be something that works well with the sans and monospace glyphs in the unicode plane 1 used for math. (Unlike #161, I am of the opinion that math and text should blend seamlessly.)

tiroj commented 2 years ago

The recent versions of STIX Two Text use a new set of plane 1 math alphanumeric sans serif glyphs (both Latin and Greek), which are derived from Source Sans, an interpretation of the Benton Gothic style designed by Paul Hunt and published under the Open Font License by Adobe. So that would be my first choice for a sans serif companion to STIX Two. Note that you won’t get a perfect match from any of the Source Sans fonts to the STIX Two Math sans style, because the latter were interpolated between the Source Sans weights and also scaled and had their extender lengths adjusted to match those of other alphanumeric sets in STIX Two.

The monospaced math alphanumeric style in STIX Two Math is a new design by my colleague Paul Hanslow. I asked him to make something in the older typewriter slab-and-ball style, à la Courier, as this was identied in STI Pub feedback as the common understanding of monospaced in a math context. Indeed, I would argue that the style would be better referred to as typewriter, since it is the character of the design that is important in the math setting, not the fixed-width, monospace nature. If you look closely, you’ll note that the STIX Two Math ‘monospace’ caps are actually slightly wider than the lowercase.

If looking for an actual monospace font to use for code alongside STIX Two, I would probably lean towards David Jonathan Ross’ Input Mono. It performs strongly, as a modern font designed specifically for coding, rather than just a re-worked typewriter face, but stylistically has some old-fashioned characteristics that fit well with STIX Two.

xsrvmy commented 2 years ago

Should note that input mono is not free for distributing documents.

If your are on latex, LM's mono font is already pretty similar, but you need to match the X height.

vladislavivanistsev commented 1 year ago

https://github.com/adobe-fonts/source-sans

JimEBlevins commented 1 year ago

If looking for an actual monospace font to use for code alongside STIX Two, I would probably lean towards David Jonathan Ross’ Input Mono. It performs strongly, as a modern font designed specifically for coding, rather than just a re-worked typewriter face, but stylistically has some old-fashioned characteristics that fit well with STIX Two.

STIX Two Math's regular monotype font (accessed via $mathtt{}$) [error deleted, thanks to the comment below.]

These encapsolated fonts may be useful for displaying mutually orthogonal Latin squares.

miccoli commented 1 year ago

STIX Two Math's regular monotype font (accessed via $mathtt{}$)

OT, but maybe useful for LaTeX users.

If unicode-math is loaded without options, then $\mathtt{}$ will pick the text mono font, not the math one, which is instead selected with $\symtt{}$. From the unicode-math docs:

The five new symbol font commands that behave in this way are: \symup, \symit, \symbf, \symsf, and \symtt. These commands switch to single-letter mathematical symbols (generally within the same OpenType font). The legacy \math.. commands switch to text fonts that are set up to behave correctly in mathematics, and should be used for multi-letter identifiers.

This is another reason for having visually matching text and math monospaced fonts: compare x_{\mathtt{start}} vs x_{\symtt{s}} (where subscript word is in Latin Modern and subscript symbol is in STIX Two Math)

sandbox

sandbox.pdf

LaTeX source of the above example ``` \documentclass{minimal} \usepackage{amsmath} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \begin{document} \[ x_{\mathtt{start}} \; x_{\symtt{s}} \] \end{document} ```
JimEBlevins commented 1 year ago

My excerpt added some emboldening and hyphenation:

The recent versions of STIX Two Text use a new set of plane 1 math alphanumeric sans-serif glyphs (both Latin and Greek), which are derived from Source Sans [... , JB]. So that would be my first choice for a sans-serif companion to STIX Two. [...., JB]

The monospaced math alphanumeric style in STIX Two Math is a new design by my colleague Paul Hanslow. I asked him to make something in the older typewriter slab-and-ball style, à la Courier, as this was identied in STI Pub feedback as the common understanding of monospaced in a math context. Indeed, I would argue that the style would be better referred to as typewriter, since it is the character of the design that is important in the math setting, not the fixed-width, monospace nature. If you look closely, you’ll note that the STIX Two Math ‘monospace’ caps are actually slightly wider than the lowercase.

If looking for an actual monospace font to use for code alongside STIX Two, I would probably lean towards David Jonathan Ross’ Input Mono. It performs strongly, as a modern font designed specifically for coding, rather than just a re-worked typewriter face, but stylistically has some old-fashioned characteristics that fit well with STIX Two.

Dear Tiroj:

Thanks again for your informative response.

DJR's Input famiiy has Mono, Serif, and Sans typefaces. Input Serif font has slab-serif proportional typewriter features; Input Mono has fixed widths (naturally), suiting programming and program-documentation (e.g., algorithm specification). Each student may obtain a license for academic work, including one public document (e.g., the thesis) freely; for non-students, low-cost pricing plans are available from DJR.

As no-cost alternatives to the renowned Input fonts, I suggest the following fonts, which are SIL-Open Font Licensed (SIL-OFL):

I enclose a screenshot of examples of the fonts mentioned:

Screenshot_20230116_115645

For the math fonts, explicit spaces prevent the concatenation of all the characters (into one illegible string).

Curiously, explicit spaces are not needed for the mathematics font of STIX Two Math for small-caps. I post examples of the small caps available (for the fonts discussed):

Screenshot_20230116_115903

(I removed some details of LaTeX::fontspec usage, which I had previously posted.)

Firestar-Reimu commented 1 year ago

Me too: Suggest sans and monospace fonts to pair with STIX Two

for sans-serif Math fonts you can see Fira Math and Noto Sans Math, or you can design a typeface like Linux Biolinum

vladislavivanistsev commented 9 months ago

Similarly to the post above, I also see that Zilla Slab fits STIX two, whether Source Sans is better suited to Times New Roman/Libertinus. Some more thought are here https://doublelayer.eu/vilab/2023/09/15/fonts-for-grant-proposals/

image-2

JimEBlevins commented 9 months ago

The excellent Input Mono font is less slab-seriffed than Luxi Mono, which is however heavier ("darker color") than the slab-serif monospace of STIX Two Math. (Luxi Mono was developed by Kris Holmes and Charles Bigelow, and it may be freely redistributed.)

To my amateur eyes, IBM Plex Mono is nearly as good a match as Input Mono (being nearly the same in color and in slab-seriffing).

Thanks to the pointer to your interesting blog. Times and Arial/Helvetica are part of the PDF standard. Their mandatory use is unlikely to change until administrators overcome fears of any disruption of