Convert Figma logo to code with AI

googlefonts logoInconsolata

Development repo of Inconsolata Fonts by Raph Levien

1,342
62
1,342
48

Top Related Projects

76,660

Free monospaced font with programming ligatures

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.

Monospaced font family for user interface and coding environments

JetBrains Mono – the free and open-source typeface for developers

18,991

Versatile typeface for code, from code.

9,552

The package of IBM’s typeface, IBM Plex.

Quick Overview

Inconsolata is a monospace font designed for printed code listings and the like. It's an open-source font project hosted on GitHub, created by Raph Levien and further developed by the Google Fonts team. The font is designed to be highly readable and suitable for coding and terminal use.

Pros

  • Clean and highly readable monospace design
  • Supports a wide range of characters and languages
  • Open-source and freely available for use
  • Regularly updated and maintained by the Google Fonts team

Cons

  • Limited style variations compared to some other coding fonts
  • May not be ideal for all coding environments or personal preferences
  • Some users report issues with certain characters in specific IDEs
  • Requires manual installation on some systems that don't include it by default

Getting Started

To use Inconsolata in your projects:

  1. Visit the Google Fonts page for Inconsolata
  2. Select the styles you want to use
  3. Copy the provided HTML link or CSS @import code
  4. Paste the code into your HTML file's <head> section or CSS file
  5. Use the font in your CSS by specifying font-family: 'Inconsolata', monospace;

Alternatively, you can download the font files directly from the GitHub repository and install them on your system.

For web projects, you can include Inconsolata using Google Fonts API:

<link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap" rel="stylesheet">

Then use it in your CSS:

body {
  font-family: 'Inconsolata', monospace;
}

For local installation, download the .ttf files from the repository and install them on your system. The method varies depending on your operating system.

Competitor Comparisons

76,660

Free monospaced font with programming ligatures

Pros of FiraCode

  • Offers ligatures for common programming symbols, enhancing code readability
  • Includes a wider range of programming-specific glyphs and symbols
  • Actively maintained with frequent updates and improvements

Cons of FiraCode

  • Larger file size due to additional ligatures and glyphs
  • May not be suitable for environments where ligatures are not supported
  • Learning curve for developers not accustomed to ligature-based fonts

Code Comparison

Inconsolata:

if (x != y && z == 0) {
  return true;
}

FiraCode:

if (x != y && z == 0) {
  return true;
}

While the code appears identical, FiraCode would display ligatures for !=, &&, and ==, potentially improving readability.

Summary

FiraCode is designed specifically for programmers, offering ligatures and a wide range of programming symbols. It's actively maintained but has a larger file size. Inconsolata is a simpler, more traditional monospace font without ligatures, making it more versatile across different environments. The choice between the two depends on personal preference and the specific needs of the development environment.

This is a fun, new monospaced font that includes programming ligatures and is designed to enhance the modern look and feel of the Windows Terminal.

Pros of Cascadia Code

  • Includes ligatures for common programming symbols, enhancing code readability
  • Offers multiple weights and styles, including a variable font version
  • Designed specifically for modern coding environments and terminal use

Cons of Cascadia Code

  • Larger file size due to extensive character set and ligatures
  • May not render correctly in older text editors or systems
  • Relatively new, with potential for ongoing changes and updates

Code Comparison

Inconsolata:

def hello_world():
    print("Hello, World!")
    return None

Cascadia Code:

def hello_world():
    print("Hello, World!")
    return None

While the code appears identical, Cascadia Code would display ligatures for -> and => in actual use, potentially improving readability for some developers.

Additional Notes

Inconsolata is a more established monospace font with a simpler design, making it suitable for a wide range of environments. It has a smaller file size and broader compatibility.

Cascadia Code, developed by Microsoft, focuses on modern coding needs with features like ligatures and multiple weights. It's optimized for Windows Terminal and Visual Studio Code but may require more system resources.

Both fonts are open-source and freely available, with active development communities. The choice between them often comes down to personal preference and specific use case requirements.

Monospaced font family for user interface and coding environments

Pros of Source Code Pro

  • More extensive character set, including support for multiple languages and coding-specific symbols
  • Offers multiple weights and styles, providing greater flexibility for different use cases
  • Developed by Adobe, a company with a long history in typography and font design

Cons of Source Code Pro

  • Larger file size due to its extensive character set, which may impact load times
  • Some users find it less readable at smaller sizes compared to Inconsolata
  • Updates and maintenance may be less frequent than Inconsolata

Code Comparison

Inconsolata:

def hello_world():
    print("Hello, World!")

Source Code Pro:

def hello_world():
    print("Hello, World!")

While both fonts are monospaced and suitable for coding, Source Code Pro may offer slightly better distinction between similar characters (e.g., 'l' and '1', 'O' and '0') in some cases. However, the actual appearance and readability can vary depending on individual preferences and display settings.

