Skip to content

Commit

Permalink
update replace-font, fix reload title bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeUSeob committed Aug 19, 2024
1 parent c63263d commit 4614d92
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 69 deletions.
143 changes: 142 additions & 1 deletion assets/data/replace-font.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
"ja": "Isemin"
},
"OpenSans-Regular": {
"ko": "OpenSans-Regular",
"ko": "NotoSansKR-Regular",
"ja": "GenJyuuGothicL-Monospace-Regular"
},
"PlayfairDisplay-MediumItalic": {
Expand Down Expand Up @@ -491,5 +491,146 @@
"Galmuri11-Regular": {
"ko": "Galmuri11-Regular",
"ja": "CP-period"
},
"KaiseiTokumin-Bold": {
"ko": "SF_HambakSnow",
"ja": "KaiseiTokumin-Bold"
},
"KaiseiTokumin-Medium": {
"ko": "SF_HambakSnow",
"ja": "KaiseiTokumin-Medium"
},
"GN-Kin-iro_SansSerif": {
"ko": "NEXONFootballGothicB",
"ja": "GN-Kin-iro_SansSerif"
},
"GenEi-M-Gothic-Medium": {
"ko": "NotoSansKR-Regular",
"ja": "GenEi-M-Gothic-Medium"
},
"GN-Koharuiro_Sunray": {
"ko": "establishRetrosans",
"ja": "GN-Koharuiro_Sunray"
},
"001Shirokuma-Regular": {
"ko": "NotoSansKR-Regular",
"ja": "001Shirokuma-Regular"
},
"NicoMoji v2": {
"ko": "Jalnan",
"ja": "NicoMoji v2"
},
"rounded-x-mgenplus-1c-medium": {
"ko": "AppleSDGothicNeoEB00",
"ja": "rounded-x-mgenplus-1c-medium"
},
"Mushin": {
"ko": "BazziRegular",
"ja": "Mushin"
},
"uzura_font": {
"ko": "BBTreeC_B",
"ja": "uzura_font"
},
"CP-Font": {
"ko": "SBAggroB",
"ja": "CP-Font"
},
"NatsuzemiMaruGothic-Black": {
"ko": "GmarketSansBold",
"ja": "NatsuzemiMaruGothic-Black"
},
"851CHIKARA-DZUYOKU-KANA-A": {
"ko": "NotoSansKR-Medium",
"ja": "851CHIKARA-DZUYOKU-KANA-A"
},
"GN-KMBFont-UB-NewstyleKanaA": {
"ko": "RixInooAriDuriR",
"ja": "GN-KMBFont-UB-NewstyleKanaA"
},
"PretendardJP-Light": {
"ko": "NotoSansKR-Regular",
"ja": "PretendardJP-Light"
},

"PyeongChangPeace-Light": {
"ko": "PyeongChangPeace-Light",
"ja": "Togalite-light"
},
"OTHakgyoansimGureumR": {
"ko": "OTHakgyoansimGureumR",
"ja": "CP-period"
},
"HakgyoansimBareonbatangB": {
"ko": "HakgyoansimBareonbatangB",
"ja": "KaiseiTokumin-Medium"
},
"OTHakgyoansimMulgyeolB": {
"ko": "OTHakgyoansimMulgyeolB",
"ja": "CP-period"
},
"CookieRun-Regular": {
"ko": "CookieRun-Regular",
"ja": "rounded-x-mgenplus-1c-medium"
},
"LOTTERIADDAG": {
"ko": "LOTTERIADDAG",
"ja": "CP-period"
},
"KOTRA HOPE": {
"ko": "KOTRA HOPE",
"ja": "bananaslipplus"
},
"LOTTERIACHAB": {
"ko": "LOTTERIACHAB",
"ja": "CP-Font"
},
"SBAggroL": {
"ko": "SBAggroL",
"ja": "JNR_Font"
},
"OTHakgyoansimRikodeoR": {
"ko": "OTHakgyoansimRikodeoR",
"ja": "NicoMoji v2"
},
"SunBatang-Medium": {
"ko": "SunBatang-Medium",
"ja": "KaiseiTokumin-Medium"
},
"SDKukdetopokki-bBd": {
"ko": "SDKukdetopokki-bBd",
"ja": "KaiseiTokumin-Bold"
},
"Cafe24Ssurround": {
"ko": "Cafe24Ssurround",
"ja": "HackGen-Bold"
},
"BagelFatOne-Regular": {
"ko": "BagelFatOne-Regular",
"ja": "CP-Font"
},
"neurimboGothicRegular": {
"ko": "neurimboGothicRegular",
"ja": "GN-Koharuiro_Sunray"
},
"Pretendard-Medium": {
"ko": "Pretendard-Medium",
"ja": "rounded-x-mgenplus-1c-medium"
},
"KCCAhnchangho": {
"ko": "KCCAhnchangho",
"ja": "Natsume"
},
"DOSMyungjo": {
"ko": "DOSMyungjo",
"ja": "Mushin"
},
"DNFBitBitv2": {
"ko": "DNFBitBitv2",
"ja": "rounded-x-mgenplus-1c-black"
},
"GabiaCheongyeon": {
"ko": "GabiaCheongyeon",
"ja": "Natsume"
}
}
86 changes: 23 additions & 63 deletions lib/test_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,68 +45,28 @@ class _TestWidgetState extends State<TestWidget> {
});

