Skip to content

Commit

Permalink
Add font family field
Browse files Browse the repository at this point in the history
  • Loading branch information
kawaijoe committed May 14, 2024
1 parent 22eca89 commit 42b4bbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions forui/lib/src/theme/font/font_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import 'package:forui/forui.dart';
/// This class contains scalar values that are multiplied with the corresponding properties on [TextStyle] to ensure
/// that various fonts are scaled consistently across the application.
class FFontData {
/// The font family.
final String fontFamily;

/// A value used to scale [TextStyle.fontSize].
final double fontSizeScalar;

Expand All @@ -21,6 +24,7 @@ class FFontData {

/// Creates a [FFontData].
const FFontData({
this.fontFamily = 'Inter',
this.fontSizeScalar = 1,
this.letterSpacingScalar = 1,
this.wordSpacingScalar = 1,
Expand All @@ -29,12 +33,14 @@ class FFontData {

/// Creates a copy of this [FFontData] with the given properties replaced.
FFontData copyWith({
String? fontFamily,
double? fontSizeScalar,
double? letterSpacingScalar,
double? wordSpacingScalar,
double? heightScalar,
}) =>
FFontData(
fontFamily: fontFamily ?? this.fontFamily,
fontSizeScalar: fontSizeScalar ?? this.fontSizeScalar,
letterSpacingScalar: letterSpacingScalar ?? this.letterSpacingScalar,
wordSpacingScalar: wordSpacingScalar ?? this.wordSpacingScalar,
Expand Down

0 comments on commit 42b4bbb

Please sign in to comment.