Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
| 3524 | |
| 3525 | // Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound. |
| 3526 | void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const |
| 3527 | { |
| 3528 | const ImFontGlyph* glyph = FindGlyph(c); |
| 3529 | if (!glyph || !glyph->Visible) |
| 3530 | return; |
| 3531 | if (glyph->Colored) |
| 3532 | col |= ~IM_COL32_A_MASK; |
| 3533 | float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f; |
| 3534 | pos.x = IM_FLOOR(pos.x); |
| 3535 | pos.y = IM_FLOOR(pos.y); |
| 3536 | draw_list->PrimReserve(6, 4); |
| 3537 | draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col); |
| 3538 | } |
| 3539 | |
| 3540 | // Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound. |
| 3541 | void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const |
no test coverage detected