__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 »

__Graphics.DrawString incorrectly draws russian text (CP_1251).
User avatar
Serkan
Developer
Developer
Posts: 214
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan »

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 »

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: 214
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan »

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 230 times
User avatar
Ygen
Registered User
Posts: 5
Joined: Thu Jan 16, 2020 9:50 pm

Post by Ygen »

Thanks so much for the fix!)
A small bug.
Incorrect display of the Wingdings font.
Attachments
12345.png
User avatar
Serkan
Developer
Developer
Posts: 214
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan »

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 »

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: 214
Joined: Thu Jul 04, 2013 8:44 pm
Location: Windows.h
Contact:

Post by Serkan »

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 »

Thank you very much!)
Post Reply