1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +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:
bruvzg
2020-12-27 15:30:33 +02:00
parent 00268e37a0
commit 4c3f7d1290
130 changed files with 17847 additions and 6893 deletions

View File

@@ -541,6 +541,14 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend
src_rect = Rect2(0, 0, 1, 1);
}
if (rect->flags & CANVAS_RECT_MSDF) {
push_constant.flags |= FLAGS_USE_MSDF;
push_constant.msdf[0] = rect->px_range; // Pixel range.
push_constant.msdf[1] = rect->outline; // Outline size.
push_constant.msdf[2] = 0.f; // Reserved.
push_constant.msdf[3] = 0.f; // Reserved.
}
push_constant.modulation[0] = rect->modulate.r * base_color.r;
push_constant.modulation[1] = rect->modulate.g * base_color.g;
push_constant.modulation[2] = rect->modulate.b * base_color.b;