Unitful.jl icon indicating copy to clipboard operation
Unitful.jl copied to clipboard

Add ASCII aliases for Unicode dimension characters ๐•„, ๐•ƒ, ๐•‹

Open stillyslalom opened this issue 5 years ago โ€ข 2 comments
trafficstars

I've been wrestling with Windows fonts' broken representations of the mathbb dimensions characters while trying to extend Unitful. It'd be nice to have aliases (e.g. const MASS, LENGTH, TIME = ๐•„, ๐•ƒ, ๐•‹) for terminal environments where those characters are unrepresentable.

stillyslalom avatar Jul 18 '20 03:07 stillyslalom

I too really hope we can find a solution to this which works on all operating systems, but ASCII is unnecessarily restrictive. Your proposal also has the disadvantage of exporting very reasonable variable names for other uses.

With Julia incorporating symbols like 'in' = 'โˆˆ' in Base, installing a slightly better font could be seen as minimum effort from Windows users anyway. The current symbols are especially problematic, though. A cygwin terminal can show these symbols, but installing that has several disadvantages. Fixed space fonts are also said to be able to show them, but which?

For my use at work, I maintain (as necessary) a clone of Unitful where symbols are

แดธ   Length
แดน  Mass
แต€  Time
แดต   Current
แถฟ  Temperature
แดถ   Luminosity
แดบ  Amount

For readability, these are always prefixed by space.

hustf avatar Jul 18 '20 08:07 hustf

Not just for representation, but for simpler entry with a keyboard, how is Dim"Length" etc?

gustaphe avatar Sep 27 '20 09:09 gustaphe