Hello everyone!
I’m new to Xojo and can’t seem to figure out a problem…
MacOS Monterey
Xojo 2022 1
Desktop
Let’s say I have a very simple TextArea (Allow Styled Text ON)
Nothing else…
With MacOS TextEdit I open an RTF file (which I attach)
and TextEdit shows it to me the way I want it.
I do a simple copy & paste in the TextArea and the text comes out identical …
So I’ll did this …
I open with a text editor (BBedit) the RTF file that gives me the following result
{\rtf1\ansi\ansicpg1252\cocoartf2638
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;}
{\colortbl;\red255\green255\blue255;}
{*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab708
\pard\tx284\tx2098\tqr\tx3126\tqr\tx4084\tqr\tx5217\tx5670\tqr\tx9074\tx9407\tx12028\tx13527\tx14420\tx15301\pardeftab708\ri-903\partightenfactor0
\f0\fs24 \cf0 Pena Base 0 = 06 Anni 05 Mesi 01 Giorni Pena pecuniaria 026.000,00 \'80
\
- Aumento di 1 = 19 Anni 19 Mesi 19 Giorni Pena pecuniaria 130.333,00 '80 \
- Diminuzione di 2 = 29 Anni 29 Mesi 29 Giorni Pena pecuniaria 230.333,00 \'80 \
- Diminuzione di 3 = 39 Anni 39 Mesi 39 Giorni Pena pecuniaria 330.333,00 \'80 \
- Diminuzione di 4 = 49 Anni 49 Mesi 49 Giorni Pena pecuniaria 430.333,00 \'80
\
\f1\b Pena Finale 5 = 59 Anni 59 Mesi 59 Giorni Pena pecuniaria 530.333,00 \'80}
So I take THAT , line by line, and construct a variable whose result is:
{\rtf1\ansi\ansicpg1252\cocoartf2638
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;}
{\colortbl;\red255\green255\blue255;}
{*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\deftab708
\pard\tx284\tx2098\tqr\tx3126\tqr\tx4084\tqr\tx5217\tx5670\tqr\tx9074\tx9407\tx12028\tx13527\tx14420\tx15301\pardeftab708\ri-903\partightenfactor0
\f0\fs24 \cf0 Pena Base 0 = 06 Anni 05 Mesi 01 Giorni Pena pecuniaria 026.000,00 \'80
\
- Aumento di 1 = 19 Anni 19 Mesi 19 Giorni Pena pecuniaria 130.333,00 \'80 \
- Diminuzione di 2 = 29 Anni 29 Mesi 29 Giorni Pena pecuniaria 230.333,00 \'80 \
- Diminuzione di 3 = 39 Anni 39 Mesi 39 Giorni Pena pecuniaria 330.333,00 \'80 \
- Diminuzione di 4 = 49 Anni 49 Mesi 49 Giorni Pena pecuniaria 430.333,00 \'80
\
\f1\b Pena Finale 5 = 59 Anni 59 Mesi 59 Giorni Pena pecuniaria 530.333,00 \'80}
let’s say I call the variable “blocco” As String
(I was careful to put a chr(10) at the end of each line representing the rtf file)
At this point, considering the two identical representations of the rtf file, I assumed that the result of the paste should be identical to loading the contents of the rtf file.
TextArea(name).StyledText.RTFData = blocco
Not even in my dreams …
The last tab on the right is sent to a new line, whatever the number of TABs per line are…
the € character is not shown at all … (naturally that was a “\'80”
I also tried replacing the € character with EUR or even with an empty string.
No way.
the last tab of each line is sent to the next line.
I tried adding an extra tab to each row.
Same story …
HELP!!
I have been losing my sleep for three nights in a row…
I also thought about buying a plugin that could replace TextArea but I can’t find it.
Any suggestions from someone with more experience than me?
Thanks so much to anyone who wants to waste precious time to give me a hand …
Carlo
P.S.: I couldn’t find a way to attach my RTF file, so I beg you to trust me that it’s just a simple text, except for the TABS which are both left and right positioning… the last one per line being a right one (numbers to be represented)
All I could do is copy and paste from TextEdit, but the tabs are not well positioned in here (the last line is bold)…
Pena Base 0 = 06 Anni 05 Mesi 01 Giorni Pena pecuniaria 026.000,00 €
- Aumento di 1 = 19 Anni 19 Mesi 19 Giorni Pena pecuniaria 130.333,00 €
-
Diminuzione di 2 = 29 Anni 29 Mesi 29 Giorni Pena pecuniaria 230.333,00 €
-
Diminuzione di 3 = 39 Anni 39 Mesi 39 Giorni Pena pecuniaria 330.333,00 €
-
Diminuzione di 4 = 49 Anni 49 Mesi 49 Giorni Pena pecuniaria 430.333,00 €
Pena Finale 5 = 59 Anni 59 Mesi 59 Giorni Pena pecuniaria 530.333,00 €