Using Rich Text

Hello everyone,

I’m searching for ways to use rich text in a project but failed to find one other than loading HTML files. The problem with that is, we are aiming for a PC release but the native WebView API is not supported on Windows desktop apps. Also, working with HTML files may make things harder when we include any form of interaction with the text.

Is there something easy-to-use and functional in Corona that I can use like Unity’s rich text?

One solution is to create an *.rtf file and display/open that file like this…

system.openURL(system.pathForFile("my.rtf"))

The above will work on both Windows and Android.  And you can do the same with *.html, *.pdf, and other files too that you want to display externally.  It’ll display that file using whatever is set up to handle that extension.  On Windows, this does the equivalent of double click on that file.  Just note that it’ll display the file in a separate application window and not within your app.

Only other solution I can think of is to use a 3rd party bitmap font library, such as the following.  Although, not all of these may provide the features you are looking for.

Well, opening the file in a separate window won’t work for me. Is there any chance that WebView will work on Windows desktop apps in the near future?

Unfortunately, we can’t make promises that WebViews will be implemented on Windows in the near future.

The only other solution that I can think of is to use a native.newTextBox(), but it doesn’t support rich text.  But it does support a large amount of scrollabe text if that’s what you are partly after.

It’s not good for us but I guess we’ll have to drop that feature for now.

I’m using scroll views with text objects for scrollable text but I’ll keep that in mind :slight_smile: Thank you Joshua.

One solution is to create an *.rtf file and display/open that file like this…

system.openURL(system.pathForFile("my.rtf"))

The above will work on both Windows and Android.  And you can do the same with *.html, *.pdf, and other files too that you want to display externally.  It’ll display that file using whatever is set up to handle that extension.  On Windows, this does the equivalent of double click on that file.  Just note that it’ll display the file in a separate application window and not within your app.

Only other solution I can think of is to use a 3rd party bitmap font library, such as the following.  Although, not all of these may provide the features you are looking for.

Well, opening the file in a separate window won’t work for me. Is there any chance that WebView will work on Windows desktop apps in the near future?

Unfortunately, we can’t make promises that WebViews will be implemented on Windows in the near future.

The only other solution that I can think of is to use a native.newTextBox(), but it doesn’t support rich text.  But it does support a large amount of scrollabe text if that’s what you are partly after.

It’s not good for us but I guess we’ll have to drop that feature for now.

I’m using scroll views with text objects for scrollable text but I’ll keep that in mind :slight_smile: Thank you Joshua.