Comment() - displays information in proportional font on the chart, but has difficulties with formatting tables, for example.
How can I display the information on the chart in monospaced font using Comment()?
OnlyOBJ_LABEL
- www.mql5.com
What determines the font in Comment?
Not really understood, but it seems to take the system settings of the OS
Didn't really understand it, but it seems to take the system settings of the OS
It seems to be a Terminal font and apparently it's really unrealistic to tamper with.
that's what you were told, output it yourself, and in any place and in any font, find a monospace font in the winds
cut it out of the software live, I think you can figure it out.
bool CreateLabel(string name,int x,int y=10) { if(!ObjectCreate(0,name,OBJ_LABEL,0,0,0)) return false;; ObjectSetInteger(0,name,OBJPROP_ANCHOR,ANCHOR_LEFT_LOWER); ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_LOWER); ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x); ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y); ObjectSetInteger(0,name,OBJPROP_FONTSIZE,FontSize); ObjectSetInteger(0,name,OBJPROP_COLOR,FontColor); ObjectSetInteger(0,name,OBJPROP_SELECTABLE,true); ObjectSetString(0,name,OBJPROP_FONT,FontName); ChartRedraw(); return true; } // где-то выводим строку с именем ObjectSetString(0,"SIP_"+lNames[2],OBJPROP_TEXT,lNames[2]+DoubleToString(sprd,_Digits)+", RealSpread="+DoubleToString(Ask-Bid,_Digits));
**
that's what you were told, output it yourself, and in any place and in any font, find a monospace font in the winds
cut it out of the software live, I think you can figure it out.
**
Thanks, Alexey! I don't have a problem with outputting graphical fonts. Thought I could fix the system fonts somehow.
Thanks, Alexey! I have no problems with the output of graphical fonts. Thought there might be a way to tweak the system fonts.
Ah, well, I'll pass.
Comment() - displays information in proportional font on the chart, but has difficulties with formatting tables, for example.
How can I display the information on the chart in monospaced font with Comment()?
You can measure the width of each character in piskels (there will be several groups with the same width). Write a function that will append any string with spaces until it reaches a given width. Then assemble comment from these substrings.
If you make such function, post it in kodobase, many will thank you. And me too. I'm too lazy to bother myself.
In this case, symbol \x200A would be useful - minimum width of the space, for an exact fit. And replace regular spaces with symbol /1 - wide space (after all, the length of the comment is limited). Maybe other spaces are useful, but I don't know them.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Comment() - displays information in proportional font on the chart, but has difficulties with formatting tables, for example.
How can I display the information on the chart in monospaced font using Comment()?