You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
This commit is contained in:
@@ -806,6 +806,40 @@ void RendererCanvasCull::canvas_item_add_texture_rect(RID p_item, const Rect2 &p
|
||||
rect->texture = p_texture;
|
||||
}
|
||||
|
||||
void RendererCanvasCull::canvas_item_add_msdf_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, int p_outline_size, float p_px_range) {
|
||||
Item *canvas_item = canvas_item_owner.getornull(p_item);
|
||||
ERR_FAIL_COND(!canvas_item);
|
||||
|
||||
Item::CommandRect *rect = canvas_item->alloc_command<Item::CommandRect>();
|
||||
ERR_FAIL_COND(!rect);
|
||||
rect->modulate = p_modulate;
|
||||
rect->rect = p_rect;
|
||||
|
||||
rect->texture = p_texture;
|
||||
|
||||
rect->source = p_src_rect;
|
||||
rect->flags = RendererCanvasRender::CANVAS_RECT_REGION | RendererCanvasRender::CANVAS_RECT_MSDF;
|
||||
|
||||
if (p_rect.size.x < 0) {
|
||||
rect->flags |= RendererCanvasRender::CANVAS_RECT_FLIP_H;
|
||||
rect->rect.size.x = -rect->rect.size.x;
|
||||
}
|
||||
if (p_src_rect.size.x < 0) {
|
||||
rect->flags ^= RendererCanvasRender::CANVAS_RECT_FLIP_H;
|
||||
rect->source.size.x = -rect->source.size.x;
|
||||
}
|
||||
if (p_rect.size.y < 0) {
|
||||
rect->flags |= RendererCanvasRender::CANVAS_RECT_FLIP_V;
|
||||
rect->rect.size.y = -rect->rect.size.y;
|
||||
}
|
||||
if (p_src_rect.size.y < 0) {
|
||||
rect->flags ^= RendererCanvasRender::CANVAS_RECT_FLIP_V;
|
||||
rect->source.size.y = -rect->source.size.y;
|
||||
}
|
||||
rect->outline = p_outline_size;
|
||||
rect->px_range = p_px_range;
|
||||
}
|
||||
|
||||
void RendererCanvasCull::canvas_item_add_texture_rect_region(RID p_item, const Rect2 &p_rect, RID p_texture, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, bool p_clip_uv) {
|
||||
Item *canvas_item = canvas_item_owner.getornull(p_item);
|
||||
ERR_FAIL_COND(!canvas_item);
|
||||
|
||||
Reference in New Issue
Block a user