Open howz-chen opened 2 years ago
Hi, you can add new font and adjust the font size there.
You may refer to this:
font_sans_serif = gui.FontDescription(
typeface="sans-serif", style=gui.FontStyle.NORMAL, point_size=28)
font_monospace = gui.FontDescription(
typeface="monospace", style=gui.FontStyle.BOLD, point_size=32)
# Must be run before application.create_window()
font_id_sans_serif = gui.Application.instance.add_font(font_sans_serif)
font_id_monospace = gui.Application.instance.add_font(font_monospace)
text = gui.Label("Some Text ... ")
# Change the font of Label
text.font_id = font_id_sans_serif
# Change the font color of Label
text.text_color = gui.Color(0, 0.396, 0.741)
Checklist
master
branch).My Question
My request is that draw a window and show some text info at the left-top corner of the window, and I use gui.Label('label_name') to realize this. But the text size is too small for the whole window, I checked the document about gui.Label and search the issues and then found that there was no method to adjust text size directly (but there was a method about gui.label3D, but this method not fit my request), so I want to ask is there any method to adjust label text size?
Below is the pseudo-code
And the visualization result like:![Screenshot from 2022-06-21 15-12-29](https://user-images.githubusercontent.com/14069568/174739093-1e3e9d07-680e-44e0-aff7-ac840fe42c07.png)
It seems that text info font size is too small relative to thole window.