MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / MdLineHeight

Function MdLineHeight

src/windows/TextInterface_Win32.cpp:117–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116int GetProfilePictureSize();
117int MdLineHeight(DrawingContext* context, int styleFlags)
118{
119 int fontId = MdDetermineFontID(styleFlags);
120 if (context->m_cachedHeights[fontId])
121 return context->m_cachedHeights[fontId];
122
123 HDC hdc = context->m_hdc;
124 HFONT font = MdGetFontByID(fontId);
125 HGDIOBJ old = SelectObject(hdc, font);
126 TEXTMETRIC tm{};
127 GetTextMetrics(context->m_hdc, &tm);
128 SelectObject(hdc, old);
129 int ht = tm.tmHeight;
130 context->m_cachedHeights[fontId] = ht;
131 return ht;
132}
133
134int MdSpaceWidth(DrawingContext* context, int styleFlags)
135{

Callers 3

LayoutMethod · 0.85
MdMeasureStringFunction · 0.85
MdDrawStringFunction · 0.85

Calls 2

MdDetermineFontIDFunction · 0.85
MdGetFontByIDFunction · 0.85

Tested by

no test coverage detected