lineHeightInPixels property

num? get lineHeightInPixels

The lineHeight, provides an indirect means to specify the leading. The leading is the difference between the font-size height and the (used) value of line height in pixels. If lineHeight is not specified it's automatically computed as 1.2 of the font size. Firefox is 1.2, Safari is ~1.2, and CSS suggest a ration from 1 to 1.2 of the font-size when computing line-height. The Font class constructor has the computation for _lineHeight.

Implementation

num? get lineHeightInPixels {
  if (lineHeight != null) {
    if (lineHeight!.inPixels) {
      return lineHeight!.height;
    } else {
      return (size != null) ? lineHeight!.height * size! : null;
    }
  } else {
    return (size != null) ? size! * 1.2 : null;
  }
}