Map filteredText = {
"Title_DA003": true,
"Title_DA005": true,
"Title_DA018": true,
"Title_DA023": true,
"Title_DA024": true,
"Title_DA029": true,
"Title_ES002": true,
"Title_ES003": true,
"Title_ES005": true,
"Title_ES006": true,
"Title_ES007": true,
"Title_HJ003": true,
"Title_HJ006": true,
"Title_HJ007": true,
"Title_HJ008": true,
"Title_HJ010": true,
"Title_HJ014": true,
"Title_HJ020": true,
"Title_HJ021": true,
"Title_JH001": true,
"Title_JH005": true,
"Title_JH009": true,
"Title_JH010": true,
"Title_JH013": true,
"Title_JH014": true,
"Title_JH015": true,
"Title_JH016": true,
"Title_ON008": true,
"Title_SW006": true,
"Title_SW013": true,
"Title_SW014": true,
"Title_SW029": true,
"Title_SW034": true,
"Title_SW036": true,
"Title_SW038": true,
"Title_SW042": true,
"Title_SW045": true,
"Title_YE001": true,
"Title_YE002": true,
"Title_YE003": true,
"Title_YJ001": true,
"Title_YJ002": true,
"Title_YJ003": true,
"Title_YJ007": true,
"Title_YJ011": true,
"Title_YJ014": true,
"Title_YJ019": true,
"Title_YJ026": true,
"Title_YJ027": true,
"Title_YJ028": true,
"Title_YJ029": true,
"Title_YJ030": true,
"Title_YJ031": true,
"Title_YJ032": true,
"Title_YJ033": true,
"Title_YJ034": true,
"Title_YJ035": true,
"Title_YJ036": true,
"Title_YJ037": true,
"Title_YJ038": true,
"Title_YJ039": true,
"Title_YJ040": true,
"Title_SW046": true,
"Title_SW047": true,
"Title_SW048": true,
"Title_SW049": true,
"Title_SW050": true,
"Title_SW051": true,
"Title_SW052": true,
"Title_SW053": true,

"Title_SW054": true,
"Title_SW055": true,
"Title_SW056": true,
"Title_SW057": true,
"Title_SW058": true,
"Title_SW059": true,
"Title_SW060": true,
"Title_SW061": true,
"Title_SW062": true,
"Title_SW063": true,
"Title_SW064": true,
"Title_SW065": true,
"Title_SW066": true,
};

for (int i = 0; i < allTexts.length; i++) {
Expand Down Expand Up @@ -160,7 +120,7 @@ class _TestWidgetState extends State<TestWidget> {
// "-pix_fmt",
// "yuv420p",
// "$webmPath/$currentText.mp4",
// "$webmPath/${currentTextData.group}_$currentText.mp4",
// // "$webmPath/${currentTextData.group}_$currentText.mp4",

"-y"
], (p0) => null);
Expand Down
10 changes: 5 additions & 5 deletions lib/vm_sdk/impl/vm_text_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class VMTextWidget extends StatelessWidget {
_dataMapTwoLine[id] = await loadTextWidgetData(id, 2, language);
}

await setTextValue(initTexts ?? ["THIS IS TITLE!"]);
await setTextValue(initTexts ?? ["THIS IS TITLE!"], isReloadWebView: true);
}

Future<void> setTextValue(List<String> values, {bool isExtractPreviewImmediate = true}) async {
Future<void> setTextValue(List<String> values, {bool isExtractPreviewImmediate = true, bool isReloadWebView = false}) async {
_texts = [];
_texts.addAll(values);

Expand Down Expand Up @@ -101,7 +101,7 @@ class VMTextWidget extends StatelessWidget {


if (isExtractPreviewImmediate) {
await extractPreview();
await extractPreview(isReloadWebView: isReloadWebView);
}
}

Expand Down Expand Up @@ -156,14 +156,14 @@ class VMTextWidget extends StatelessWidget {
return _dataMapOneLine.containsKey(_id) ? _dataMapOneLine[_id] : null;
}

Future<void> extractPreview() async {
Future<void> extractPreview({ isReloadWebView = false }) async {
TextWidgetData? _data = _getTextWidgetData();
if (_data == null) return;

_data.texts = [];
_data.texts.addAll(_texts);

// await _reload();
if (isReloadWebView) await _reload();
await _removeAll();
_currentDirPath = "${await getAppDirectoryPath()}/${_id}_${DateTime.now().millisecondsSinceEpoch}";
_currentPreviewPath = "$_currentDirPath/preview";
Expand Down

0 comments on commit 4614d92

Please sign in to comment.