Some fonts may have no characters at all for some reason, avoid crashes.

This commit is contained in:
John Elliot 2000-06-11 19:59:37 +00:00 committed by Alexandre Julliard
parent 625653f96d
commit 7bfa21cb80
1 changed files with 2 additions and 1 deletions

View File

@ -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;