34 int len = strlen(
string);
36 text.resize(MultiByteToWideChar(CP_UTF8, 0,
string,
len, &
text[0],
len));
41 LOGFONTA font_to_find;
42 font_to_find.lfCharSet = ANSI_CHARSET;
43 size_t font_len = strlen(fontname);
44 if (font_len >
sizeof(font_to_find.lfFaceName) - 1) {
45 font_len =
sizeof(font_to_find.lfFaceName) - 1;
47 memcpy(font_to_find.lfFaceName, fontname, font_len);
48 font_to_find.lfFaceName[
sizeof(font_to_find.lfFaceName) - 1] =
'\0';
49 font_to_find.lfPitchAndFamily = 0;
51 if (EnumFontFamiliesExA(reference.
hdc,
56 found_font.lfHeight = (LONG)-fontsize;
57 found_font.lfWidth = 0;
58 font = std::make_unique<Font>(reference.
hdc, &found_font);
61 font = std::make_unique<Font>(FontFamily::GenericSerif(), fontsize);
static int CALLBACK fetch_first_font(const LOGFONTA *logFont, const TEXTMETRICA *, DWORD, LPARAM lParam)
static gvtextlayout_engine_t gdiplus_textlayout_engine
void gdiplus_free_layout(void *layout)
bool gdiplus_textlayout(textspan_t *span, char **)
gvplugin_installed_t gvtextlayout_gdiplus_types[]
double yoffset_centerline
void(* free_layout)(void *layout)