BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TNT controls, ExtTextOutW and Greek

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi (General)
View previous topic :: View next topic  
Author Message
Tony Webster
Guest





PostPosted: Tue Jul 20, 2004 11:13 am    Post subject: TNT controls, ExtTextOutW and Greek Reply with quote



I am currently using the excellent TNT controls to convert an application
to multi-language support:

http://tnt.ccci.org/delphi_unicode_controls/


However, I have run into a particular problem with Greek and the
TNT DBGrid - although I don't think it is a problem with the TNT
controls per se. What happens is that the Greek text comes out as
blocks.

I traced this down to the following call to ExtTextOutW in unit
TNTGraphics:

Windows.ExtTextOutW(Handle, X, Y, Options, @Rect, PWideChar(Text),
Length(Text), nil);

I found with Greek that if I change "Length(Text)" to "Length(Text)+1"
then the Greek text comes out okay - however other text can acquire a
spurious character at the end.

For example, for the string "ΑΘΗΝΑ" the memory
at Text looks like this:

$91 $03 $98 $03 $97 $03 $9D $03 $91 $03 $00 $00

This looks much as I would expect (see http://www.unicode.org/charts/PDF/U0370.pdf)
10 bytes of text, with a null character just beyond the end, and
Length(Text) returns 5 above. However, if I want this to display
properly, I seem to need to pass 6 as the length parameter to
Windows.ExtTextOutW.

Can anyone explain what is happening here?

Thanks,

Tony
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi (General) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.