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 strncpy(font_to_find.lfFaceName, fontname,
sizeof(font_to_find.lfFaceName) - 1);
44 font_to_find.lfFaceName[
sizeof(font_to_find.lfFaceName) - 1] =
'\0';
45 font_to_find.lfPitchAndFamily = 0;
47 if (EnumFontFamiliesExA(reference.
hdc,
52 found_font.lfHeight = (LONG)-fontsize;
53 found_font.lfWidth = 0;
54 font = std::make_unique<Font>(reference.
hdc, &found_font);
57 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)