0

The default font used for the Comment("some text") function is not not a fixed-width (aka monotype) and it is often too small.

How can I change the default font used for Comment()?

user3666197
  • 1
  • 6
  • 50
  • 92
not2qubit
  • 14,531
  • 8
  • 95
  • 135

3 Answers3

2

To the best of my belief, there is no way to change font type and size of the Comment() function. If they are too small for you - you have to draw Labels on the chart yourself(even though it might be a bit inconvenient to parse the text looking for "\n" objects in order to go next line).

user3666197
  • 1
  • 6
  • 50
  • 92
Daniel Kniaz
  • 4,603
  • 2
  • 14
  • 20
  • Yes, I already draw and print stuff to the chart, but was hoping to find some windows app setting that would change the font, as it seemed that most other fonts and sizes are available. – not2qubit Nov 05 '19 at 15:36
2

Q : How can I change the default font used for Comment()?

Having used MQL4 since 2007+ there is, so far, no way to change a font used for Comment() (or the graph Time-/Price-axes).


enter image description here

As @Daniel has remarked, there are some chances to build tools to circumvent this trouble.

enter image description here I have used a similarly motivated Comment()-based approach for a text-editor, for a (row,col)-addressable text-screen ( still inside a Comment()-text-block ), for an independent overlay with a (row,col,font,color)-text-screen and last, but not least, years ago I started to use a distributed-computing approach, so as not to remain blocked with the absence of screen-controls for the text-part of the GUI ( having a freedom of using several independent graphical views ( multi-time-frame views, views with AI/ML-analytical post-processing graphing and many others ).

Using the Terminal-GUI for a default look-and-feel is accompanied with any number of "remote"-screens ( implemented in python and other, non-MQL4, domain languages, some HPC-languages on remote computers ) that are used in-sync with the flow of MQL4-processed events.

This is the safest way to work with text-and-graphs in a user-controlled manner.

user3666197
  • 1
  • 6
  • 50
  • 92
  • `... for an independent overlay with a (row,col,font,color)-text-screen.` Sound nice, and would have been interesting to see how it works. The main problem with the *Comment()* is that it is using a variable width font so it's impossible to align text and numbers in columns, without ugly [beep] hacks. Since you mentioned the topic of the *distributed computing approach*, perhaps you could point to some useful resources how to start using that (integrating with MT4/5)? – not2qubit Nov 05 '19 at 15:44
2

If you are happy to change the default font for everything (not just comments) you can modify

#define CONTROLS_FONT_NAME                  "Tahoma"
#define CONTROLS_FONT_SIZE                  (8)//changed from 12

in the defines.mqh file.

Dilan
  • 2,610
  • 7
  • 23
  • 33
  • Cool, if it is indeed working, not only for { TimeDOMAIN, PriceDOMAIN }-axes, but also for Comment()-driven part of the GUI and/or other flying-cursor texts. ***A fair note*** is, that this feature **was not present in MQL4 language for many years, almost for ages** *and that it has first appeared in Build X.YZUV until 2020....* Would you add that to the answer, so as to make it fair & complete? – user3666197 Sep 04 '20 at 11:41