-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-local.ps1
executable file
·56 lines (44 loc) · 1.42 KB
/
build-local.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#prepare
cd local
rm -rf data/
mkdir data
mkdir data/lang
Invoke-WebRequest -UseBasicParsing "https://github.com/nxengine/tsc-converter/releases/download/v1.1/tsc-v1.1-Win32.zip" -Out tsc.zip
7z x ./tsc.zip
rm ./tsc.zip
Invoke-WebRequest -UseBasicParsing "https://github.com/nxengine/nx-fontgen/releases/download/v1.3/fontbm-v1.3-Win32.zip" -Out fontbm.zip
7z x ./fontbm.zip
rm ./fontbm.zip
Get-ChildItem -Directory | Where {$_.Name -Match "lang_"} | ForEach-Object {
echo "Processing $_"
$name = $_.Name
$lang = $name.Replace("lang_","")
mkdir "data/lang/$lang"
cp -r $name/* "data/lang/$lang"
Get-ChildItem data/lang/$lang/*.txt | ForEach-Object {
$txt = $_.Name
$tsc = $txt.Replace(".txt",".tsc")
./tsc.exe data/lang/$lang/$txt data/lang/$lang/$tsc
rm data/lang/$lang/$txt
}
Get-ChildItem data/lang/$lang/Stage/*.txt | ForEach-Object {
$txt = $_.Name
$tsc = $txt.Replace(".txt",".tsc")
./tsc.exe data/lang/$lang/Stage/$txt data/lang/$lang/Stage/$tsc
rm data/lang/$lang/Stage/$txt
}
$str = Get-Content $name/metadata
$arr = $str.Split(" ")
For ($key=1; $key -le 5; $key++) {
$sizearr = $arr[$key].Split(":")
$font = $arr[0]
$tex = $sizearr[1]
$size = $sizearr[0]
$chars = $arr[6]
./fontbm.exe -F $font --texture-width=$tex --texture-height=$tex -O data/lang/$lang/font_$key -S $size --chars $chars
}
}
rm -f fontbm.exe
rm -f tsc.exe
rm -rf assets
rm -f *.dll