Fonts in VS Code

I started using Visual Studio Code in Windows. I noticed that the “hat” (the circumflex mark) is not placed on top of Greek letters, but on the side. It is properly placed for Latin letters. Does anyone know how to fix that?

What font are you using. I use Cascadia code from MS and all unicode chracters seems to work great.

1 Like

Consolas, 'Courier New', monospace. I’ll try Cascadia.

Edit: Nope, still the same problem.

I fixed it by using JuliaMono.

3 Likes

I had been using Fira Code because it seemed to be highly recommended, but found that \chi was almost indistinguishable from X. My model has both so this was a problem for following the code. JuliaMono seems much better for Greek letters.

4 Likes

JuliaMono does not show the :bulb: character. Does anybody have an alternative?

Sure, write bulb.

Renewed appeal to Julia users: stick to the least common denominator, ASCII characters, please.
Not everyone will have your setup, with fancy fonts and such, and some characters can be and will be confused or misinterpreted (or, indeed, invisible).

I got it

Nice, But this code is just mine. I not going to share it. So I am not concern about other setups…

You can’t blame Julia developers for someone else having a misconfigured development environment.

Installing fonts isn’t such a big issue, except when trying to develop Julia on some ancient machine of the kind which can’t even run Julia…

Way too restrictive. Consider that UTF-8 was already invented and in use about thirty years ago. Perhaps some parts of Unicode should be stylistically off-limits, but you’ve got to be more reasonable.

1 Like

The coloured characters are provided by an “emoji font”, not the main font like Fira Code or JuliaMono. It will be something like “Apple Color Emoji”, “Segoe UI Emoji”, or “Noto Color Emoji”, depending on the OS. I don’t why they wouldn’t appear, though.

1 Like

This isn’t about misconfigured environments. Just check how many times
there have been threads about fonts and the appearance of code in this forum.

Why don’t you do a little test: give your code to 10 of your friends. If any one of them
cannot read every single character of your code, it is probably making too optimistic assumptions about
using unusual characters.

Not necessarily. You could also be assuming that some of them won’t be able to read every character, and be fine with that.

1 Like

What’s stopping the friend from installing the necessary fonts? I don’t know about Windows, Mac and others; but on Archlinux (and other Linux distros) mantaining font packages isn’t something I (as an user) have to worry about at all.

1 Like

Petr’s ongoing crusade to stop people using Unicode in Julia is quite laudable, in a way - but I think it’s a losing battle, since - de gustibus non est disputandum. :grinning:

2 Likes

I am hopeful that people will realize the loss of portability and increased cognitive burden due to their use of all sorts of “cute” symbols once the novelty has worn off. :slight_smile:

Better notation leads to decreased cognitive burden.

Unicode is not a cute novelty, but a genuine improvement.

(Perhaps it is easier to see it as just a novelty if your language and your personal name has no ‘cute foreign’ symbols.)

4 Likes

If I had an umlaut in my name, I still wouldn’t think it wise to foist it on other people.
But to really address your point, consider the speakers of Mandarin. Imagine
how portable their source code would be if they insisted on writing in chinese characters.
I am learning Chinese, but there is no way I could understand code that uses the characters.
Similarly, if I insisted on giving variables Czech names (including all the diacritical symbols),
I might make it possibly convenient for Czech speakers, but I would have severely limited the legibility of the code to everybody else.

You are missing that you can use unicode strategically to improve legibility. Like replacing sin_theta with sinθ. It improves legibility dramatically, especially in complicated expressions.

Those whose setups do not support Greek characters will just have to muddle through. Sorry.

5 Likes