GChristensen / enso-portable

Portable Enso Launcher community edition
Other
167 stars 46 forks source link

Is there a way to display newlines? Or can you add one? #33

Closed gilch closed 4 months ago

gilch commented 4 months ago

There are some cases when I display messages when I would like to show multiple lines of text. They seem to be replaced with spaces. I can work around this by replacing newlines with some other separator string, like " | ", but it's not as legible.

GChristensen commented 4 months ago

Messages require xml markup. Try to wrap lines in <p>.

gilch commented 4 months ago

It still doesn't work. I tried <p>. I tried <p>line</p>. I tried </p><p>line</p>. I tried caption=. I looked at the strings.py, and it looks like there is a <caption> tag. ensoapi.display_message() must be adding tags and escaping mine.

gilch commented 4 months ago

Do you have a simple working example of ensoapi.display_message() outputting lines? I could probably figure it out from that. Or does Enso have some alternative to display_message() that I could use instead?

GChristensen commented 4 months ago

Yes, there is an alternative. The example is here.

GChristensen commented 4 months ago

display_message indeed escapes the string.

The alternative requires such import: from enso.messages import displayMessage

GChristensen commented 4 months ago

This is fixed in v1.1.1. It is possible to set the UI font family through the UI_FONT variable in config.py or in the initialization block at the settings page. For example:

UI_FONT="Segoe UI"

It should be also possible to specify a path to a TTF font