Coder Social home page Coder Social logo

githubnext / monaspace Goto Github PK

View Code? Open in Web Editor NEW
12.4K 51.0 205.0 185.53 MB

An innovative superfamily of fonts for code

Home Page: https://monaspace.githubnext.com

License: SIL Open Font License 1.1

TypeScript 75.99% Shell 24.01%
font fonts monospace monospaced typography

monaspace's Introduction

Monaspace

The Monaspace type system is a monospaced type superfamily with some modern tricks up its sleeve. It consists of five variable axis typefaces. Each one has a distinct voice, but they are all metrics-compatible with one another, allowing you to mix and match them for a more expressive typographical palette.

Letters on a grid is how we see our code. Why not make those letters better?

✨ An exploration from GitHub Next. ✨ See the full story of Monaspace at monaspace.githubnext.com.

🔤 Download the latest release 🔤

image

Overview

Monaspace is available as a variable-axis font and a static build. You can install them both side-by-side; their family names are distinct. For example:

  • Monaspace _____: the static family
  • Monaspace _____ Var or VF: the variable family

The variable fonts have one file per family (Neon, Argon, etc.). Modern and convenient!

The static fonts have one file per cut, per family. The variable axes have named stops for each axis, like light or bold for weight, italic for italics, and semiwide or wide for width. The combinatorial explosion of all these properties means the complete installation of static fonts involves hundreds of font files. But for situations that don't yet support variable fonts, the static builds give you a wide variety of stops throughout the range of each axis.

Coding Ligatures

There are eight groups of coding ligatures, separated into stylistic sets. You may be able to enable or disable individual sets selectively:

  • ss01: ligatures related to the equals glyph like != and ===.
  • ss02: ligatures related to the greater than or less than operators.
  • ss03: ligatures related to arrows like -> and =>.
  • ss04: ligatures related to markup, like </ and />.
  • ss05: ligatures related to the F# programming language, like |>.
  • ss06: ligatures related to repeated uses of # such as ## or ###.
  • ss07: ligatures related to the asterisk like ***.
  • ss08: ligatures related to combinations like .= or .-.

You must enable discretionary ligatures first, often using the dlig setting. See below for editor-specific instructions.

A visual glossary of code ligatures available in the Monaspace type system

Desktop Installation

MacOS

You can manually drag the fonts from the fonts/otf or fonts/variable directory into Font Book.

There is also a script that automates the deletion of all Monaspace fonts from ~/Library/Fonts and then copies over the latest versions. Invoke it from the root of the repo like:

$ cd util
$ bash ./install_macos.sh

You can also use homebrew as an alternative:

brew tap homebrew/cask-fonts
brew install font-monaspace

Windows

You can manually drag the fonts from the fonts/otf or fonts/variable directory into C:\Windows\Fonts. Alternatively, right-click the fonts you want and click Install.

Linux

You can manually drag the fonts from the fonts/otf and fonts/variable directory into ~/.local/share/fonts.

There is also a script which automates the deletion of all Monaspace fonts from ~/.local/share/fonts and then copies over the latest versions. Invoke it from the root of the repo like:

$ cd util
$ bash ./install_linux.sh

Webfonts

All files with a .woff or .woff2 suffix are intended for use on the web. You do not install them with your operating system but add them to your web development project.

As with the desktop fonts, they are available in variable and static versions.

Editors

Visual Studio Code

Set the font family:

    "editor.fontFamily": "'Monaspace Neon', monospace",

Note

Variable fonts are not yet well-supported in VS Code, and it is not yet possible to mix multiple fonts. Stay tuned, we're talking with the VS Code team about it!

The same setting controls texture healing and coding ligatures. You can enable either or both.

If you only want texture healing and basic coding ligatures, add the following line to your settings.json:

  "editor.fontLigatures": true,

Note

This setting is unavailable from the graphical settings editor; you must create it manually.

If you want more coding ligatures, you must customize that setting to specify all the sets you wish to enable:

  "editor.fontLigatures": "'calt', 'liga', 'dlig', 'ss01', 'ss02', ... (more stylistic sets) ...",

Note

You must start the setting with 'calt', 'liga', 'dlig'! The stylistic sets will only have an effect by enabling contextual alternates, ligatures, and discretionary ligatures.

If you want coding ligatures but do not want texture healing, you can omit the calt setting:

  "editor.fontLigatures": "'liga', 'dlig', 'ss01', 'ss02', ... (more stylistic sets) ...",

Contribution

There's no formal contribution guide yet! If you're interested in contributing to the typefaces, you should read the Texture Healing guide, as it explains how to produce the necessary alternate glyphs.

Renamer utility

This convenience utility renames and moves the built fonts into their respective directories. You will need Deno installed, and invoke it thus:

$ ./util/renamer.ts --src="~/path/to/the/built/fonts"

License

SIL OFL. See LICENSE.

Support

Please file issues in this repo. Monaspace is not a supported product; do not contact GitHub support with questions, as they do not support GitHub Next explorations.

Contributors

Monaspace was made to improve all code for all developers. GitHub Next set out on this journey in 2022, and we were fortunate to find a type foundry that shares our passion for improving software in Lettermatic. The result is a marriage of form and function that opens the door to new developer experiences, and that would not have been possible without the domain expertise and skill of the Lettermatic team and the time they invested in working with GitHub Next on figuring out how typography ought to work for code.

Lettermatic

lettermatic logo

GitHub Next

GitHub Next Logo

Special Thanks To

  • Anna Thomas
  • Marg Chronister
  • Jane Solomon

monaspace's People

Contributors

brunofin avatar colebemis avatar d4rk8l1tz avatar fabianbeiner avatar finii avatar idan avatar ivnvxd avatar jasonetco avatar juanrgon avatar ketozhang avatar krzysztof-cieslak avatar mheob avatar robwalkerco 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  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

monaspace's Issues

U+2123 VERSICLE should not be a font version number indicator

The glyph for U+2123 VERSICLE is a font version number indicator, currently “v1.000”. This violates the Unicode Standard’s conformance requirement about character identity. The glyph should instead be mapped to a private use character.

Ligature options change certain characters for no apparent reason

First off congrats on the release, really liking the fonts! I saw that the ligatures changed the checkmarks and crosses in my .todo files using the todo+ extension. I'm not sure if this is intended as the characters were not in the ligature list on the site.

Works: image (without ss03 without ss07)

Looks off: image (with ss03)

Looks off: image (with ss03 and ss07)

Here's the text:

@done(23-11-09 23:44)
@cancelled(23-11-09 23:44)

edit: there is an easy workaround if this is intended:

  "[todo]": {
    "editor.fontLigatures": ""
  },

Add ligature for `/**`

