Add pointPerInch/pixelsPerInch and simplify code