Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Drawing string with accented character (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: REALdb Tools
Next thread: Re: OLD RBDB Limitations (someone from REAL?)


Using services   -   Jan Erik Moström <
  Drawing string with accented character   -   Eric POUSSE
   Re: Drawing string with accented character   -   Joseph J. Strout
   Re: Drawing string with accented character   -   Eric POUSSE
   Re: Drawing string with accented character   -   Joseph J. Strout
   Re: Drawing string with accented character   -   Eric POUSSE
   Re: Drawing string with accented character   -   Joseph J. Strout

Drawing string with accented character
Date: 29.02.04 15:27 (Sun, 29 Feb 2004 15:27:23 +0100)
From: Eric POUSSE
Bonjour,

With RB 5.5 or 5.5.1fc1, drawing string with accented character under
Mac OS 9 is very slow.
On Mac OS X, there is no difference between accented or not.
Why this append under Mac OS 9 ?
Is it encoding ?
I use drawstring for unrotated string and StringShape for rotated
string ?

Thanks.

Eric POUSSE
7 rue de la Californie
37000 TOURS
FRANCE
Tél : 33 (0) 2 47 76 08 80
Fax : 33 (0) 2 47 76 08 81
Web : http://www.adX-Online.com/

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Drawing string with accented character
Date: 29.02.04 15:36 (Sun, 29 Feb 2004 08:36:59 -0600)
From: Joseph J. Strout
At 3:27 PM +0100 2/29/04, Eric POUSSE wrote:

>With RB 5.5 or 5.5.1fc1, drawing string with accented character
>under Mac OS 9 is very slow.
>On Mac OS X, there is no difference between accented or not.
>Why this append under Mac OS 9 ?

Because OS 9 can't draw Unicode directly; we have to convert to the
encoding associated with the font you're using. But our code that
does this conversion is clever enough to short-cut the process when
your string contains only ASCII characters, and you're converting
from one ASCII superset to another (e.g., UTF-8 to MacRoman). That's
why it's faster when there are no non-ASCII characters in your string.

OS X draws Unicode directly so no such conversion is needed.

Cheers,
- Joe

Re: Drawing string with accented character
Date: 29.02.04 15:53 (Sun, 29 Feb 2004 15:53:45 +0100)
From: Eric POUSSE
Thanks,

but can I accelerate the drawing or not ?
Because as now, I can't use RB 5.5 to do this under Mac OS 9.

Cordialement.

Eric

Le 29 févr. 04, à 15:36, Joseph J. Strout a écrit :

> At 3:27 PM +0100 2/29/04, Eric POUSSE wrote:
>
>> With RB 5.5 or 5.5.1fc1, drawing string with accented character under
>> Mac OS 9 is very slow.
>> On Mac OS X, there is no difference between accented or not.
>> Why this append under Mac OS 9 ?
>
> Because OS 9 can't draw Unicode directly; we have to convert to the
> encoding associated with the font you're using. But our code that
> does this conversion is clever enough to short-cut the process when
> your string contains only ASCII characters, and you're converting from
> one ASCII superset to another (e.g., UTF-8 to MacRoman). That's why
> it's faster when there are no non-ASCII characters in your string.
>
> OS X draws Unicode directly so no such conversion is needed.
>
> Cheers,
> - Joe

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Drawing string with accented character
Date: 29.02.04 19:47 (Sun, 29 Feb 2004 12:47:57 -0600)
From: Joseph J. Strout
At 3:53 PM +0100 2/29/04, Eric POUSSE wrote:

>but can I accelerate the drawing or not ?

It depends on what you're doing.

>Because as now, I can't use RB 5.5 to do this under Mac OS 9.

You certainly can, if you could use some previous version of RB (or
any other language for that matter). RB 5.5 does all that previous
versions could do and more.

Provide more details about what this string-drawing is where
performance is a problem, and perhaps we can suggest ways to
pre-convert your strings to the font encoding so you get better
performance.

Best,
- Joe

Re: Drawing string with accented character
Date: 29.02.04 20:49 (Sun, 29 Feb 2004 20:49:01 +0100)
From: Eric POUSSE

Le 29 févr. 04, à 19:47, Joseph J. Strout a écrit :

> At 3:53 PM +0100 2/29/04, Eric POUSSE wrote:
>
>> but can I accelerate the drawing or not ?
>
> It depends on what you're doing.

It is for my program RealCADD. So I simply draw string and other
objects.

>
>> Because as now, I can't use RB 5.5 to do this under Mac OS 9.
>
> You certainly can, if you could use some previous version of RB (or
> any other language for that matter). RB 5.5 does all that previous
> versions could do and more.

Yes, RB 4.5 draws string with accented characters or not at the same
speed.
Not RB 5.5. I can see that when I scroll the drawing.

>
> Provide more details about what this string-drawing is where
> performance is a problem, and perhaps we can suggest ways to
> pre-convert your strings to the font encoding so you get better
> performance.

It is a problem of encoding, because the problem appear only with
drawing that I save and read, not with new document.
To be compatible with old RealCADD files or old version of RealCADD, I
write objects string in file with encoding MacRoman.
So before drawing a string I have tried :
L_Text = ConvertEncoding(L_Text, Encodings.SystemDefault)
but without result.

>
> Best,
> - Joe

Cordialement.

Eric

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Drawing string with accented character
Date: 29.02.04 21:23 (Sun, 29 Feb 2004 14:23:39 -0600)
From: Joseph J. Strout
At 8:49 PM +0100 2/29/04, Eric POUSSE wrote:

>Yes, RB 4.5 draws string with accented characters or not at the same speed.

That's because the encoding of your strings in RB 4.5 is ill-defined,
but assumed to be the system encoding. In 5.5 your strings are
explicitly compiled as UTF-8.

>It is a problem of encoding, because the problem appear only with
>drawing that I save and read, not with new document.

Ah, that's a good clue.

>To be compatible with old RealCADD files or old version of RealCADD,
>I write objects string in file with encoding MacRoman.

Good plan. But you may not be aware that there are several different
variations of MacRoman. Perhaps you have the wrong one. Use
GetFontTextEncoding to get the encoding associated with the font
you're drawing in, and use that instead.

>So before drawing a string I have tried :
>L_Text = ConvertEncoding(L_Text, Encodings.SystemDefault)
>but without result.

Well, doing this right before you draw wouldn't help, because either
it does nothing (because your strings are already in the system
default), or it does a conversion (which would be done internally by
DrawString anyway). You need to do it further up in the chain,
actually storing the strings in the encoding that they'll be drawn in
(which depends on the font).

Best,
- Joe