Page 1 of 1

__Graphics.DrawString

Posted: Thu Jan 16, 2020 10:17 pm
by Ygen
__Graphics.DrawString incorrectly draws russian text (CP_1251).

Re: __Graphics.DrawString

Posted: Sat Jan 18, 2020 9:09 pm
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

Re: __Graphics.DrawString

Posted: Sat Jan 18, 2020 10:29 pm
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.

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 11:29 am
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

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 1:52 pm
by Ygen
Thanks so much for the fix!)
A small bug.
Incorrect display of the Wingdings font.

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 2:41 pm
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

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 3:13 pm
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.

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 7:33 pm
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

Re: __Graphics.DrawString

Posted: Sun Jan 19, 2020 7:38 pm
by Ygen
Thank you very much!)