reportStyleFont function

ReportFontSpec reportStyleFont(
  1. ReportTextStyle style,
  2. ReportFontSpec base
)

style over base. Empty fields keep base.

Implementation

ReportFontSpec reportStyleFont(ReportTextStyle style, ReportFontSpec base) {
  final String family = (style.fontFamily ?? '').trim();
  final double? size = style.fontSize;
  return ReportFontSpec(
    family: family.isEmpty ? base.family : family,
    size: size != null && size > 0 ? size : base.size,
    bold: style.bold ?? base.bold,
    italic: style.italic ?? base.italic,
  );
}