From acc6f3b285f058104fd6431bed2c4cfe4dc05a58 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 21 Mar 2015 00:43:33 -0300 Subject: signed distance field font support --- servers/visual/rasterizer.h | 3 ++- servers/visual/visual_server_raster.cpp | 8 ++++++++ servers/visual/visual_server_raster.h | 1 + servers/visual/visual_server_wrap_mt.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) (limited to 'servers/visual') diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 8c89ddd5b7..ebc210fe3d 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -783,6 +783,7 @@ public: CanvasItem* final_clip_owner; CanvasItem* material_owner; ViewportRender *vp_render; + bool distance_field; Rect2 global_rect_cache; @@ -910,7 +911,7 @@ public: } void clear() { for (int i=0;iclip=p_clip; } +void VisualServerRaster::canvas_item_set_distance_field_mode(RID p_item, bool p_distance_field) { + VS_CHANGED; + CanvasItem *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->distance_field=p_distance_field; +} + void VisualServerRaster::canvas_item_set_transform(RID p_item, const Matrix32& p_transform) { diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index b1970c55b3..72af793278 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -1128,6 +1128,7 @@ public: //virtual void canvas_item_set_rect(RID p_item, const Rect2& p_rect); virtual void canvas_item_set_transform(RID p_item, const Matrix32& p_transform); virtual void canvas_item_set_clip(RID p_item, bool p_clip); + virtual void canvas_item_set_distance_field_mode(RID p_item, bool p_enable); virtual void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2()); virtual void canvas_item_set_opacity(RID p_item, float p_opacity); virtual float canvas_item_get_opacity(RID p_item, float p_opacity) const; diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 562b9ffeb0..ded4c6fc00 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -1109,6 +1109,7 @@ public: //FUNC(canvas_item_set_rect,RID, const Rect2& p_rect); FUNC2(canvas_item_set_transform,RID, const Matrix32& ); FUNC2(canvas_item_set_clip,RID, bool ); + FUNC2(canvas_item_set_distance_field_mode,RID, bool ); FUNC3(canvas_item_set_custom_rect,RID, bool ,const Rect2&); FUNC2(canvas_item_set_opacity,RID, float ); FUNC2RC(float,canvas_item_get_opacity,RID, float ); -- cgit v1.2.3