setGlobalFont method

void setGlobalFont(
  1. PosFontType? font, {
  2. int? maxCharsPerLine,
})

Set global font which will be used instead of the default printer's font (even after resetting)

Implementation

void setGlobalFont(PosFontType? font, {int? maxCharsPerLine}) {
  _font = font;
  if (font != null) {
    _maxCharsPerLine = maxCharsPerLine ?? _getMaxCharsPerLine(font);
    bytes += font == PosFontType.fontB ? cFontB.codeUnits : cFontA.codeUnits;
    _styles = _styles.copyWith(fontType: font);
  }
}