custom font

This commit is contained in:
zoe 2022-08-12 20:26:38 +02:00
parent 2a1511ab9a
commit 331d3a584d
8 changed files with 73 additions and 2 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -59,7 +59,7 @@ class DisplayName extends StatelessWidget {
children: [
Text(
account.displayName,
style: Theme.of(context).textTheme.titleMedium,
style: Theme.of(context).textTheme.displaySmall,
),
Text(
account.acct,

View File

@ -15,6 +15,7 @@ class PostTextRenderer extends StatelessWidget {
final List<InlineSpan> children =
createSpansFromDoc(document.body!.children);
return SelectableText.rich(TextSpan(
style: Theme.of(context).textTheme.bodyMedium,
text: "",
children: children,
));

View File

@ -4,6 +4,61 @@ import 'dracula.dart' as color_dracula;
final available = [color_dracula.theme];
ThemeData getTheme(CustomColors colors) {
return ThemeData(
fontFamily: 'Atkinson',
textTheme: TextTheme(
bodyLarge: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 24,
),
bodyMedium: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 18,
),
bodySmall: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 14,
),
displayLarge: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 42,
fontWeight: FontWeight.w700,
),
displayMedium: TextStyle(
color: colors.colorScheme.onSurface,
fontWeight: FontWeight.w700,
fontSize: 36,
),
displaySmall: TextStyle(
color: colors.colorScheme.onSurface,
fontWeight: FontWeight.w700,
fontSize: 24,
),
headlineLarge: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 42,
),
headlineMedium: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 36,
),
headlineSmall: TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 24,
),
),
textButtonTheme: TextButtonThemeData(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
const TextStyle(fontSize: 18),
),
),
),
popupMenuTheme: PopupMenuThemeData(
color: colors.colorScheme.background,
textStyle: TextStyle(
color: colors.colorScheme.onBackground,
),
),
scaffoldBackgroundColor: colors.colorScheme.background,
bottomAppBarColor: colors.colorScheme.background,
hintColor: colors.hintColor,
@ -14,7 +69,11 @@ ThemeData getTheme(CustomColors colors) {
shape: const CircularNotchedRectangle(),
elevation: 0,
),
navigationBarTheme: const NavigationBarThemeData(
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(TextStyle(
color: colors.colorScheme.onSurface,
fontSize: 14,
)),
backgroundColor: Colors.transparent,
labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected,
indicatorColor: Colors.transparent,

View File

@ -95,3 +95,14 @@ flutter:
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
fonts:
- family: Atkinson
fonts:
- asset: fonts/Atkinson-Hyperlegible-Regular-102.ttf
- asset: fonts/Atkinson-Hyperlegible-Italic-102.ttf
style: italic
- asset: fonts/Atkinson-Hyperlegible-Bold-102.ttf
weight: 700
- asset: fonts/Atkinson-Hyperlegible-BoldItalic-102.ttf
style: italic
weight: 700