Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
| 3998 | |
| 3999 | // Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound. |
| 4000 | void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const |
| 4001 | { |
| 4002 | const ImFontGlyph* glyph = FindGlyph(c); |
| 4003 | if (!glyph || !glyph->Visible) |
| 4004 | return; |
| 4005 | if (glyph->Colored) |
| 4006 | col |= ~IM_COL32_A_MASK; |
| 4007 | float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f; |
| 4008 | float x = IM_TRUNC(pos.x); |
| 4009 | float y = IM_TRUNC(pos.y); |
| 4010 | draw_list->PrimReserve(6, 4); |
| 4011 | draw_list->PrimRectUV(ImVec2(x + glyph->X0 * scale, y + glyph->Y0 * scale), ImVec2(x + glyph->X1 * scale, y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col); |
| 4012 | } |
| 4013 | |
| 4014 | // Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound. |
| 4015 | void ImFont::RenderText(ImDrawList* draw_list, float size, const 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