diff options
| author | Jason Rumney | 2003-02-16 22:23:34 +0000 |
|---|---|---|
| committer | Jason Rumney | 2003-02-16 22:23:34 +0000 |
| commit | bd11cc096dd42607378770884c6508dbde2c7f07 (patch) | |
| tree | 1e759bf417b6f5f22360678e69d6fcb11459b43f /src | |
| parent | eeecfc4b259225e1b6b36d3a2122e96ccd5ffe07 (diff) | |
| download | emacs-bd11cc096dd42607378770884c6508dbde2c7f07.tar.gz emacs-bd11cc096dd42607378770884c6508dbde2c7f07.zip | |
(w32_list_bdf_fonts, w32_list_fonts): Negative
max_fonts parameter means list all.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/w32fns.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 148bac60f5d..877a73c2657 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2003-02-16 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32fns.c (w32_list_bdf_fonts, w32_list_fonts): Negative | ||
| 4 | max_fonts parameter means list all. | ||
| 5 | |||
| 1 | 2003-02-14 Dave Love <fx@gnu.org> | 6 | 2003-02-14 Dave Love <fx@gnu.org> |
| 2 | 7 | ||
| 3 | * fns.c (Flanginfo): Doc fix. | 8 | * fns.c (Flanginfo): Doc fix. |
diff --git a/src/w32fns.c b/src/w32fns.c index 658a256ed63..dfe11442ea8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -7340,7 +7340,7 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) | |||
| 7340 | { | 7340 | { |
| 7341 | newlist = Fcons (XCAR (tem), newlist); | 7341 | newlist = Fcons (XCAR (tem), newlist); |
| 7342 | n_fonts++; | 7342 | n_fonts++; |
| 7343 | if (n_fonts >= max_names) | 7343 | if (max_names >= 0 && n_fonts >= max_names) |
| 7344 | break; | 7344 | break; |
| 7345 | } | 7345 | } |
| 7346 | } | 7346 | } |
| @@ -7354,7 +7354,8 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) | |||
| 7354 | to be listed. Frame F NULL means we have not yet created any | 7354 | to be listed. Frame F NULL means we have not yet created any |
| 7355 | frame, which means we can't get proper size info, as we don't have | 7355 | frame, which means we can't get proper size info, as we don't have |
| 7356 | a device context to use for GetTextMetrics. | 7356 | a device context to use for GetTextMetrics. |
| 7357 | MAXNAMES sets a limit on how many fonts to match. */ | 7357 | MAXNAMES sets a limit on how many fonts to match. If MAXNAMES is |
| 7358 | negative, then all matching fonts are returned. */ | ||
| 7358 | 7359 | ||
| 7359 | Lisp_Object | 7360 | Lisp_Object |
| 7360 | w32_list_fonts (f, pattern, size, maxnames) | 7361 | w32_list_fonts (f, pattern, size, maxnames) |
| @@ -7467,7 +7468,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7467 | { | 7468 | { |
| 7468 | newlist = Fcons (XCAR (tem), newlist); | 7469 | newlist = Fcons (XCAR (tem), newlist); |
| 7469 | n_fonts++; | 7470 | n_fonts++; |
| 7470 | if (n_fonts >= maxnames) | 7471 | if (maxnames >= 0 && n_fonts >= maxnames) |
| 7471 | break; | 7472 | break; |
| 7472 | else | 7473 | else |
| 7473 | continue; | 7474 | continue; |
| @@ -7506,7 +7507,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7506 | { | 7507 | { |
| 7507 | newlist = Fcons (XCAR (tem), newlist); | 7508 | newlist = Fcons (XCAR (tem), newlist); |
| 7508 | n_fonts++; | 7509 | n_fonts++; |
| 7509 | if (n_fonts >= maxnames) | 7510 | if (maxnames >= 0 && n_fonts >= maxnames) |
| 7510 | break; | 7511 | break; |
| 7511 | } | 7512 | } |
| 7512 | /* keep track of the closest matching size in case | 7513 | /* keep track of the closest matching size in case |
| @@ -7542,7 +7543,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7542 | } | 7543 | } |
| 7543 | 7544 | ||
| 7544 | /* Include any bdf fonts. */ | 7545 | /* Include any bdf fonts. */ |
| 7545 | if (n_fonts < maxnames) | 7546 | if (n_fonts < maxnames || maxnames < 0) |
| 7546 | { | 7547 | { |
| 7547 | Lisp_Object combined[2]; | 7548 | Lisp_Object combined[2]; |
| 7548 | combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); | 7549 | combined[0] = w32_list_bdf_fonts (pattern, maxnames - n_fonts); |