Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
536f4067
Commit
536f4067
authored
Jul 31, 1997
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(x_list_fonts): Reject a font whose min_bounds.width is 0.
parent
a69e7dae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
src/xterm.c
src/xterm.c
+28
-15
No files found.
src/xterm.c
View file @
536f4067
/* X Communication module for terminals which understand the X protocol.
Copyright (C) 1989, 93, 94, 95, 199
6
Free Software Foundation, Inc.
Copyright (C) 1989, 93, 94, 95,
96,
199
7
Free Software Foundation, Inc.
This file is part of GNU Emacs.
...
...
@@ -6365,7 +6365,10 @@ x_list_fonts (f, pattern, size, maxnames)
char
**
names
;
pattern
=
XCONS
(
patterns
)
->
car
;
/* See if we cached the result for this particular query. */
/* See if we cached the result for this particular query.
The cache is an alist of the form:
(((PATTERN . MAXNAMES) (FONTNAME . WIDTH) ...) ...)
*/
if
(
f
&&
(
tem
=
XCONS
(
FRAME_X_DISPLAY_INFO
(
f
)
->
name_list_element
)
->
cdr
,
key
=
Fcons
(
pattern
,
make_number
(
maxnames
)),
!
NILP
(
list
=
Fassoc
(
key
,
tem
))))
...
...
@@ -6439,6 +6442,8 @@ x_list_fonts (f, pattern, size, maxnames)
/* Make a list of the fonts that have the right width. */
for
(;
CONSP
(
list
);
list
=
XCONS
(
list
)
->
cdr
)
{
int
found_size
;
tem
=
XCONS
(
list
)
->
car
;
if
(
!
CONSP
(
tem
)
||
NILP
(
XCONS
(
tem
)
->
car
))
...
...
@@ -6462,7 +6467,10 @@ x_list_fonts (f, pattern, size, maxnames)
if
(
thisinfo
)
{
XCONS (tem)->cdr = make_number (thisinfo->max_bounds.width);
XCONS
(
tem
)
->
cdr
=
(
thisinfo
->
min_bounds
.
width
==
0
?
make_number
(
0
)
:
make_number
(
thisinfo
->
max_bounds
.
width
));
XFreeFont
(
dpy
,
thisinfo
);
}
else
...
...
@@ -6471,21 +6479,26 @@ x_list_fonts (f, pattern, size, maxnames)
as 0 not to try to open it again. */
XCONS
(
tem
)
->
cdr
=
make_number
(
0
);
}
if (XINT (XCONS (tem)->cdr) == size)
found_size
=
XINT
(
XCONS
(
tem
)
->
cdr
);
if
(
found_size
==
size
)
newlist
=
Fcons
(
XCONS
(
tem
)
->
car
,
newlist
);
else if (NILP (second_best))
second_best = tem;
else if (XINT (XCONS (tem)->cdr) < size)
{
if (XINT (XCONS (second_best)->cdr) > size
|| XINT (XCONS (second_best)->cdr) < XINT (XCONS (tem)->cdr))
second_best = tem;
}
else
else
if
(
found_size
>
0
)
{
if (XINT (XCONS (second_best)->cdr) > size
&& XINT (XCONS (second_best)->cdr) > XINT (XCONS (tem)->cdr))
if
(
NILP
(
second_best
))
second_best
=
tem
;
else
if
(
found_size
<
size
)
{
if
(
XINT
(
XCONS
(
second_best
)
->
cdr
)
>
size
||
XINT
(
XCONS
(
second_best
)
->
cdr
)
<
found_size
)
second_best
=
tem
;
}
else
{
if
(
XINT
(
XCONS
(
second_best
)
->
cdr
)
>
size
&&
XINT
(
XCONS
(
second_best
)
->
cdr
)
>
found_size
)
second_best
=
tem
;
}
}
}
if
(
!
NILP
(
newlist
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment