windows get-face-list
svn: r41
This commit is contained in:
parent
0f835f2003
commit
d878d6d8de
|
@ -1016,17 +1016,17 @@ static int indirect_strcmp(const void *a, const void *b)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int mono_only;
|
int mono_only;
|
||||||
int count, size;
|
int count, size;
|
||||||
char **names;
|
mzchar **names;
|
||||||
} gfData;
|
} gfData;
|
||||||
|
|
||||||
static int CALLBACK get_font(ENUMLOGFONT FAR* lpelf,
|
static int CALLBACK get_font(ENUMLOGFONTW FAR* lpelf,
|
||||||
NEWTEXTMETRIC FAR* lpntm,
|
NEWTEXTMETRICW FAR* lpntm,
|
||||||
DWORD type,
|
DWORD type,
|
||||||
LPARAM _data)
|
LPARAM _data)
|
||||||
{
|
{
|
||||||
gfData *data = (gfData *)_data;
|
gfData *data = (gfData *)_data;
|
||||||
int l;
|
long ulen;
|
||||||
char *s;
|
mzchar *s;
|
||||||
|
|
||||||
if (data->mono_only) {
|
if (data->mono_only) {
|
||||||
/* TMPF_FIXED_PITCH flag means not monospace */
|
/* TMPF_FIXED_PITCH flag means not monospace */
|
||||||
|
@ -1036,17 +1036,18 @@ static int CALLBACK get_font(ENUMLOGFONT FAR* lpelf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->count == data->size) {
|
if (data->count == data->size) {
|
||||||
char **naya;
|
mzchar **naya;
|
||||||
|
|
||||||
data->size += (2 * data->size) + 10;
|
data->size += (2 * data->size) + 10;
|
||||||
naya = new char*[data->size];
|
naya = new mzchar*[data->size];
|
||||||
memcpy(naya, data->names, data->count * sizeof(char *));
|
memcpy(naya, data->names, data->count * sizeof(mzchar *));
|
||||||
data->names = naya;
|
data->names = naya;
|
||||||
}
|
}
|
||||||
|
|
||||||
l = strlen(lpelf->elfLogFont.lfFaceName);
|
s = scheme_utf16_to_ucs4(lpelf->elfLogFont.lfFaceName, 0,
|
||||||
s = new char[l + 1];
|
wx_wstrlen(lpelf->elfLogFont.lfFaceName),
|
||||||
memcpy(s, lpelf->elfLogFont.lfFaceName, l);
|
0, 0, &ulen, 1);
|
||||||
|
s[ulen] = 0;
|
||||||
|
|
||||||
data->names[data->count++] = s;
|
data->names[data->count++] = s;
|
||||||
|
|
||||||
|
@ -1189,7 +1190,7 @@ static Scheme_Object *wxSchemeGetFontList(int argc, Scheme_Object **argv)
|
||||||
|
|
||||||
dc = GetDC(NULL);
|
dc = GetDC(NULL);
|
||||||
|
|
||||||
EnumFontFamilies(dc, NULL, (FONTENUMPROC)get_font, (LPARAM)&data);
|
EnumFontFamiliesW(dc, NULL, (FONTENUMPROCW)get_font, (LPARAM)&data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -1241,7 +1242,11 @@ static Scheme_Object *wxSchemeGetFontList(int argc, Scheme_Object **argv)
|
||||||
#ifdef wx_msw
|
#ifdef wx_msw
|
||||||
if (i >= data.count)
|
if (i >= data.count)
|
||||||
break;
|
break;
|
||||||
s = data.names[i++];
|
{
|
||||||
|
mzchar *ws;
|
||||||
|
ws = data.names[i++];
|
||||||
|
s = scheme_utf8_encode_to_buffer(ws, scheme_char_strlen(ws), NULL, 0);
|
||||||
|
}
|
||||||
l = strlen(s);
|
l = strlen(s);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user