Some fonts may have no characters at all for some reason, avoid crashes.
This commit is contained in:
parent
625653f96d
commit
7bfa21cb80
|
@ -968,7 +968,8 @@ static INT XFONT_GetAvgCharWidth( LPIFONTINFO16 pFI, const XFontStruct* x_fs,
|
|||
chars++;
|
||||
}
|
||||
}
|
||||
avg = (width + (chars>>1))/ chars;
|
||||
if (chars) avg = (width + (chars>>1))/ chars;
|
||||
else avg = 0; /* No characters exist at all */
|
||||
}
|
||||
else /* uniform width */
|
||||
avg = x_fs->min_bounds.width;
|
||||
|
|
Loading…
Reference in New Issue