Jump to content

Recommended Posts

Posted (edited)

Hi all,

I am up to change the font of a rich edit control. I need to set an unicode font(Malayalam). But the code doesn't working.

see this.

Global $EditMallu = _GUICtrlRichEdit_Create ($FormM2M,"", 520, 37, 489, 417)
_GUICtrlRichEdit_SetText ($EditMallu, "]co£Ww")
_GUICtrlRichEdit_SetFont ($EditMallu, 14, "MLTTRevathi")
;GUICtrlSetColor($EditMallu, 0x0000FF)
_GUICtrlRichEdit_SetEventMask($EditMallu, "EditMalluChange")

Original name of that font is this = "ML-TTRevathi". What is wrong with it ?

Edit - I can't change the font color too.

Edited by kcvinu
  Reveal hidden contents

 

Posted

When you change the font, what isn't working? Also, have you set the LCID parameter to Malayalam? First number is hex, second is Dec.

Malayalam044c1100

 

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted (edited)

@BrewManNH See the code in my first post. In line number 2, you can see a strange text in red color. That text is in malayalam. Why it is showing like that because the font in the browser is English font. But i have programatically changed my RTB font to a malayalam font. And then i can;t see the right malayalam letters in RTB. I can only see the text as same as shown in this browser. 

 

Edited by kcvinu
  Reveal hidden contents

 

Posted

Try using the font name MLW-TTREVATHI, the font packs I've found that list it as ML-TTREVATHI actually have the font name with the W in it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted (edited)

@BrewManNH , No way. Interesting thing to notice. I have another controls in my form. Say a button. I set my button's font to "ML-TTRevathy". It is working. It shows the font properly. So only RichEdit control has the problem. 

 

Edit - Tested with LCID. But no way. 

Second Edit - I have thested it with _GUICtrlRichEdit_GetFont  function. It says the font is "MS Shell Dlg". Why ?

Edited by kcvinu
  Reveal hidden contents

 

Posted (edited)

btw.

_GUICtrlRichEdit_SetEventMask($EditMallu, "EditMalluChange")

You are using this function in a wrong way.

The second parameter must bu number.
If you try to add

_GUICtrlRichEdit_SetEventMask($EditMallu, "EditMalluChange")
If @error Then MsgBox(0, '@error', @error)

Then I'm sure you get 102 in MsgBox.

 

 

EDIT:

Try also:

Global $EditMallu = _GUICtrlRichEdit_Create($FormM2M,"", 520, 37, 489, 417)

_GUICtrlRichEdit_SetFont($EditMallu, 14, "MLTTRevathi")
If @error Then MsgBox(0, '_GUICtrlRichEdit_SetFont @error', @error)
_GUICtrlRichEdit_SetText($EditMallu, "]co£Ww")
If @error Then MsgBox(0, '_GUICtrlRichEdit_SetText @error', @error)

;GUICtrlSetColor($EditMallu, 0x0000FF)
_GUICtrlRichEdit_SetEventMask($EditMallu, "EditMalluChange")
If @error Then MsgBox(0, '_GUICtrlRichEdit_SetEventMask @error', @error)

 

Did you get additional @error messages ?

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@mLipok , No, i don't get any error messages. And you are right. the event mask function is wrong. But That is not my issue. 

  Reveal hidden contents

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...