function normalizeCell(cell, rowIndex, colIndex) {
  const colStyle = this._colStyle(colIndex);
  let rowStyle = this._rowStyle(rowIndex);

  const font = deepMerge({}, colStyle.font, rowStyle.font, cell.font);
  const customFont = Object.values(font).filter((v) => v != null).length > 0;
  const doc = this.document;

  // Initialize cell context
  const rollbackFont = doc._fontSource;
  const rollbackFontSize = doc._fontSize;
  const rollbackFontFamily = doc._fontFamily;
  if (customFont) {
    if (font.src) doc.font(font.src, font.family);
    if (font.size) doc.fontSize(font.size);

    // Refetch rowStyle to reflect font changes
    rowStyle = this._rowStyle(rowIndex);
  }

  cell.padding = normalizeSides(cell.padding);
  cell.border = normalizeSides(cell.border);
  cell.borderColor = normalizeSides(cell.borderColor);

  // Cell takes highest priority, then row, then column, then defaultConfig
  const config = deepMerge(this._defaultStyle, colStyle, rowStyle, cell);
  config.rowIndex = rowIndex;
  config.colIndex = colIndex;
  config.font = font ?? {};
  config.customFont = customFont;

  // Normalize config
  config.text = normalizeText(config.text);
  config.rowSpan = config.rowSpan ?? 1;
  config.colSpan = config.colSpan ?? 1;
  config.padding = normalizeSides(config.padding, '0.25em', (x) =>
    doc.sizeToPoint(x, '0.25em'),
  );
  config.border = normalizeSides(config.border, 1, (x) =>
    doc.sizeToPoint(x, 1),
  );
  config.borderColor = normalizeSides(
    config.borderColor,
    'black',
    (x) => x ?? 'black',
  );
  config.align = normalizeAlignment(config.align);
  config.align.x = config.align.x ?? 'left';
  config.align.y = config.align.y ?? 'top';
  config.textStroke = doc.sizeToPoint(config.textStroke, 0);
  config.textStrokeColor = config.textStrokeColor ?? 'black';
  config.textColor = config.textColor ?? 'black';
  config.textOptions = config.textOptions ?? {};

  // Accessibility settings
  config.id = new String(config.id ?? `${this._id}-${rowIndex}-${colIndex}`);
  config.type = config.type?.toUpperCase() === 'TH' ? 'TH' : 'TD';
  if (config.scope) {
    config.scope = config.scope.toLowerCase();
    if (config.scope === 'row') config.scope = 'Row';
    else if (config.scope === 'both') config.scope = 'Both';
    else if (config.scope === 'column') config.scope = 'Column';
  }

  if (typeof this.opts.debug === 'boolean') config.debug = this.opts.debug;

  // Rollback font
  if (customFont) doc.font(rollbackFont, rollbackFontFamily, rollbackFontSize);

  return config;
}
Normalize a cell config

@this PDFTable
@memberOf PDFTable
@param {TableCellStyle} cell - The cell to mutate
@param {number} rowIndex - The cells row
@param {number} colIndex - The cells column
@returns {NormalizedTableCellStyle}
@private