jianpu-ascii-font

Jianpu Ascii Font

This is a font which uses ascii ligatures to display simplified Jianpu 简谱 musical notation. This is not a specialized font intended for use some musical application, but rather a very simple way of rendering notation in a word-processor or personal website.

The font file can can be downloaded from the GitHub repo.

See here for an editable of the font in use.

Syntax

The wikipedia page for jianpu notation is well-written and describes how the notation works. Below is a list of jianpu features implemented in this font and how to use them.

Basics

|3 3 4 5|5 4 3 2|1 1 2 3|3 2 2 0|

A quick diddy. Ode to Joy.

1,,2,,3,,4,,5,,6,,7,,1,2,3,4,5,6,7,12345671'2'3'4'5'6'7'1''2''3''4''5''6''7''

A scale spanning three octaves, rendered with this font.

Timing

s3,,s3,s3s3's3''q3,,q3,q3q3'q3''3,,3,33'3'' 3,,//3,//3//3'//3''//3,,/3,/3/3'/3''/3,,3,33'3''

The same note with differing octaves and lengths.

|1' - 6|5 - 5|1' - 3'/1'/|5..4//1//2//3/|
|4 - 4|3 - 3|3 - 5 |5,- 1,  |

An illustration of ties and slurs and tuplets.

Other Symbols

3#3^3b3_3 3/#/3/^3/b3/_3/

An illustration of ties and slurs and tuplets.

 [-]     (-)
|:1/2/1/ 3 4 5:|:5 - 6 5:|1325,|1231|3125,|5,231||

An illustration of ties and slurs and tuplets.

Download

As mentioned above, the font file can can be downloaded from the GitHub repo, and then installed like any other font.

There’s also a COLRv0 version of the font, which displays notes in different colors. This was made mostly just to see whether I could, is a bit glitchier, and works in fewer applications, though it should at least work in every modern internet browser.

The colored version of the font, all notes demonstrated.

Usage

For local use, like typing up a melody and printing it, you can just install the font, and then use it like any other (though see below for some settings changes that have to be made in MS Word.)

For use on a website, just host the font file and apply it to a pre element using css.

Simple Example:

<style>
@font-face {
    font-family: Jianpu;
    src: url("path/to/JianpuASCII.ttf");
}
.jianpuBlock {
    font-family: Jianpu;
    line-height: 1.5;
    font-size: 25px;
}
</style>
<pre class="jianpuBlock">
|1' - 6|5 - 5|1' - 3'/1'/|
|4 - 4|3 - 3|3 - 5 |
</pre>

What software does this work in?

This method of rendering Jianpu musical scores relies only on basic font-rendering features, and as such should work basically anywhere. In my testing, this font renders correctly in the following software with the need for any settings tweaks: All major internet browsers, GIMP, Inkscape, and Libre Office, as well as Notes, Pages, and TextEdit on MacOS. (QGIS works too, though I can’t imagine a situation where you’d want to put this stuff on a map.)

The only programs I’ve found in which this font doesn’t work ‘right out of the box’ are Microsoft Office and MS Paint. To get it working properly in Microsoft Word, two changes have to be made:

Example

The following block of text will just look like a mess if viewed as a README on Github, but if you view the same page with this font applied, then you’ll see the same rendition of Amazing Grace as is present on Wikipedia’s jianpu article.

5 |1' - q3'q1'| 3' - 2' |1' - 6|5 - 5|1' - q3'q1'|3' - q2'q3'|5' -
3 |3 - 5 |b7 -b7 |4 - 4|3 - 3|3 - 5 |1' - 5 |5 -
5, |1 - 1 | 1 - 1 |6, - 6,|1 - 1|5, - 5, |1 - 1 |7, -
1, |1, - 5, | 1, - 5, |4, - 4,|1, - 5,|1, - 3, |5, -   |5, -
 
2'/3'/|5' - 3'/1'/| 3' - 3'/2'/|1' - 6|5 - 5|1' - 3'/1'/|3' - 2'|1' - ||
5 |3 - 5 |b7 -b7 |4 - 4|3 - 3|3 - 5 |1' - 4|3 - ||
7, |5, - 1 | 1 - 1 |6, - 6,|1 - 1|5, - 5, |1 - 7,|1 - ||
5, |1, - 5, | 1, - 5, |4, - 4,|1, - 5,|1, - 1, |5, - 5,|1, - ||

There are no scripting tricks here. It’s just a font.

And here’s a link to the same example in an editable text box, if you’d like to play around with it. Note that the first and second lines deliberately use different syntax for the quarter notes.

Other Jianpu Typesetting systems.

The advantage of using this font is that the resulting musical notation can be displayed and modified in almost any software.

But of course, there is only so much one can do with font formatting tricks. And more complex musical notation may require more specialized typesetting software.

You may also be interested in ABC Notation, which is a system of notating scores using ascii text. The conventions of using , ' to denote octave shifts comes from ABC notation, (though ABC also uses capital vs lowercase letters,) as does the use of / // for note shortening and the prefixes ^ = _ for accidentals.

The use of s q prefixes for note shortening is something I took from jianpu-ly.

There are several other similarities between these notations and my syntax above, but these are cases of convergent evolution rather than direct inspiration.

License

This font is released under the SIL Open Font License.

Note that this font is a derivative work of the font with Reserved Font Name ‘Source’, Copyright © Adobe Systems Incorporated 2010, 2012. In particular, it uses the numerals 0123456789 from “Source Code Pro”, by Paul D. Hunt, downloaded from Google Fonts here: https://fonts.google.com/specimen/Source+Code+Pro