terminal_style.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import 'dart:ui' as ui;
  2. import 'package:flutter/material.dart';
  3. class TerminalStyle {
  4. static const defaultFontFamily = [
  5. 'Monaco',
  6. 'Droid Sans Mono',
  7. 'Noto Sans Mono',
  8. 'Roboto Mono',
  9. 'Consolas',
  10. 'Noto Sans Mono CJK SC',
  11. 'Noto Sans Mono CJK TC',
  12. 'Noto Sans Mono CJK KR',
  13. 'Noto Sans Mono CJK JP',
  14. 'Noto Sans Mono CJK HK',
  15. 'monospace',
  16. 'Noto Color Emoji',
  17. 'Noto Sans Symbols',
  18. 'Roboto',
  19. 'Ubuntu',
  20. 'Cantarell',
  21. 'DejaVu Sans',
  22. 'Liberation Sans',
  23. 'Arial',
  24. 'Droid Sans Fallback',
  25. 'sans-serif',
  26. 'Cascadia Mono',
  27. 'Arial Unicode MS',
  28. ];
  29. const TerminalStyle({
  30. this.fontFamily = defaultFontFamily,
  31. this.fontSize = 14,
  32. this.fontWidthScaleFactor = 1.0,
  33. this.fontHeightScaleFactor = 1.1,
  34. this.textStyleProvider,
  35. });
  36. final List<String> fontFamily;
  37. final double fontSize;
  38. final double fontWidthScaleFactor;
  39. final double fontHeightScaleFactor;
  40. final TextStyleProvider? textStyleProvider;
  41. }
  42. typedef TextStyleProvider = Function({
  43. TextStyle textStyle,
  44. Color color,
  45. Color backgroundColor,
  46. double fontSize,
  47. FontWeight fontWeight,
  48. FontStyle fontStyle,
  49. double letterSpacing,
  50. double wordSpacing,
  51. TextBaseline textBaseline,
  52. double height,
  53. Locale locale,
  54. Paint foreground,
  55. Paint background,
  56. List<ui.Shadow> shadows,
  57. List<ui.FontFeature> fontFeatures,
  58. TextDecoration decoration,
  59. Color decorationColor,
  60. TextDecorationStyle decorationStyle,
  61. double decorationThickness,
  62. });