Monaspace offers a ligature for the character sequence /*, which looks good on its own, but when typing /** to start e.g. a Javadoc or JSDoc comment, only the first two characters get replaced by the ligature, the last asterisk remains unchanged and is now on a different height than the first one:

image

This does not look too aesthetically pleasing. Any chance we might find a ligature for the entire /** in a future version of Monaspace?

Add Nerd Fonts

Can the Nerd Fonts added so we can use these fonts in the terminals?

It would be amazing to have these type of Icons included!
image

Italic styles: make the vertical pipe character actually vertical

image

  • As you see, when italics are used the pipe looks awkward.
  • Vertical pipes are used in circumstances where they are supposed to sort of connect vertically, e.g. in ASCII tables
  • It's inconsistent with other orthogonal shapes, like dashes etc, which aren't tilted either
  • The vertical pipe may now be mistaken for a forward slash (this actually happened to me when someone else was reading code from my screen)

Proposal: Proportional variable font or custom axis

I've found that proportional typefaces (with variable widths rather than monospacing) are generally easier to read, even with code. However, proportional typefaces lack code specific features, like ligatures and differentiation.

I'm excited by Monaspace's texture healing feature, as it improves readability and reduces visual rivers in monospaced fonts. This could make it a great candidate for a variable font or custom axis that's spaced proportionally.

We should be able to start with default glyphs, and optionally use texture conflict data to adjust widths of glyphs dynamically, rather than replacing them with monospaced glyphs.

woff2 format

woff2 has better compression. I see that the variable typefaces have a woff2 version, but it would be nice if the individual fonts did as well.

Ligatures in PhpStorm

❤️ this project, thanks.

How we can use the ligatures in PhpStorm (the most used PHP IDE)?

Don't include docs images in the package download

First of all, thank you for a beautiful font family!

One small request though: Downloading 97MB of images together with fonts is rather unnecessary? I think it's enough to have the documentation examples online - no need to include it in the download zip.

Ability to prefer `!=` to `≠`

I know a lot of people really like as a replacement for !=, but I'm not among them. I was excited by the promise of turning off the ss01 stylistic set to avoid , but it didn't work because (I think, based on the table on https://monaspace.githubnext.com/) it's also included in the dlig stylistic set, most of which I do want.

I think my ideal setup would be a way to opt into a space-adjusted glyph that's the inverse of the very nice =!, but out of .

Website: Improved light theme support

The website appears to only be available in a dark theme, even on systems with a light theme preference, which can affect accessibility. Additionally, the code samples can only be displayed in the dark variants of the Atom One and VS Code themes, which support light variants upstream.

Add Ruby code preview to website

I want to see how it looks with Ruby source code.

image

Feel free to use this snippet:

class Person
 attr_accessor :name, :age

 def initialize(name, age)
   @name = name
   @age += age
 end

 def ==(other)
   @name == other.name && @age == other.age
 end

 def <=>(other)
   @age <=> other.age
 end

 def !~(other)
   @name !~ other.name || @age != other.age
 end

 def =~(other)
   @name =~ other.name && @age == other.age
 end

 def <<(other)
   @name << other.name
 end

 def >>(other)
   @age >> other.age
 end

 def **(other)
   @age ** other.age
 end

 def &&(other)
   @name && other.name && @age && other.age
 end

 def ||(other)
   @name || other.name || @age || other.age
 end
end

alice = Person.new("Alice", 30)
bob = Person.new("Bob", 35)

puts alice == bob # => false
puts alice <=> bob # => -1
puts alice !~ bob # => true
puts alice =~ bob # => false
puts alice << bob # => "AliceBob"
puts alice >> bob # => 30
puts alice ** bob # => 9000000000000000
puts alice && bob # => true
puts alice || bob # => true

Mix & Match in VS Code?

I really like the examples shown in the Mix & Match section, using different font families for comments, Copilot suggestions etc.:

As I understand it from microsoft/vscode#36512, this is not yet reproducable in VS Code. Are there any plans to support that soon, perhaps via plug-in or by discussing support with the VS Code maintainers directly?

No slashed zero?

This is a glaring omission for an otherwise amazing set of typefaces.

Add ligature for >>=

>>= is a popular operator used in the Haskell and Haskell inspired programming languages, although not as popular as other languages they still occupy a space in functional programming

Right now monaspace turns >= to a ligature, and >>= looks like >≥ which looks ugly in my opinion

Maybe a future version of the font could have the >>= ligature?

Fonts not selectable in gvim/gtk+

gvim under Linux only lets you select fonts that have the monospace flag set in the truetype header.
These fonts don't. So I can't select them in my editor of choice.

Please set the monospace flag in the header!

Font properties cause glyphs to sit strangely in many terminals

Congratulations on the launch.

I'm developing a terminal emulator so whenever any monospace font is released, the first thing I do is jump on it and see how it all looks. I was especially interested because all the features Monaspace uses (variation axes, opentype features, etc.) are supported by my terminal so I wanted to make sure everything looked good. I immediately noticed that things looked weird, and then loaded the font in a variety of other terminals and verified they look a bit weird in all of them.

Some background (you may be aware of this): terminal emulators in particular aim to fit glyphs into a cell. Descenders do not typically descend below what is traditionally the baseline. Instead, the baseline is adjusted so that descenders at most touch the bottom of the cell. For example, in a typical typesetting situation, the bottom of the "g" hangs below the line into the next line. In a terminal, the "g" sits at the bottom of the cell, but does not typically enter the cell below it.

The way these metrics are calculated somewhat varies between terminals, but a common algorithm is:

cell_height = ascent + descent + leading
cell_baseline = descent + leading

where ascent, descent, and leading are directly from the font face.

If you look at a number of popular terminal emulators (macOS in this case, but similar things happen on Linux), this causes the glyphs to sit high in the cell. I've chosen two extremely popular terminal emulators as examples below, but I'm not trying to pick on them, this happens also in other terminals:

Kitty

image

iTerm2

image

There are various rendering artifacts but just focus where glyphs sit (since the other issues are likely not caused by monaspace). Notice that the top of the "h" is touching the top of the cell. The lowest part of the "y" descender is sitting quite high in the cell as well. The "N" is well above the midline because the baseline is so high.

I'm not 100% sure this is your fault, but each of these terminals use slightly different algorithms for calculating cell metrics and these algorithms work across hundreds of other known monospace fonts of varying popularity, but seem to have issues with Monaspace. So I wanted to raise this issue and perhaps discuss what can be done to help make Monaspace work better with these terminal projects.

Thanks!

Special case for double letters

Some words that contain double letters look odd due to the texture healing. One example is the word "Humming". The two letters 'm' have a different width and one of them looks squished. Maybe do not do texture healing if it is a double letter?

You can see what I mean here:

Screenshot from 2023-11-10 14-18-40

Website is too wide on desktop, causing horizontal scroll

Description:

On the Monaspace website when viewed on desktop, the webpage is too wide, resulting in an undesirable horizontal scroll. This issue caused by elements styled with the 100wv value, which can be replaced with 100% to prevent horizontal scrolling.
Screenshots of the places that caused this issue attached.

Steps to Reproduce:

  1. Access the website on a desktop browser.
  2. Observe the horizontal scroll appearing due to the width styling.

Expected Behavior:

The webpage should not have a horizontal scroll on desktop view. Adjusting the styling from 100wv to 100% should resolve this issue.

Additional Information:

Browser: Google Chrome Version 119.0.6045.124 (Official Build) (64-bit)
Operating System: Windows 11 Pro x64 22H2

image
image
image

Hyphen, minus sign and en dash are indistinguishable

I would expect that the font provides a clear distinction between - (U+002D HYPHEN-MINUS), − (U+2212 MINUS SIGN), – (U+2013 EN DASH), and — (U+2014 EM DASH). The screenshot shows that the first three of these glyphs look identical.

image

Support more Unicode code points

It would be helpful to support more Unicode code points. My specific needs would be for combining diacritics.

I write a lot of scripts that use them in strings.

The fonts look great!

some problems on jetbrains suites.

  1. the quality font on phpstorm is a little bit bad
  2. the ligatures does not work

image
Here, as you can see i have ligatures actived and does not work

image
Here the font does not look well!

Fontfamily not activating in VSCode?

So I first followed the readme, for MACOSX & ran the bash file.
Then verified if I have all the fonts in Font Book -> they are there.

Using the following options in VSCODE:

"editor.fontLigatures": true,
"editor.fontFamily": "Monaspace, Arial, serif", // for testing

Also tried with the Monaspace _____

Result

Seeing Arial being used in the editor... Is there something that I'm missing?

Thanks in advance!

Mix & Match? 😢

Hello!

This is somehow related to #6 but I would like to ask for a more generic one, I know some monospaced fonts are capable of mixing standard monospaced and handwritten style when the text is in comment block (probably they just change the italic variant?).

Could be build monaspace to allow that?
In my specific case, I would like to Argon for my code and Radon for my comments 🙏

Thanks for your awesome work ❤️

Enhanced Italics

Can Italics be extended to accommodate:

  • Italics within italics and
  • Italics within italics within italics
  • Left slanting italics
  • etc.

Texture Healing should consider whitespace and various narrow symbols

I really like the “texture healing” feature. I don't know if contextual alternates allow us to alter the glyphs based on the whitespace symbols nearby, but if it is possible, that would be a very logical thing to do.

An example:

A screenshot of 4 lines of text that have “M” and “i” letters near it in different combinations, showing how “M” surrounded by the whitespace is narrower than when surrounded by “i”s.

Here we can see that the “M” by itself with the whitespace around it is narrower than the other Ms.

Columns don't align properly under all circumstances

Font does not always render properly for me. Seems to depend on family/size/settings used, but is very obnoxious. This is with Radon at size 14, weight 600:
image

Now a normal monospace font (Hack):
image

It also happens on the demo website (all default settings):
image

It doesn't happen for other users I talked to, so it may be an OS issue or something.
I'm using VSCodium 1.84.0 on Kubuntu 23.04

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.