Max TenEyck Woodbury max@mtew.isa-geek.net wrote:
if ( font->aveWidth && font->potm->otmTextMetrics.tmHeight ) {
if (((font->aveWidth + font->potm->otmTextMetrics.tmHeight - 1) /
font->potm->otmTextMetrics.tmHeight) > 100) { WARN("Ignoring too large font->aveWidth %d\n", font->aveWidth); font->aveWidth = 0; }
In which case font->potm->otmTextMetrics.tmHeight is going to be 0?
I am not sure what you are asking. I have had this particular division throw an exception for some font I have installed, but I have no idea which one at the moment. So if you are implying that font->aveWidth==0 is always true if font->potm->otmTextMetrics.tmHeight==0, that seems not to be the case.
If font->potm->otmTextMetrics.tmHeight is 0 then the font is invalid and should not be loaded and used at all. There is no point is adding checks for things that shouldn't happen, and may cause various bad things in other places of code as well.