MCPcopy Create free account
hub / github.com/defold/defold / CreateTextLayout

Function CreateTextLayout

engine/render/src/test/test_render.cpp:99–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99static HTextLayout CreateTextLayout(dmRender::HFontMap font_map, const char* text, const TextLayoutSettings& settings)
100{
101 dmArray<uint32_t> codepoints;
102 TextToCodePoints(text, codepoints);
103
104 TextLayoutSettings layout_settings = settings;
105 HTextLayout layout = 0;
106 TextResult r = TextLayoutCreate(dmRender::GetFontCollection(font_map), codepoints.Begin(), codepoints.Size(), &layout_settings, &layout);
107 EXPECT_EQ(TEXT_RESULT_OK, r);
108 EXPECT_NE((HTextLayout)0, layout);
109 return layout;
110}
111
112static uint32_t QueueTextAndCopyVertices(dmRender::HRenderContext render_context, dmRender::HFontMap font_map, const dmRender::DrawTextParams& params, dmArray<uint8_t>& out_vertices, HTextLayout* out_layout, float* out_radius_sq)
113{

Callers 1

TEST_FFunction · 0.85

Calls 5

TextToCodePointsFunction · 0.85
TextLayoutCreateFunction · 0.85
GetFontCollectionFunction · 0.85
BeginMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected