An instrument draws in its own pixel size. The panel scales the finished picture. Colors and type are chosen in that instrument space.
Colors
Draw calls take a hex color. Text can take the same color in its style string.
_fill("#14181e")
_stroke("#e23b3b", 3)
_txt("120", "size:14; color:#e8eaee; halign:center;", x, y)
The altimeter sample uses the older style string on txt_add:
txt_add("----", "-fx-font-size:18pt; -fx-fill:#f2f2f2; -fx-font-weight:bold;", 140, 248, 120, 28)
Fonts
Name the family in the style string. The font has to be installed on the computer running Studio or Panel.
_txt("ALT", "font:Roboto; size:14; color:#e8eaee;", x, y)
Free fonts to start with:
- Google Fonts — Roboto, Inter, and the rest of the catalog. Download the family and install it.
- DaFont — display and instrument-style faces. Check the license on the font before you ship an instrument.
A face you use in a community instrument should be one you can redistribute, or one you tell the downloader to install.