mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
added fonts for dark screenshots
This commit is contained in:
parent
d2a953e1f5
commit
c7d0d8a7f1
4 changed files with 9 additions and 4 deletions
BIN
screenshots/assets/fonts/SF-Pro-Display-Bold-dark.zip
Normal file
BIN
screenshots/assets/fonts/SF-Pro-Display-Bold-dark.zip
Normal file
Binary file not shown.
BIN
screenshots/assets/fonts/SF-Pro-Display-Regular-dark.zip
Normal file
BIN
screenshots/assets/fonts/SF-Pro-Display-Regular-dark.zip
Normal file
Binary file not shown.
|
@ -17,7 +17,6 @@ extension ScreenshotImage on Image {
|
|||
if (_configs[args.name] == null) {
|
||||
return this;
|
||||
}
|
||||
print(args.deviceName);
|
||||
return _addSystemOverlay(
|
||||
screenshotDevices[args.deviceName]!,
|
||||
isDark: args.isDark,
|
||||
|
@ -36,6 +35,7 @@ extension ScreenshotImage on Image {
|
|||
layout,
|
||||
_configs[args.name]!.title,
|
||||
_configs[args.name]!.subtitle,
|
||||
isDark: args.isDark,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -96,9 +96,11 @@ extension ScreenshotImage on Image {
|
|||
);
|
||||
}
|
||||
|
||||
Image _addText(ScreenshotLayout layout, String title, String subtitle) {
|
||||
final titleFont = BitmapFont.fromZip(File(layout.titleFontPath).readAsBytesSync());
|
||||
final subtitleFont = BitmapFont.fromZip(File(layout.subtitleFontPath).readAsBytesSync());
|
||||
Image _addText(ScreenshotLayout layout, String title, String subtitle, {required bool isDark}) {
|
||||
final titleFont =
|
||||
BitmapFont.fromZip(File(isDark ? layout.titleFontDarkPath : layout.titleFontPath).readAsBytesSync());
|
||||
final subtitleFont =
|
||||
BitmapFont.fromZip(File(isDark ? layout.subtitleFontDarkPath : layout.subtitleFontPath).readAsBytesSync());
|
||||
final textImage = fill(
|
||||
Image(
|
||||
height: titleFont.lineHeight + 36 + subtitleFont.lineHeight * 2,
|
||||
|
|
|
@ -17,6 +17,9 @@ enum ScreenshotLayout {
|
|||
final String titleFontPath;
|
||||
final String subtitleFontPath;
|
||||
|
||||
String get titleFontDarkPath => '${titleFontPath.split('.').first}-dark.zip';
|
||||
String get subtitleFontDarkPath => '${subtitleFontPath.split('.').first}-dark.zip';
|
||||
|
||||
const ScreenshotLayout({
|
||||
required this.size,
|
||||
required this.contentPadding,
|
||||
|
|
Loading…
Reference in a new issue