Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to change Enso's font? #32

Open
gilch opened this issue May 6, 2024 · 12 comments
Open

Is it possible to change Enso's font? #32

gilch opened this issue May 6, 2024 · 12 comments

Comments

@gilch
Copy link

gilch commented May 6, 2024

Some of my custom commands insert Unicode characters that are otherwise hard to type. Sometimes I might want to display a message, write a docstring, or use a BOUND ARG option containing Unicode characters. Not all of them render in Enso's default font.

@GChristensen
Copy link
Owner

There are two files where font_family is set:
enso/quasimode/layout.py
enso/messages/primarywindow.py

It is worth to experiment with them.

@GChristensen
Copy link
Owner

GChristensen commented May 7, 2024

It turns out that the font is hardcoded here.
It is possible to specify any font file there.
I'll try to do something about this in the future versions.

@tnmeesters
Copy link

That would be nice to have different fonts. I am also missing a lot of Unicode characters.

@GChristensen
Copy link
Owner

I've added the UI_FONT variable in the recent release. It is possible to specify a font here. In Enso it is only possible to use different fonts for message windows and the main UI window. Currently it is possible to only specify only one font for both. If you mean a feautre that assumes a custom font for a part of a message, it is very hard to do this, because a layout engine of some sort should be created, so most likely it will never be done, because everything is rendered in plain Cairo.
It should be investigated how Cairo renders glyphs and are there settings to render unicode properly.

@tnmeesters
Copy link

Great, thank you. It would be interesting to try out some new fonts.

I have a script that uses Unicode. Some characters show up and others don't. Do not know anything about Cairo but it would be a cool feature.
symbol.zip

@gilch
Copy link
Author

gilch commented Jun 5, 2024

If you mean a feautre that assumes a custom font for a part of a message,

Not sure what was meant, but in fact, no font I know of covers all Unicode glyphs. One can get pretty far with GNU Unifont, which at least covers the basic multilingual plane, but it's a kinda ugly pixel font and even then doesn't handle combining characters properly in many cases. Full Unicode display support requires inline rendering of fallback fonts.

so most likely it will never be done, because everything is rendered in plain Cairo.

This Cairo? They specifically call out and recommend Pango at that FAQ link as being able to handle multiple fonts. No need to reinvent the wheel, but I can't tell if that's easy to apply to Enso because I still don't understand Enso's internals.

@gilch
Copy link
Author

gilch commented Jun 5, 2024

A quick search of the repository does contain hits for "pango", so maybe it's already being used.

@tnmeesters
Copy link

I've added the UI_FONT variable in the recent release. It is possible to specify a font here. In Enso it is only possible to use different fonts for message windows and the main UI window. Currently it is possible to only specify only one font for both. If you mean a feautre that assumes a custom font for a part of a message, it is very hard to do this, because a layout engine of some sort should be created, so most likely it will never be done, because everything is rendered in plain Cairo. It should be investigated how Cairo renders glyphs and are there settings to render unicode properly.

So I 've downloaded the new version but I do not know how to change to font. Where do I do this?

@GChristensen
Copy link
Owner

There is a text input in the main settings window. It is necessary to specify font there:

UI_FONT="Segoe UI"

and restart Enso.

@tnmeesters
Copy link

Alright, I got the message windows of enso working with another font but not the part where you type after launching enso. Is this possible?

@GChristensen
Copy link
Owner

It is set here. You may check if it is so in your installation (probably it is). It sets the font of the string that you type and the automatic completion. The help string above this may be in the standard font.

@tnmeesters
Copy link

Thanks, I have got it working.
This is so cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants