-
Bug
-
Resolution: Fixed
-
P5
-
5.0u1
-
b43
-
generic
-
generic
The constructor sun.font.CompositeStrike(CompositeFont, FontStrikeDesc) has an expression, which will always return false.
CompositeStrike(CompositeFont font2D, FontStrikeDesc desc) {
this.compFont = font2D;
this.desc = desc;
this.disposer = new FontStrikeDisposer(compFont, desc);
if (desc.style != compFont.style) {
algoStyle = true;
if ((desc.style & Font.BOLD) == 1 &&
((compFont.style & Font.BOLD) == 0)) {
boldness = 1.33f;
}
if ((desc.style & Font.ITALIC) == 1 && // <---- always false
(compFont.style & Font.ITALIC) == 0) {
italic = 0.7f; // <----------------------- never reached
}
}
strikes = new PhysicalStrike[compFont.numSlots];
}
The Font.ITALIC is specified in java.awt.Font:
public static final int ITALIC = 2;
The expression "(desc.style & Font.ITALIC) == 1" will always return false, because a bit by bit and-comparison with the value of 2 can never be equals 1.
Example: 0xFFFFFFFF & 2 will return 2, not 1.
As a result, the assignment to the italic float primitive will never be reached.
There is no problem with the expression containing Font.BOLD, because the value of Font.BOLD is 1.
###@###.### 2005-03-11 15:15:57 GMT
CompositeStrike(CompositeFont font2D, FontStrikeDesc desc) {
this.compFont = font2D;
this.desc = desc;
this.disposer = new FontStrikeDisposer(compFont, desc);
if (desc.style != compFont.style) {
algoStyle = true;
if ((desc.style & Font.BOLD) == 1 &&
((compFont.style & Font.BOLD) == 0)) {
boldness = 1.33f;
}
if ((desc.style & Font.ITALIC) == 1 && // <---- always false
(compFont.style & Font.ITALIC) == 0) {
italic = 0.7f; // <----------------------- never reached
}
}
strikes = new PhysicalStrike[compFont.numSlots];
}
The Font.ITALIC is specified in java.awt.Font:
public static final int ITALIC = 2;
The expression "(desc.style & Font.ITALIC) == 1" will always return false, because a bit by bit and-comparison with the value of 2 can never be equals 1.
Example: 0xFFFFFFFF & 2 will return 2, not 1.
As a result, the assignment to the italic float primitive will never be reached.
There is no problem with the expression containing Font.BOLD, because the value of Font.BOLD is 1.
###@###.### 2005-03-11 15:15:57 GMT