JetBrains Mono – the free and open-source typeface for developers

Pros of JetBrainsMono

  • Designed specifically for coding with ligatures and improved readability
  • Wider range of supported characters and programming symbols
  • Regular updates and active development from JetBrains

Cons of JetBrainsMono

  • Larger file size due to extensive character set and ligatures
  • May not be suitable for all text editors or terminals
  • Some users find ligatures distracting or confusing

Code Comparison

Inconsolata:

function example() {
  return x => x * 2;
}

JetBrainsMono:

function example() {
  return x => x * 2;
}

The main difference in appearance would be the ligatures in JetBrainsMono, which would combine certain character pairs (e.g., => might appear as a single symbol). Inconsolata would display these characters separately.

Both fonts offer excellent readability for code, but JetBrainsMono provides additional features tailored specifically for programming. Inconsolata, being a more minimalist font, may be preferred by those who favor simplicity and smaller file sizes. The choice between the two often comes down to personal preference and specific use case requirements.

18,991

Versatile typeface for code, from code.

Pros of Iosevka

  • Highly customizable with numerous variants and weights
  • Supports a wide range of programming ligatures
  • Compact design, allowing more text to fit on screen

Cons of Iosevka

  • Requires compilation to generate font files
  • May have a steeper learning curve for customization
  • Less widespread adoption compared to Inconsolata

Code Comparison

Iosevka:

if (condition) {
    doSomething();
} else {
    doSomethingElse();
}

Inconsolata:

if (condition) {
    doSomething();
} else {
    doSomethingElse();
}

Both fonts provide clear and readable code representation. Iosevka's default style is slightly more condensed, potentially allowing more code to fit on a single line. Inconsolata offers a more traditional monospace appearance, which some developers may prefer for its familiarity.

Iosevka's customization options allow for fine-tuning of character shapes and ligatures, which can enhance code readability for some users. Inconsolata, being a more established font, offers a consistent experience across different environments without the need for additional configuration.

Ultimately, the choice between Iosevka and Inconsolata depends on personal preference and specific use cases, with Iosevka offering more flexibility and Inconsolata providing a more straightforward, widely-supported option.

9,552

The package of IBM’s typeface, IBM Plex.

Pros of Plex

  • Comprehensive font family with sans-serif, serif, and monospace variants
  • Extensive language support and Unicode coverage
  • Regular updates and active development

Cons of Plex

  • Larger file sizes due to the extensive character set
  • May require more system resources to render complex glyphs
  • Steeper learning curve for utilizing all font features

Code Comparison

Inconsolata:

body {
  font-family: 'Inconsolata', monospace;
  font-weight: 400;
}

Plex:

body {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 400;
  font-feature-settings: "liga" 1, "calt" 1;
}

Summary

Plex offers a more comprehensive font family with broader language support, making it suitable for diverse projects. However, this comes at the cost of larger file sizes and potentially higher resource usage. Inconsolata, being more focused on monospace typography, provides a simpler implementation but with fewer features.

The code comparison shows that Plex may require additional CSS properties to fully utilize its advanced features, while Inconsolata can be implemented with minimal configuration. Both fonts are excellent choices for coding and technical documentation, with the choice depending on specific project requirements and design preferences.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Inconsolata

Open-source monospace font for code listings, originally by @raphlinus

Ligatures

Inconsolata includes ligatures for a few JavaScript operators:

Ligatures sample

They are available in two families.

  • "Inconsolata" exposes the ligatures as dlig. These are disabled by default, and probably won't show up in your editor. You can enable them in CSS with this rule:
    font-variant-ligatures: discretionary-ligatures;
    
  • "Ligconsolata" exposes the ligatures as liga. These are enabled by default. This is the family you should use in your text editor.

Note: the Ligconsolata variant has not yet been upgraded to version 3.000, as we're prioritizing the non-ligature variants.

Building the family

Family is built using Glyphs, fontmake and gftools post processing script. Tools are all python based.

To install all the Python tools into a virtualenv, do the following:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

To build the fonts we must load sources/Inconsolata-vf.glyphs in Glyphs and do the following:

  • Run the decompose-transformed-components.py script
  • Run the gen_instances.py script
  • Run the inco_fix.py script
  • Save the file back in the sources directory with the filename "prod.glyphs"

We can now run the build script in the terminal:

cd sources # script needs to be run from sources dir
sh build.sh

Fonts will take approximately 25 minutes to build.

Changelog v.3.000

Upgrade to 2-axis variable font family, with widths from 50 to 200, and weights from 200 to 900.

Changelog v.2.013

  • Removed ligatures for fi and fl.
  • Operator ligatures moved to dlig.
  • New variant "Ligconsolata" introduced, which exposes operator ligatures as liga.

Changelog v.2.011

