Closed
Bug 720
Opened 27 years ago
Closed 26 years ago
Font size rounding bug
Categories
(MozillaClassic Graveyard :: FontLib, defect, P1)
Tracking
(Not tracked)
VERIFIED
FIXED
M4
People
(Reporter: harishd, Assigned: harishd)
Details
Peter Linss wrote:
In working to make NGLayout's font handling match that of Nav's, I've uncovered
a rounding error in the Win libfont code:
modules/libfont/producers/win/src/winfp.cpp: line 875
// for passing to Windows, convert pointsize to pixel size and negative.
if( pointSize > 0 )
pixelSize = (int) - pointSize * pPrmFont->YPixelPerInch / 72.0;
pointSize is the input size (a double), the rounding error is introduced in the
conversion to pixel size.
The problem is a classic lack of parentheses, the int conversion is happening
before the divide by 72.0.
To do what was meant, the line should read:
pixelSize = (int) - ((pointSize * pPrmFont->YPixelPerInch) / 72.0);
However, this is also wrong. The proper (ie: Windows) way is to round to the
rearest integer, not the smallest. According to the
Windows docs the code should read:
pixelSize = - MulDiv((int)pointSize, pPrmFont->YPixelPerInch, 72);
That would give the correct rounding.
This bug results in Nav being unable to render certain font sizes, ie: 8 point
text comes out significantly smaller (more like 7
point).
For more information about the way it looks checkout the above URL.
Comment 1•27 years ago
|
||
dp, since this may require a code review to verify the fix, who would be the
appropriate engineer to look at the code.
Comment 2•27 years ago
|
||
assigning Fenella as QA Assigned to
Comment 3•27 years ago
|
||
tell me if this is a regression from 4.05...
Comment 4•27 years ago
|
||
This isn't a regression. We are still evaluating whether we need to fix it ASAP.
Data is pretty convoluted betn. 3.0,4.0,IE4.0,IE5.0 and word.
We should revisit this for 4.5
Comment 6•27 years ago
|
||
This is not a regression nor a crash, nor data loss, nor an escalation,
therefore this bug doesn't meet the 4.5 criteria
(http://webgroup/novabugs.html). Marking TFV 5.0.
Updated•26 years ago
|
Component: html display → FontLib
Updated•26 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Comment 9•26 years ago
|
||
asking dp who is the best person to review this within fontlib.
Comment 10•26 years ago
|
||
I talked with Harish about how we could verify this bug and there really isn't
any way that we can do this visually. This would really need to be done through
assessing what the code pushes out. Maybe Peter Linss has a suggestion on how to
verify this.
Comment 11•26 years ago
|
||
I talked with Harish about how we could verify this bug and there really isn't
any way that we can do this visually. This would really need to be done through
assessing what the code pushes out. Maybe Peter Linss has a suggestion on how to
verify this.
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 12•26 years ago
|
||
per Peters assessment, marking this as verified
You need to log in
before you can comment on or make changes to this bug.
Description
•