mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-02 13:04:49 +00:00
Added a function to scale the font size according to preferences.
The scale will be calculated in relation to the system dpi and Blender's interface resolution scale.
This commit is contained in:
@@ -1155,3 +1155,12 @@ class Blender(bonsai.core.tool.Blender):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
return sun_position
|
return sun_position
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def scale_font_size(cls, size):
|
||||||
|
default_dpi = 72
|
||||||
|
default_pixel_size = 1.0
|
||||||
|
default_scale = (default_dpi * default_pixel_size)
|
||||||
|
system = bpy.context.preferences.system
|
||||||
|
system_scale = (system.dpi * system.pixel_size)
|
||||||
|
return (system_scale / default_scale) * size
|
||||||
|
|||||||
Reference in New Issue
Block a user