mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 08:50: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) {
|
if (_configs[args.name] == null) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
print(args.deviceName);
|
|
||||||
return _addSystemOverlay(
|
return _addSystemOverlay(
|
||||||
screenshotDevices[args.deviceName]!,
|
screenshotDevices[args.deviceName]!,
|
||||||
isDark: args.isDark,
|
isDark: args.isDark,
|
||||||
|
@ -36,6 +35,7 @@ extension ScreenshotImage on Image {
|
||||||
layout,
|
layout,
|
||||||
_configs[args.name]!.title,
|
_configs[args.name]!.title,
|
||||||
_configs[args.name]!.subtitle,
|
_configs[args.name]!.subtitle,
|
||||||
|
isDark: args.isDark,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,11 @@ extension ScreenshotImage on Image {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Image _addText(ScreenshotLayout layout, String title, String subtitle) {
|
Image _addText(ScreenshotLayout layout, String title, String subtitle, {required bool isDark}) {
|
||||||
final titleFont = BitmapFont.fromZip(File(layout.titleFontPath).readAsBytesSync());
|
final titleFont =
|
||||||
final subtitleFont = BitmapFont.fromZip(File(layout.subtitleFontPath).readAsBytesSync());
|
BitmapFont.fromZip(File(isDark ? layout.titleFontDarkPath : layout.titleFontPath).readAsBytesSync());
|
||||||
|
final subtitleFont =
|
||||||
|
BitmapFont.fromZip(File(isDark ? layout.subtitleFontDarkPath : layout.subtitleFontPath).readAsBytesSync());
|
||||||
final textImage = fill(
|
final textImage = fill(
|
||||||
Image(
|
Image(
|
||||||
height: titleFont.lineHeight + 36 + subtitleFont.lineHeight * 2,
|
height: titleFont.lineHeight + 36 + subtitleFont.lineHeight * 2,
|
||||||
|
|
|
@ -17,6 +17,9 @@ enum ScreenshotLayout {
|
||||||
final String titleFontPath;
|
final String titleFontPath;
|
||||||
final String subtitleFontPath;
|
final String subtitleFontPath;
|
||||||
|
|
||||||
|
String get titleFontDarkPath => '${titleFontPath.split('.').first}-dark.zip';
|
||||||
|
String get subtitleFontDarkPath => '${subtitleFontPath.split('.').first}-dark.zip';
|
||||||
|
|
||||||
const ScreenshotLayout({
|
const ScreenshotLayout({
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.contentPadding,
|
required this.contentPadding,
|
||||||
|
|
Loading…
Reference in a new issue