March 2018 glyph set expansion was completed by @appsforartists, which included:

  • Glyph Set expanded to include ligatures for ===, !==, =>, <=, >=, ->, <-

Changelog v.2.001

August 2016 glyph set expansion was completed by Alexei Vanyashin ( Cyreal ), which included:

  • Glyph Set expanded to GF Latin Pro
  • Additional glyphs ⊕↑↗→↘↓↙←↖↔↕⇧⇨⇩⇦⬆⮕⬇⬅●○◆◇☹☺☻♠♣♥♦✓✔✕✗✘␣⎋⌂⇪⌧⌫⌦⌥⌘⏎�
  • Minor design improvements (trademark corner spurs)

Further reading: Inconsolata expansion project thread on Google Fonts Discussions

Supported glyphs sets:

  • GF Latin Pro

Inconsolata Preview

License

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL


Inconsolata Build Instructions

Inconsolata fonts can be built using either export from Glyphs or using fontmake. The font files committed to this repo are done using fontmake.

Source Files

Inconsolata source files are available in .glyphs format located in the /sources directory.

Adding ligatures

  1. Follow the "Creating the ligature" section of the Glyphs ligatures tutorial.
  2. Name your new glyph with the suffix .dlig, for instance bar_greater.dlig.
  3. Open the Font Info panel.
    1. Switch to the Features tab.
    2. Click dlig in the sidebar.
    3. Click the Update button at the bottom of the panel.
    4. Switch to the Instances tab.
    5. Update the Rename Glyphs value for "Ligconsolata Regular" to include a new line for your new glyph, for instance:
      bar_greater.dlig=bar_greater.liga
      
    6. Update the Rename Glyphs value for "Ligconsolata Bold".
  4. Export the font, as explained below.

Exporting a variable font using fontmake

It's possible to export the project as a single variable font. It's just a bit tricky, because the font uses components with varying 2x2 components, triggering a bug which is present in both fontmake and Glyphs export. Thus, there's an inco_fix.py script in the sources directory that detects this case and decomposes just those components. Run that script before exporting. The script also decomposes corner components, which makes the resulting glyphs file suitable for fontmake export as well (fontmake currently has no support for corner components).

You can copy the script into the Scripts folder for Glyphs, which will make it available in the Script menu, or you can just copy it into the Macro Panel.

After running the script, the following fontmake invocation will generate a variable font:

fontmake -g sources/Inconsolata-vf.glyphs -o variable

This is the version in the fonts/ directory, as it is slightly smaller than the version generated by Glyphs.

We do not check the result of the inco_fix script into version control, as we want to preserve editability. It's entirely possible that a future version of fontmake (or Glyphs itself) will be able to handle the source file without running a script.

Exporting instances using fontmake

The source file contains 15 instances, including all weights of the normal (100) width, and also all masters. This is a reasonable complement for working on the font. Run the gen_instances.py script to generate a total of 72 instances; all combinations of the weights from 200 to 900, and widths 50, 70, 80, 90, 110, 120, 150, and 200.

There are two other instances for Ligconsolata, and fontmake will attempt to generate those, but the "Rename Glyphs" custom parameter doesn't seem to be respected by fontmake, so these won't have ligatures enabled. Use the Glyphs export instead (detailed below).

Then run this command to generate OTF:

fontmake -g sources/Inconsolata-vf.glyphs -i -o otf

And this command to generate autohinted TTF:

fontmake -g sources/Inconsolata-vf.glyphs -i -o ttf -a

These are the versions in the fonts/ directory.

Font Export options (from Glyphs)

This is the preferred way to generate the Ligconsolata instances, but

  • TTF and OTF files should be exported into /fonts/ttf and /fonts/otf folders.

  • TTFs should be generated from Glyphs App with Autohint option checked. At the moment there is no custom build script required to produce font files, since default TTFautohinting options suffice.

Font Export Options

  • OTFs should be generated with these options:
    • Remove Overlap
    • Autohint
    • Save as TTF
    • Export destination: $REPO_PATH/fonts/otf

Future work

In addition, we want to export a subset not including Vietnamese script coverage, to avoid over-large line spacing on older applications (such as terminals and text editors) that don't understand the "use typo metrics" flag (see https://github.com/googlefonts/Inconsolata/issues/35).

Glyphstool

The repository also contains some Rust code to manipulate Glyphs format masters, in the glyphstool subdirectory. This was used to apply global transforms (mostly as a starting point for the width work). Perhaps the most valuable aspect is that it contains a fairly complete set of line and box drawing primitives, inspired by [Source Code Pro] but with actually variable weight and width. It's not particularly polished or well documented, but is provided for completeness, and it's possible that it could be adapted to future tools that work with font data in the Glyphs format. The code is licensed under Apache 2.0 or MIT, in keeping with the Rust tradition.


Copyright

Copyright 2006 The Inconsolata Project Authors

Links