initialize method

  1. @internal
void initialize(
  1. double defaultCharWidth,
  2. double charHeight
)

Implementation

@internal
void initialize(double defaultCharWidth, double charHeight) {
  if (width < 0) {
    width = defaultCharWidth;
  }
  if (height < 0) {
    height = charHeight;
  } else {
    assert(
      height == charHeight,
      'The height of all glyphs must be the same and equal to the font size',
    );
  }
  if (srcLeft < 0) {
    srcLeft = left;
    srcTop = top;
    srcRight = left + width;
    srcBottom = top + height;
  }
}