Skip to content

Commit d254d16

Browse files
committed
ref: clean up font fallback list
1 parent fadbca0 commit d254d16

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/components/canvas/inner_canvas.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,16 @@ class _InnerCanvasState extends State<InnerCanvas> {
203203
DefaultStyles _getQuillStyles({required bool invert}) {
204204
final colorScheme = Theme.of(context).colorScheme;
205205
final backgroundColor = invert ? Colors.black : Colors.white;
206-
207-
/// lineHeight in local space
208-
final num lineHeight = widget.coreInfo.lineHeight;
206+
final lineHeight = widget.coreInfo.lineHeight;
209207

210208
// Load handwriting fonts
211-
final TextStyle neucha = GoogleFonts.neucha();
212-
final TextStyle dekko = GoogleFonts.dekko();
213-
final String fontFamily = neucha.fontFamily ?? 'Neucha';
214-
List<String> fontFamilyFallback = <String?>[
215-
neucha.fontFamily,
209+
final neucha = GoogleFonts.neucha();
210+
final dekko = GoogleFonts.dekko();
211+
final fontFamily = neucha.fontFamily ?? 'Neucha';
212+
final fontFamilyFallback = [
213+
if (neucha.fontFamily != null) neucha.fontFamily!,
216214
'Neucha',
217-
dekko.fontFamily,
215+
if (dekko.fontFamily != null) dekko.fontFamily!,
218216
'Dekko',
219217
// Fallback fonts from https://github.com/system-fonts/modern-font-stacks#handwritten
220218
'Segoe Print',
@@ -226,9 +224,9 @@ class _InnerCanvasState extends State<InnerCanvas> {
226224
'cursive',
227225
'handwriting',
228226
'sans-serif',
229-
].where((String? s) => s != null).cast<String>().toList();
227+
];
230228

231-
final TextStyle defaultStyle = TextStyle(
229+
final defaultStyle = TextStyle(
232230
inherit: false,
233231
fontFamily: fontFamily,
234232
fontFamilyFallback: fontFamilyFallback,

0 commit comments

Comments
 (0)