+/* Fill in missing parts of a font spec. This is primarily intended as a
+ * helper function for the functions below.
+ * mswindows fonts look like:
+ * fontname[:[weight][ style][:pointsize[:effects]]][:charset]
+ * A minimal mswindows font spec looks like:
+ * Courier New
+ * A maximal mswindows font spec looks like:
+ * Courier New:Bold Italic:10:underline strikeout:Western
+ * Missing parts of the font spec should be filled in with these values:
+ * Courier New:Regular:10::Western */
+static Lisp_Object
+mswindows_font_instance_truename (struct Lisp_Font_Instance *f, Error_behavior errb)
+{
+ int nsep=0;
+ char *name = (char *) XSTRING_DATA (f->name);
+ char* ptr = name;
+ char* extname = alloca (strlen (name) + 19);
+ strcpy (extname, name);
+
+ while ((ptr = strchr (ptr, ':')) != 0)
+ {
+ ptr++;
+ nsep++;
+ }
+
+ switch (nsep)
+ {
+ case 0:
+ strcat (extname, ":Regular:10::Western");
+ break;
+ case 1:
+ strcat (extname, ":10::Western");
+ break;
+ case 2:
+ strcat (extname, "::Western");
+ break;
+ case 3:
+ strcat (extname, ":Western");
+ break;
+ default:;
+ }
+
+ return build_ext_string (extname, FORMAT_OS);
+}
+