arrowtype/recursive

Add basic Greek characters for mathematics

arrowtype opened this issue · 5 comments

I’ve been hired to add some Greek to Recursive, to improve it for mathematics! I’m pretty excited about this. This issue is to help plan and track the work.

Specifically, I need to add the following: Α Β Γ Δ Λ Μ Ν Θ Π Φ α β γ μ λ ν θ π δ φ. In full:

  • Α 0391 | Alpha
  • Β 0392 | Beta
  • Γ 0393 | Gamma
  • Δ 0394 | Delta
  • Λ 039B | Lambda
  • Μ 039C | Mu
  • Ν 039D | Nu
  • Θ 0398 | Theta
  • Π 03A0 | Pi
  • Φ 03A6 | Phi
  • α 03B1 | alpha
  • β 03B2 | beta
  • γ 03B3 | gamma
  • μ 03BC | mu (actually, this needed a bit of refinement)
  • λ 03BB | lambda
  • ν 03BD | nu
  • θ 03B8 | theta
  • π 03C0 | pi
  • δ 03B4 | delta
  • φ 03C6 | phi (Note: “in mathematical contexts, the loopy glyph is preferred, to contrast with 03D5 φ” – source)

The above are now complete in the Mono sources and building well into the variable font (353e189). However, the following glyphs will need adjustment for proportional widths in the Sans styles:

  • Gamma
  • Pi
  • Phi
  • phi

Also

  • Check whether these should have specific math Unicodes; if so, make them with both(?). UPDATE: Most of these don’t have math-specific Unicode values. I’ve learned that the pi glyph, present in most fonts but without a math-specific Unicode, already corrupts Greek text. This was already the case for Recursive, so at least at first, I won’t do anything too clever to try to split "math specific" fonts from the general release fonts.

  • Once these are made and built into final fonts, compare the output with a couple of fonts you trust, e.g. Roboto and Plex, to double-check that unicodes are correct

  • static fonts aren’t getting unicodes for Delta and mu ... figure out why not, and fix

    • This seems to be due to a slightly conflict in the Adobe Glyph List... there, names Delta and mu point to their math-specific Unicodes, rather than their Greek letter Unicodes, whereas the source fonts point to math glyphs with names increment and mu.math. I probably need to set uni style postscript names in the font lib public.postscriptNames dict.
    • Update: I probably had to add the Delta and mu to setProductionNames() in mastering/prep_fonts.py ... testing it now with that edit.
  • fix slightly-off interpolation in mu

Additional context

This is 10 letters of the 24 letter Greek alphabet. Sigma has 2 lowercase variants depending on medial/finial position, Kai seems to be a necessary symbol to make, and there are some accents and accented characters to build. And, of course, these would need kerning to work well in text.

So, I may add full Greek support in the future, but this is really just a first pass to better support math. If I can get funding from a client to add the full alphabet, I’d be excited to make it happen!

Some letters are already drawn. Here are some Glyph Construction recipes I’ll use to start the rest.

Can be direct components (probably):

?Alpha = A | 0391
?Nu = N | 039d
?alpha = a.italic | 03b1
?nu = v | 03bd

Will need drawing (but here are glyphs to start with) – give these a different mark color until they are completed:

?Gamma = T | 0393
?Delta = A | 0394
?Theta = O + hyphen@center | 0398
?Lambda = A | 039b
?Pi = H | 03a0
?Phi = O + bar@center | 03a6
?gamma = v + bar@center | 03b3
?delta = o + s@top | 03b4
?theta = zero + hyphen@center | 03b8
?lambda = l + v | 03bb
?phi = o + bar@center | 03c6

Running questions

  • How can Theta be differentiated from zero in a Mono?
  • Can extrabold/ultra Phi have an open center? (Like a dollar?)

I'm excited to read this, and look forward to a version with support for these characters! 🚀

If I may ask for one request, because many fonts have issues with the following; it would be great if the small greek letter nu will be easy to distinguish from the latin letter v. (I'm mostly interested in the monospace fonts.)

For example in the Consolas font, it looks pretty bad in my opinion and they are very difficult to distinguish, especially on smaller font sizes:
Consolas

One example of a font which, in my opinion, does it very well is JuliaMono:
JuliaMono

Another example where it looks good would be DejaVu Sans Mono:
DejaVuSansMono

Thanks for the comment, @jwortmann. I’ll do what I can!

Okay, this is all now building well, and I have tested that all characters, across styles, are building with the expected Unicode values. Here are several fonts from Recursive (in white) versus several other popular fonts (in gray):

image