LazFreeType garbles some fonts
Original Reporter info from Mantis: circular
-
Reporter name:
Original Reporter info from Mantis: circular
- Reporter name:
Description:
Some fonts are not rendered correctly, in particular, there are vertical lines that appear.
It is due to a negative value used with SHR.
Steps to reproduce:
Run the attached sample project.
See below how to fix.
Note: it may fix also issue 0021456.
https://bugs.freepascal.org/view.php?id=21456
Additional information:
To fix, enforce c to be positive in MulDiv_Round function in TTCalc.Pas of LazUtils.
function MulDiv_Round( a, b, c : Int32 ) : Int32;
var
temp: Int64;
begin
temp := int64(a)*int64(b);
if c < 0 then
begin
c := -c;
temp := -temp;
end;
if temp >= 0 then temp += c shr 1
else temp -= c shr 1;
result := temp div c;
end;
Mantis conversion info:
- Mantis ID: 37012
- Version: 2.0.8
- Fixed in revision: r63125 (#8fccfb64)
- Monitored by: » circular (circular)