# HG changeset patch # User Jason Rumney # Date 1045434186 0 # Node ID 15e797b18d7f5dc2b78d168e37e562762b890b06 # Parent 3ba90bec9e2c77a57bacd41f5321f3375ef7d0d5 (w32_list_bdf_fonts, w32_list_fonts): Negative max_fonts parameter means list all. diff -r 3ba90bec9e2c -r 15e797b18d7f src/w32fns.c --- a/src/w32fns.c Sun Feb 16 16:53:28 2003 +0000 +++ b/src/w32fns.c Sun Feb 16 22:23:06 2003 +0000 @@ -7340,7 +7340,7 @@ { newlist = Fcons (XCAR (tem), newlist); n_fonts++; - if (n_fonts >= max_names) + if (max_names >= 0 && n_fonts >= max_names) break; } } @@ -7354,7 +7354,8 @@ 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 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 w32_list_fonts (f, pattern, size, maxnames) @@ -7467,7 +7468,7 @@ { newlist = Fcons (XCAR (tem), newlist); n_fonts++; - if (n_fonts >= maxnames) + if (maxnames >= 0 && n_fonts >= maxnames) break; else continue; @@ -7506,7 +7507,7 @@ { newlist = Fcons (XCAR (tem), newlist); n_fonts++; - if (n_fonts >= maxnames) + if (maxnames >= 0 && n_fonts >= maxnames) break; } /* keep track of the closest matching size in case @@ -7542,7 +7543,7 @@ } /* Include any bdf fonts. */ - if (n_fonts < maxnames) + if (n_fonts < maxnames || maxnames < 0) { Lisp_Object combined[2]; combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts);