| 132 | } |
| 133 | |
| 134 | int MdSpaceWidth(DrawingContext* context, int styleFlags) |
| 135 | { |
| 136 | int fontId = MdDetermineFontID(styleFlags); |
| 137 | if (context->m_cachedSpaceWidths[fontId]) |
| 138 | return context->m_cachedSpaceWidths[fontId]; |
| 139 | |
| 140 | HDC hdc = context->m_hdc; |
| 141 | HFONT font = MdGetFontByID(fontId); |
| 142 | HGDIOBJ old = SelectObject(hdc, font); |
| 143 | ABC abc{}; |
| 144 | BOOL res = false;// GetCharABCWidths(hdc, ' ', ' ', &abc); |
| 145 | SelectObject(hdc, old); |
| 146 | int wd = abc.abcA + abc.abcB + abc.abcC; |
| 147 | |
| 148 | if (!res) { |
| 149 | INT sz = 0; |
| 150 | GetCharWidth32(hdc, ' ', ' ', &sz); |
| 151 | wd = sz; |
| 152 | } |
| 153 | |
| 154 | context->m_cachedSpaceWidths[fontId] = wd; |
| 155 | return wd; |
| 156 | } |
| 157 | |
| 158 | void MdDrawString(DrawingContext* context, const Rect& rect, const String& str, int styleFlags) |
| 159 | { |
no test coverage detected