Pinescript only allows the use of one type of font in texts and label, which causes some inconveniences:
- It's hard to make a label or text "look nice" and clear because it's not possible to use a different font for titles, etc.
- Because the default Pinescript font is not a monospaced font, (in Pinescript different characters have different widths) this makes it really difficult to align things in a label on different rows and causes everything to be "all over the place" and look messy
With the workaround in this script, you can "translate" the text string that you want to put in a label into a text with either upper case, bold and/or italic characters, allowing for more control over the layout of the label text, by adding differently styled titles, control over spacing for columns, etc...
The characters provided in this script are an example of a monospaced font, but can easily be replaced by copy-pasting in other characters in the appropriate section and the script will then use the new characters as replacements.
This script is to show the possibilities and principles of the functions. The principles of this framework can be used to build your own go-to "text style conversion" functions, for styles that you use a lot, for example for titles.
A big shoutout to DonovanWall, for the awesome character replacement idea that I built upon!!! A shoutout also to the PineCoders community, who provide an infinite source of knowlegde and inspiration!!
Enjoy!
Gr, JD.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
차트에서 빠르게 액세스하려면 이 스크립트를 즐겨찾기에 추가하세요 — 여기에서 자세히 알아보기.