adobe-fonts / source-code-pro

Monospaced font family for user interface and coding environments
https://adobe-fonts.github.io/source-code-pro/
SIL Open Font License 1.1
19.74k stars 1.62k forks source link

Mathematical operators and symbols support #49

Open k0001 opened 11 years ago

k0001 commented 11 years ago

Modern markup languages such as MathML, or programming languages such as Agda, Haskell and Scala can make extensive use of the Greek alphabet and mathematical symbols. Users of these languages could benefit from Source Code Pro if these characters were supported. In particular Agda and MathML make the most extensive use of Unicode, by design.

Issue #48 already requests Greek alphabet support.

Here are some quite comprehensive list of mathematical symbols:

Here are some code snippets and blog posts making use of this feature:

k0001 commented 11 years ago

I'd like to add that fonts such as DejaVu Sans Mono or FreeMono already support a wide variety of such mathematical symbols, operators, and letters.

pauldhunt commented 11 years ago

I am planning on adding Greek at some point, but I had no plans to add these. I would definitely need some help creating all of these.

k0001 commented 11 years ago

Greek support will be excellent.

Certainly, this is hard work. In any case, maybe it can be helpful to start by prioritizing some of these symbols according to how often they are used, so I'll try that:

In this list http://archive.tlt.psu.edu/suggestions/international/bylanguage/mathchart.html#set I've often came across symbols in these categories:

pauldhunt commented 11 years ago

Can you give Unicode ranges/code points for these?

k0001 commented 11 years ago

Yes. Thanks for asking that.

It seems that the most common mathematical symbols are, unsurprisingly, in the Mathematical Operators block: U+2200–U+22FF.

There are some letter-like symbols, however, that fall outside that block:

jfim commented 10 years ago

Specifically for the Scala programming language, the rightwards double arrow (U+21D2 ⇒) is part of the language specification, so it would be awesome to have it. The leftwards single arrow (U+2190 ←) is already in the font and looks great!

pauldhunt commented 10 years ago

@jfim that’s easy, i’ll sneak that in there.

jfim commented 10 years ago

Sweet, can't wait to get rid of the horrid fallback font arrows! :)

andy-morris commented 10 years ago

@pauldhunt Hooray! Mono fonts always seem to have ←/→ but never ⇐/⇒. (Haskell uses ⇒ with the UnicodeSyntax option as well, fwiw.) So a font that actually has them would be a nice change. :)

adrientetar commented 9 years ago

The Hasklig font has some arrows that could be checked-in upstream.

miguelsousa commented 9 years ago

The Powerline glyphs may be a good addition since there's an open request (#43). The other glyphs not so much because the set of arrows is very incomplete.

valpackett commented 9 years ago

Any progress on this? (Especially ∷ ⇒ →)

pauldhunt commented 9 years ago

I am actively working on the next revision of the SCP fonts and plan to add these characters. the single arrow is already in the font, so you’re jus looking for the double stroked arrow and the proportion symbol (u+2237)? is that correct?

andy-morris commented 9 years ago

If you wouldn't mind adding ∀ and ∃ too, that'd be even better. But at least a mono font with a non-ugly ⇒ would be great.

(btw: Hasklig doesn't play nice with GUI vims because it lays out the characters on a grid.)

pauldhunt commented 9 years ago

I’ve gone and added u+21D2, u+2200, u+2203, u+2237 to the design masters and these will make it into the next version of the released upright fonts.

deepankarpathak commented 9 years ago

Is there is any way to add Greek symbols like λ (lambda), θ (theta), σ (Sigma) and ι(iota). This would be of great help.

yurikhan commented 9 years ago

@deepankarpathak You might want to watch #94.

pauldhunt commented 9 years ago

All the Greek letters (except for polytonic) will be in the upright fonts of the upcoming release.

musm commented 8 years ago

+1 I use the julia repl and I cannot see certain symbols since they are not available to source code pro. Would love to use source code pro but certain math symbols are simply not there. E.g. compare (right, dejavu sans mono, left source code pro)

symbols compare

pauldhunt commented 8 years ago

@mmoh please list the Unicode values or enumerate the characters here for the missing characters so that I can get this into an upcoming release.

andy-morris commented 8 years ago

The missing characters in the screenshot are:

If you do add these, may I request also ⊂ (U+2282) and the superset signs (U+2283,5,7,9)?

musm commented 8 years ago

Thanks @andy-morris here is also a larger list that would be useful to include: http://julia.readthedocs.org/en/latest/manual/unicode-input/

loskutov commented 8 years ago

Are there any plans to add some more math symbols? The number of the most used ones is not that big:

Most of these symbols also seem to be pretty easy to draw.

pauldhunt commented 8 years ago

I am open to adding more mathematical symbols, but this is low on my priority list unless given some compelling reason to include them particular symbols. Because of the sheer number of symbols that are used in mathematics, it would be instructive to understand how useful particular definite sets would be. For example, the addition of u+2229 came about when I wanted to add support for a historical standard font scheme, the Windows Glyph List 4. Having clearly delimited sets like this with a clear intended purpose makes it easier to prioritize the addition of more mathematical symbols that otherwise seem very arbitrary.

loskutov commented 8 years ago

These symbols are used in base-unicode-symbols Haskell package as well as in ScalaZ, a popular library for the Scala programming language, so their addition would make it much less painful to view and edit the code written in these languages. (As was previously stated, Agda makes even more extensive use of Unicode, so these symbols are used in it as well)

The following symbols provided by the UnicodeSyntax Haskell extension are lacking:

Character Code point Unicode name
U+2605 BLACK STAR
U+2919 LEFTWARDS ARROW-TAIL
U+291A RIGHTWARDS ARROW-TAIL
U+291B LEFTWARDS DOUBLE ARROW-TAIL
U+291C RIGHTWARDS DOUBLE ARROW-TAIL

The following symbols used in Prelude.Unicode Haskell module are lacking:

Character Code point Unicode name
U+2124 DOUBLE-STRUCK CAPITAL Z
U+211A DOUBLE-STRUCK CAPITAL Q
U+2208 ELEMENT OF
U+2209 NOT AN ELEMENT OF
U+2218 RING OPERATOR
U+2227 LOGICAL AND
U+2228 LOGICAL OR
U+2260 NOT EQUAL TO
U+2261 IDENTICAL TO
U+2262 NOT IDENTICAL TO
U+226E NOT LESS-THAN
U+226F NOT GREATER-THAN
U+22A5 UP TACK
U+22C5 DOT OPERATOR
U+29FA DOUBLE PLUS

The following symbols used in other modules of the same package are lacking:

Character Code point Unicode name
U+2042 ASTERISM
U+2205 EMPTY SET
U+2206 INCREMENT
U+220B CONTAINS AS MEMBER
U+220C DOES NOT CONTAIN AS MEMBER
U+2216 SET MINUS
U+222A UNION
U+226A MUCH LESS-THAN
U+226B MUCH GREATER-THAN
U+2295 CIRCLED PLUS
U+229B CIRCLED ASTERISK OPERATOR
U+22D8 VERY MUCH LESS-THAN
U+22D9 VERY MUCH GREATER-THAN
U+29FB TRIPLE PLUS
U+2AF4 TRIPLE VERTICAL BAR BINARY RELATION

Also, many of these characters are required for APL (issue #114).

marckassay commented 5 years ago

The ≡ (U+2261) character from one of @loskutov's lists is needed by posh-git. Although this is in the 2.030R-ro/1.050R-it release.