Ok! I have found a solution using HTML Textarea and CSS stylesheet instead of Canvas text element.
First step: Create a styles.css stylesheet in the "Files" folder of your project with the following styles:
(examples)
(For now the direction:rtl is set to all, as a test)
textarea
{
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-webkit-touch-callout: none;
color: white;
user-select: none;
font-weight: 900;
background-color: transparent;
border: 0;
font-family: 'OpenSans-ExtraBold';
text-shadow: -1px -1px 2px #000000, 1px 1px 2px #000000;
overflow: hidden;
direction: rtl;
}
textarea:focus {
outline: none;
cursor: default;
}
Second Step: Insert the styles.css in the head of the exported index.html file by adding the following JS script on start of layout:
"
var nameScript = 'styles.css';
//C2 Runtime
if (typeof this.runtime !== 'undefined'){
nameScript = this.runtime.getProjectFileUrl(nameScript);
}
//C3 Runtime
if (typeof this._runtime !== 'undefined'){
nameScript = this._runtime.GetAssetManager().GetProjectFileUrl(nameScript);
}
var ss = document.createElement('link');
ss.type = 'text/css';
ss.rel = 'stylesheet';
ss.href = nameScript;
document.getElementsByTagName('head')[0].appendChild(ss);
"
Third step: Create the textareas with text set at auto-resize.
Fourth step: Add logic that would set the direction RTL only for "ar-me" text.
I will post my solution on this soon...