Duyck

Unicode font function - JD

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.

Disclaimer.
I AM NOT A FINANCIAL ADVISOR.
THESE IDEAS ARE NOT ADVICE AND ARE FOR EDUCATION PURPOSES ONLY.
ALWAYS DO YOUR OWN RESEARCH!
JD.

You can contact me for info/access in PM or on Telegram: @jduyck
PLS, DON'T ASK FOR ACCESS IN THE COMMENT SECTION!
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?