mirror of
https://github.com/venera-app/venera.git
synced 2025-12-15 06:41:14 +00:00
Add font patching script for linux arm64. Close #468
This commit is contained in:
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
@@ -170,6 +170,9 @@ jobs:
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
||||
dart pub global activate flutter_to_debian
|
||||
- name: "Patch font"
|
||||
run: |
|
||||
dart run patch/font.dart
|
||||
- run: python3 debian/build.py arm64
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
28
patch/font.dart
Normal file
28
patch/font.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:archive/archive_io.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
void main() async {
|
||||
const harmonySansLink = "https://developer.huawei.com/images/download/general/HarmonyOS-Sans.zip";
|
||||
|
||||
var dio = Dio();
|
||||
await dio.download(harmonySansLink, "HarmonyOS-Sans.zip");
|
||||
await extractFileToDisk("HarmonyOS-Sans.zip", "./assets/");
|
||||
File("HarmonyOS-Sans.zip").deleteSync();
|
||||
|
||||
var pubspec = await File("pubspec.yaml").readAsString();
|
||||
pubspec = pubspec.replaceFirst("# fonts:",
|
||||
""" fonts:
|
||||
- family: HarmonyOS Sans
|
||||
fonts:
|
||||
- asset: assets/HarmonyOS Sans/HarmonyOS_Sans_SC/HarmonyOS_Sans_SC_Regular.ttf
|
||||
""");
|
||||
await File("pubspec.yaml").writeAsString(pubspec);
|
||||
|
||||
var mainDart = await File("lib/main.dart").readAsString();
|
||||
mainDart = mainDart.replaceFirst("Noto Sans CJK", "HarmonyOS Sans");
|
||||
await File("lib/main.dart").writeAsString(mainDart);
|
||||
|
||||
print("Successfully patched font.");
|
||||
}
|
||||
16
pubspec.lock
16
pubspec.lock
@@ -33,6 +33,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
archive:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: archive
|
||||
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.7"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -770,6 +778,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
posix:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: posix
|
||||
sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.0.3"
|
||||
rhttp:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -94,6 +94,7 @@ dev_dependencies:
|
||||
flutter_lints: ^5.0.0
|
||||
flutter_to_arch: ^1.0.1
|
||||
flutter_to_debian: ^2.0.2
|
||||
archive: any
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
@@ -104,6 +105,7 @@ flutter:
|
||||
- assets/tags.json
|
||||
- assets/tags_tw.json
|
||||
- assets/opencc.txt
|
||||
# fonts:
|
||||
|
||||
flutter_to_arch:
|
||||
name: Venera
|
||||
|
||||
Reference in New Issue
Block a user