Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Display an Unicode Display

0 views
Skip to first unread message

Emmanuel Derriey

unread,
Jan 25, 1999, 3:00:00 AM1/25/99
to
Hi !
I sent a question last week about the way to display the Euro symbol. There
was many answers and I thank all persons who had helped me. I checkout the
font which contains the Euro symbol in $20AC in unicode table. Here is my
code :
procedure TMyForm.Paint;
var
wc : array[0..1] of WideChar;
begin
Canvas.Font := 'Tahoma';
wc[0] := #8364; // $20ac
wc[1] := #0;
TextOutW(Canvas.Handle, 10, 10, wc, 1);
end;

It works under Windows NT but not unser Windows 95 (I have not tested under
Win98).
Could someone help me ?

--
Emmanuel Derriey.
Windows Software Developer.

e-mail : mder...@hotmail.com


Piotr Trzcionkowski

unread,
Jan 25, 1999, 3:00:00 AM1/25/99
to
Mon, 25 Jan 1999 14:00:51 +0100, "Emmanuel Derriey"
<jpla...@aibtp.alienor.fr> napisał(a):

>I sent a question last week about the way to display the Euro symbol. There
>was many answers and I thank all persons who had helped me. I checkout the
>font which contains the Euro symbol in $20AC in unicode table. Here is my
>code :
>procedure TMyForm.Paint;
>var
> wc : array[0..1] of WideChar;
>begin
> Canvas.Font := 'Tahoma';

you could try setting this font by unicode function

> wc[0] := #8364; // $20ac

wc[0]:=#$20ac;

> wc[1] := #0;
> TextOutW(Canvas.Handle, 10, 10, wc, 1);
>end;
>
>It works under Windows NT but not unser Windows 95 (I have not tested under
>Win98).
>Could someone help me ?

are you sure you have euro symbol in w95 font ? i think you don't, so
you can't use it, in word from office 97 you have "insert character"
or similar, try its,

i think when you have updated fonts and nls'es you can use ansi euro

Emmanuel Derriey

unread,
Jan 26, 1999, 3:00:00 AM1/26/99
to
I found the solution !
In fact, the DrawTextW function doesn't work under Win95 but the TextOutW
API does !!! So, if you have problem with DrawText (in genenral because it
is NOT the only one problem), use TextOut !!!

VBDis

unread,
Jan 28, 1999, 3:00:00 AM1/28/99
to

Im Artikel <78hpug$jg5$1...@ai.alienor.fr>, "Emmanuel Derriey"
<jpla...@aibtp.alienor.fr> schreibt:

>Could someone help me ?

Most Win95 controls only support 8 bit strings. Try to Paint the string
directly on a hDC (e.g. Canvas.Handle) with one of the few TextOut...W
functions, available in Win95. Otherwise the character can get lost with some
TextOut...A function.

It would be nice to have a TLabelW or TEditW component, perhaps you create one
if you succeed? It should be sufficient to override the Caption with a wide
string type, and the Paint procedure with code, that uses the Unicode TextOut
function.

DoDi

Andreas Hoerstemeier

unread,
Jan 28, 1999, 3:00:00 AM1/28/99
to
VBDis <vb...@aol.com> wrote:
> It would be nice to have a TLabelW or TEditW component, perhaps you create one
> if you succeed? It should be sufficient to override the Caption with a wide
> string type, and the Paint procedure with code, that uses the Unicode TextOut
> function.
The TLabelW isn't that complicated, however a TEditW would need more as
Windows itself keeps the caption of the edit and also performs the drawing, thus
the Windows control itself must be a unicode one. And to have this nearly
every internal routine which does something with strings must be converted,
so it wouldn't ever work with Win'95 (98?) - and of course you'd need to do
a lot of VCL code copy to get it working. You can however fake this a bit
by using the WideCharToMultiByte and MultiByteToWideChar API calls and let
the edit itself work with the local ANSI codepage. As long as you don't need
more than this local codepage this is a nice workaround.

Bye,
Andy

--
Andreas Hoerstemeier
email: an...@scp.de (work)
an...@hoerstemeier.de (home)
www: http://www.hoerstemeier.com

0 new messages