Commit bd11cc09 authored by Jason Rumney's avatar Jason Rumney

(w32_list_bdf_fonts, w32_list_fonts): Negative

max_fonts parameter means list all.
parent eeecfc4b
2003-02-16 Jason Rumney <jasonr@gnu.org>
* w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative
max_fonts parameter means list all.
2003-02-14 Dave Love <fx@gnu.org> 2003-02-14 Dave Love <fx@gnu.org>
* fns.c (Flanginfo): Doc fix. * fns.c (Flanginfo): Doc fix.
......
...@@ -7340,7 +7340,7 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) ...@@ -7340,7 +7340,7 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
{ {
newlist = Fcons (XCAR (tem), newlist); newlist = Fcons (XCAR (tem), newlist);
n_fonts++; n_fonts++;
if (n_fonts >= max_names) if (max_names >= 0 && n_fonts >= max_names)
break; break;
} }
} }
...@@ -7354,7 +7354,8 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) ...@@ -7354,7 +7354,8 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names)
to be listed. Frame F NULL means we have not yet created any to be listed. Frame F NULL means we have not yet created any
frame, which means we can't get proper size info, as we don't have frame, which means we can't get proper size info, as we don't have
a device context to use for GetTextMetrics. a device context to use for GetTextMetrics.
MAXNAMES sets a limit on how many fonts to match. */ MAXNAMES sets a limit on how many fonts to match. If MAXNAMES is
negative, then all matching fonts are returned. */
Lisp_Object Lisp_Object
w32_list_fonts (f, pattern, size, maxnames) w32_list_fonts (f, pattern, size, maxnames)
...@@ -7467,7 +7468,7 @@ w32_list_fonts (f, pattern, size, maxnames) ...@@ -7467,7 +7468,7 @@ w32_list_fonts (f, pattern, size, maxnames)
{ {
newlist = Fcons (XCAR (tem), newlist); newlist = Fcons (XCAR (tem), newlist);
n_fonts++; n_fonts++;
if (n_fonts >= maxnames) if (maxnames >= 0 && n_fonts >= maxnames)
break; break;
else else
continue; continue;
...@@ -7506,7 +7507,7 @@ w32_list_fonts (f, pattern, size, maxnames) ...@@ -7506,7 +7507,7 @@ w32_list_fonts (f, pattern, size, maxnames)
{ {
newlist = Fcons (XCAR (tem), newlist); newlist = Fcons (XCAR (tem), newlist);
n_fonts++; n_fonts++;
if (n_fonts >= maxnames) if (maxnames >= 0 && n_fonts >= maxnames)
break; break;
} }
/* keep track of the closest matching size in case /* keep track of the closest matching size in case
...@@ -7542,7 +7543,7 @@ w32_list_fonts (f, pattern, size, maxnames) ...@@ -7542,7 +7543,7 @@ w32_list_fonts (f, pattern, size, maxnames)
} }
/* Include any bdf fonts. */ /* Include any bdf fonts. */
if (n_fonts < maxnames) if (n_fonts < maxnames || maxnames < 0)
{ {
Lisp_Object combined[2]; Lisp_Object combined[2];
combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment