How to set font style for OBJ_LABEL

 

Hello everyone,

I am trying to set font style for an object label like italic? I found TextSetFont() function, but not sure how to use it with OBJ_LABEL.

Thank you in advance.

 
OBJ_LABEL - MQL4 Documentation
contains:
input string            InpFont="Arial";         // Font
Try reading it.
 
aquarchitecture:



Thank for getting back to me. Actually, I did read this page; however I could not find any helpful information for my problem. Can you be more specific which lines could help me to solve the problem?


//--- set text font
   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);
 
aquarchitecture:

Hello everyone,

I am trying to set font style for an object label like italic? I found TextSetFont() function, but not sure how to use it with OBJ_LABEL.

Thank you in advance.


Had a look and it seems that TextSetFont() doesn't work

I cannot see any other way in the documentation to do what you want. :(

 
GumRai:


Had a look and it seems that TextSetFont() doesn't work

I cannot see any other way in the documentation to do what you want. :(

He can do what he wants with an italic font. There is no "style" for font in MT4.
 
angevoyageur:
He can do what he wants with an italic font. There is no "style" for font in MT4.

Op is looking for example code to make a font appear in its italic state. He calls it style, well because MetaTrader documentation is calling it a style too.

https://docs.mql4.com/objects/textsetfont

fontstyle

I would help, but I tried and can't get it to work either.

 
JPS:

Op is looking for example code to make a font appear in its italic state. He calls it style, well because MetaTrader documentation is calling it a style too.

https://docs.mql4.com/objects/textsetfont

I would help, but I tried and can't get it to work either.



Ok, it seems you are right, but I can't find a way to use that with a OBJ_LABEL.
 
Hai Nguyen:

Hello everyone,

I am trying to set font style for an object label like italic? I found TextSetFont() function, but not sure how to use it with OBJ_LABEL.

Thank you in advance.

Hello. I see this is from some years ago but I just ran into this myself and figured out the solution.

Just simply use a font type which is already in Bold format and define it into a string variable.

for example:

//--Set Bold Font Type

string FontType = "Calibri Bold";

Reason: