You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start to implement the terminal fonts selector: add a basic font enumerator.
The criteria for eligible console fonts are given in http://support.microsoft.com/kb/247815 .
I relax some of them to allow e.g. Courier (New) as potential console fonts, for example.
See the code for more details.
svn path=/trunk/; revision=62730
* - We allow fixed-pitch FF_MODERN (Monospace) TrueType fonts
123
+
* that can be italic and have negative A or C space.
124
+
* - If it is not a TrueType font, it can be from another character set
125
+
* than OEM_CHARSET.
126
+
* - We do not support Asian criteria at the moment.
127
+
* - We do not look into the magic registry key mentioned above.
128
+
*/
129
+
130
+
/* Reject variable width fonts */
131
+
if (((lplf->lfPitchAndFamily&0x03) !=FIXED_PITCH)
132
+
#if0/* Reject italic and TrueType fonts with negative A or C space */
133
+
|| (lplf->lfItalic)
134
+
|| !(lpntm->ntmFlags&NTM_NONNEGATIVE_AC)
135
+
#endif
136
+
)
137
+
{
138
+
DPRINT1("Font '%S' rejected because it%s (lfPitchAndFamily = %d).\n",
139
+
pszName, !(lplf->lfPitchAndFamily&FIXED_PITCH) ? "'s not FIXED_PITCH" : (!(lpntm->ntmFlags&NTM_NONNEGATIVE_AC) ? " has negative A or C space" : " is broken"),
140
+
lplf->lfPitchAndFamily);
141
+
return TRUE;
142
+
}
143
+
144
+
/* Reject TrueType fonts that are not FF_MODERN */
145
+
if ((FontType==TRUETYPE_FONTTYPE) && ((lplf->lfPitchAndFamily&0xF0) !=FF_MODERN))
146
+
{
147
+
DPRINT1("TrueType font '%S' rejected because it's not FF_MODERN (lfPitchAndFamily = %d)\n", pszName, lplf->lfPitchAndFamily);
148
+
return TRUE;
149
+
}
150
+
151
+
/* Reject non-TrueType fonts that are not OEM */
152
+
#if0
153
+
if ((FontType!=TRUETYPE_FONTTYPE) && (lplf->lfCharSet!=OEM_CHARSET))
154
+
{
155
+
DPRINT1("Non-TrueType font '%S' rejected because it's not OEM_CHARSET %d\n", pszName, lplf->lfCharSet);
DPRINT1("Non-TrueType font '%S' rejected because it's not ANSI_CHARSET or DEFAULT_CHARSET or OEM_CHARSET (lfCharSet = %d)\n", pszName, lplf->lfCharSet);
163
+
return TRUE;
164
+
}
165
+
#endif
166
+
167
+
/* Reject fonts that are vertical (tategaki) */
168
+
if (pszName[0] ==L'@')
169
+
{
170
+
DPRINT1("Font '%S' rejected because it's vertical\n", pszName);
171
+
return TRUE;
172
+
}
173
+
174
+
#if0// For Asian installations only
175
+
/* Reject non-TrueType fonts that are not Terminal */
176
+
if ((FontType!=TRUETYPE_FONTTYPE) && (wcscmp(pszName, L"Terminal") !=0))
177
+
{
178
+
DPRINT1("Non-TrueType font '%S' rejected because it's not Terminal\n", pszName);
179
+
return TRUE;
180
+
}
181
+
182
+
// TODO: Asian TrueType font must also be an Asian character set.
183
+
#endif
184
+
185
+
/* Make sure the font doesn't already exist in the list */
186
+
if (SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)pszName) ==LB_ERR)
0 commit comments