comicMarkedLeading function

TextStyle comicMarkedLeading(
  1. String words,
  2. TextStyle style
)

style with the leading words' marks need (comicMarkedPitch) when it is set in the look's own lettering face and its own leading is tighter; else style.

Implementation

TextStyle comicMarkedLeading(String words, TextStyle style) {
  if (style.fontFamily != comicFontFamily('Bangers')) return style;
  final pitch = comicMarkedPitch(words);
  final size = style.fontSize ?? 14;
  if (pitch == null || (style.height ?? 0) >= pitch) return style;
  return style.copyWith(height: (size * pitch).ceilToDouble() / size);
}