(best_matching_font): Abort for best == NULL before we start to use it.
This commit is contained in:
parent
e22fdc3682
commit
ccd97b5616
1 changed files with 18 additions and 18 deletions
36
src/xfaces.c
36
src/xfaces.c
|
@ -6677,30 +6677,30 @@ best_matching_font (f, attrs, fonts, nfonts, width_ratio, needs_overstrike)
|
|||
best = fonts + i;
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_overstrike)
|
||||
{
|
||||
enum xlfd_weight want_weight = specified[XLFD_WEIGHT];
|
||||
enum xlfd_weight got_weight = best->numeric[XLFD_WEIGHT];
|
||||
|
||||
if (want_weight > XLFD_WEIGHT_MEDIUM && want_weight > got_weight)
|
||||
{
|
||||
/* We want a bold font, but didn't get one; try to use
|
||||
overstriking instead to simulate bold-face. However,
|
||||
don't overstrike an already-bold fontn unless the
|
||||
desired weight grossly exceeds the available weight. */
|
||||
if (got_weight > XLFD_WEIGHT_MEDIUM)
|
||||
*needs_overstrike = (got_weight - want_weight) > 2;
|
||||
else
|
||||
*needs_overstrike = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We should have found SOME font. */
|
||||
if (best == NULL)
|
||||
abort ();
|
||||
|
||||
if (! exact_p && needs_overstrike)
|
||||
{
|
||||
enum xlfd_weight want_weight = specified[XLFD_WEIGHT];
|
||||
enum xlfd_weight got_weight = best->numeric[XLFD_WEIGHT];
|
||||
|
||||
if (want_weight > XLFD_WEIGHT_MEDIUM && want_weight > got_weight)
|
||||
{
|
||||
/* We want a bold font, but didn't get one; try to use
|
||||
overstriking instead to simulate bold-face. However,
|
||||
don't overstrike an already-bold fontn unless the
|
||||
desired weight grossly exceeds the available weight. */
|
||||
if (got_weight > XLFD_WEIGHT_MEDIUM)
|
||||
*needs_overstrike = (got_weight - want_weight) > 2;
|
||||
else
|
||||
*needs_overstrike = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (font_scalable_p (best))
|
||||
font_name = build_scalable_font_name (f, best, pt);
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue