How to draw Unicode text on TCustomControl? Are there other options to make it without the Canvas?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you are right on spot. Still, I would recommend you to upgrade to Delphi 2009 or later in which the VCL has full Unicode support and everything is much easier.
Anyhow, you can do
in old versions of Delphi (I think. The code compiles in Delphi 7 in my virtual Windows 95 machine, but I see no text. That is because Windows 95 is too old, I think.)
Update
If you want to support very old operating systems, like Windows 95 and Windows 98, you need to use
TextOutWinstead ofDrawTextW, since the latter isn’t implemented (source).TextOutis less powerful thenDrawText, so you need to compute the position manually if you want to center the text inside a rectangle, for instance.