__Graphics.DrawString

Suggestions and bug reports forum for Ams Plugin Maker
Post Reply
User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

__Graphics.DrawString

Post by Ygen » Thu Jan 16, 2020 10:17 pm

__Graphics.DrawString incorrectly draws russian text (CP_1251).

User avatar
Serkan
Developer
Developer
Posts: 205
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan » Sat Jan 18, 2020 9:09 pm

What did you mean by incorrectly ?
It draws nothing at all , or partial ?
It uses default codepage therefore if your pc default language is not Russian then this might happen
But this is a common issue with ANSI applications ,since the data (string) comes from an ANSI built application
Plugins or modules have nothing to do more , unfortunately

User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

Post by Ygen » Sat Jan 18, 2020 10:29 pm

Hello!
Thanks for the answer.
My computer is set to Russian by default.
I tested MetroCheсkBox example, and it displays Russian text in Western European encoding instead of Cyrillic.
Attachments
123.png

User avatar
Serkan
Developer
Developer
Posts: 205
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan » Sun Jan 19, 2020 11:29 am

Can you copy the Graphics.a within the attached zip file
to follwing path and try again ?

Code: Select all

{ProgramFiles}\AmsPluginMaker\Data\Modules\Graphics
Attachments
Graphics.zip
(44.32 KiB) Downloaded 12 times

User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

Post by Ygen » Sun Jan 19, 2020 1:52 pm

Thanks so much for the fix!)
A small bug.
Incorrect display of the Wingdings font.
Attachments
12345.png

User avatar
Serkan
Developer
Developer
Posts: 205
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan » Sun Jan 19, 2020 2:41 pm

Try replacing the "ü" with

Code: Select all

tostring("\252")
withing the scope of following line

Code: Select all

if(m_Checked == true) then

User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

Post by Ygen » Sun Jan 19, 2020 3:13 pm

Code: Select all

__Graphics.DrawString(graphics,brs_check,tostring("\252"),Width-corner_size,0,corner_size,corner_size,"Wingdings",20,FontStyleBold,StringAlignmentFar,StringAlignmentNear);
Still displayed incorrectly, nothing has changed.

Note: Before replacing the graphics.a module, the Wingdings font was displayed correctly, see the first screenshot.

User avatar
Serkan
Developer
Developer
Posts: 205
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan » Sun Jan 19, 2020 7:33 pm

For now you can use a 16x16 png icon for that
The internal text conversion function takes a code page attribute and ,it requires CP_SYMBOL to be specified in order to display charaters from symbolic fonts

You can also use GDI functions to draw symbols as well ,if you are familiar with it

Maybe i can update this module later for this chage , but it will work perfectly for regular text anyway

User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

Post by Ygen » Sun Jan 19, 2020 7:38 pm

Thank you very much!)

Post Reply