diff --git a/src/Autoload/Themes.gd b/src/Autoload/Themes.gd index 0fa2bd6cf..9128c33a8 100644 --- a/src/Autoload/Themes.gd +++ b/src/Autoload/Themes.gd @@ -94,3 +94,9 @@ func get_font() -> Font: if Global.control.theme.has_default_font(): return Global.control.theme.default_font return ThemeDB.fallback_font + + +func get_font_size() -> int: + if Global.control.theme.has_default_font_size(): + return Global.control.theme.default_font_size + return ThemeDB.fallback_font_size diff --git a/src/UI/Canvas/Rulers/Guide.gd b/src/UI/Canvas/Rulers/Guide.gd index b97c50323..2cdeeae55 100644 --- a/src/UI/Canvas/Rulers/Guide.gd +++ b/src/UI/Canvas/Rulers/Guide.gd @@ -124,7 +124,7 @@ func _draw() -> void: string, HORIZONTAL_ALIGNMENT_LEFT, -1, - 16, + Themes.get_font_size(), color ) else: @@ -134,7 +134,7 @@ func _draw() -> void: string, HORIZONTAL_ALIGNMENT_LEFT, -1, - 16, + Themes.get_font_size(), color ) return @@ -149,7 +149,13 @@ func _draw() -> void: < intersection.distance_squared_to(viewport_poly[0]) ): draw_string( - font, Vector2(x_offset, y_offset), string, HORIZONTAL_ALIGNMENT_LEFT, -1, 16, color + font, + Vector2(x_offset, y_offset), + string, + HORIZONTAL_ALIGNMENT_LEFT, + -1, + Themes.get_font_size(), + color ) else: draw_string( @@ -158,7 +164,7 @@ func _draw() -> void: string, HORIZONTAL_ALIGNMENT_LEFT, -1, - 16, + Themes.get_font_size(), color ) return @@ -179,7 +185,7 @@ func _draw() -> void: string, HORIZONTAL_ALIGNMENT_LEFT, -1, - 16, + Themes.get_font_size(), color ) else: @@ -189,7 +195,7 @@ func _draw() -> void: string, HORIZONTAL_ALIGNMENT_LEFT, -1, - 16, + Themes.get_font_size(), color ) return @@ -197,7 +203,13 @@ func _draw() -> void: # If there's no intersection with a viewport edge, show string in top left corner draw_set_transform(viewport_poly[0], Global.camera.rotation, Vector2(2.0, 2.0) / zoom) draw_string( - font, Vector2(x_offset, font_height), string, HORIZONTAL_ALIGNMENT_LEFT, -1, 16, color + font, + Vector2(x_offset, font_height), + string, + HORIZONTAL_ALIGNMENT_LEFT, + -1, + Themes.get_font_size(), + color ) diff --git a/src/UI/Canvas/Rulers/HorizontalRuler.gd b/src/UI/Canvas/Rulers/HorizontalRuler.gd index 988f30267..e08ef25d2 100644 --- a/src/UI/Canvas/Rulers/HorizontalRuler.gd +++ b/src/UI/Canvas/Rulers/HorizontalRuler.gd @@ -91,7 +91,10 @@ func _draw() -> void: draw_string( font, Vector2(pos.x + RULER_WIDTH + 2, font.get_height() - 4), - str(snappedf(val, 0.1)) + str(snappedf(val, 0.1)), + HORIZONTAL_ALIGNMENT_LEFT, + -1, + Themes.get_font_size() ) else: if j % minor_subdivision == 0: diff --git a/src/UI/Canvas/Rulers/VerticalRuler.gd b/src/UI/Canvas/Rulers/VerticalRuler.gd index 6911cfff2..fcc11961c 100644 --- a/src/UI/Canvas/Rulers/VerticalRuler.gd +++ b/src/UI/Canvas/Rulers/VerticalRuler.gd @@ -86,7 +86,14 @@ func _draw() -> void: var text_xform := Transform2D(-PI / 2, Vector2(font.get_height() - 4, pos.y - 2)) draw_set_transform_matrix(get_transform() * text_xform) var val := ((ruler_transform * major_subdivide * minor_subdivide) * Vector2(0, j)).y - draw_string(font, Vector2(), str(snappedf(val, 0.1))) + draw_string( + font, + Vector2(), + str(snappedf(val, 0.1)), + HORIZONTAL_ALIGNMENT_LEFT, + -1, + Themes.get_font_size() + ) draw_set_transform_matrix(get_transform()) else: if j % minor_subdivision == 0: