Decompile pl_font.narc and rebuild from sources

This commit is contained in:
Rachel
2024-10-13 18:35:52 -07:00
parent 49942063e9
commit 0e51591c26
18 changed files with 265 additions and 3 deletions

View File

@@ -216,7 +216,7 @@ e7266bd8b7095861b6e1fdaf4f13cb648a9c325d *res/prebuilt/graphic/footprint_board.n
e22f0296444ce01e0b7619f73a8cf2016b2307b4 *res/prebuilt/graphic/oekaki.narc
917f25f4e5bb3f5e1837471d2a90225e9e95363d *res/prebuilt/graphic/opening.narc
dd0663e46347230d1d1b9eb8b583cee9acc10f31 *res/prebuilt/graphic/pl_bag_gra.narc
0929061d78710595aa53796ecffe3545f8406d82 *res/prebuilt/graphic/pl_font.narc
0929061d78710595aa53796ecffe3545f8406d82 *res/fonts/pl_font.narc
d397dbd087737151aa8bea242016c626afb55fa5 *res/prebuilt/graphic/pl_plist_gra.narc
883e6afb310f0ab02c26f2026cba1c76210bb3ac *res/prebuilt/graphic/pl_pst_gra.narc
c16faeeeee494830c720d1f795a141cacfe49121 *res/prebuilt/graphic/pl_wifinote.narc

View File

@@ -309,7 +309,13 @@ RomSpec
File graphic/oekaki.narc
File graphic/opening.narc
File graphic/pl_bag_gra.narc
File graphic/pl_font.narc
Root /graphic
HostRoot res/fonts
File pl_font.narc
Root /
HostRoot res/prebuilt
File graphic/pl_plist_gra.narc
File graphic/pl_pst_gra.narc
File graphic/pl_wifinote.narc

View File

@@ -0,0 +1,38 @@
{
"maxGlyphWidth": 16,
"maxGlyphHeight": 16,
"glyphWidths": [
7, 10, 10, 10, 10, 9, 10, 9, 10, 10, 10, 11, 11, 9, 11, 9,
11, 10, 11, 9, 11, 10, 11, 9, 10, 11, 11, 10, 11, 10, 11, 11,
11, 10, 11, 10, 10, 11, 10, 11, 9, 11, 10, 9, 10, 10, 10, 10,
11, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 10, 10, 10, 10, 10,
10, 10, 10, 10, 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, 6, 6, 5, 5, 6, 6,
6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 12,
12, 6, 1, 2, 4, 8, 16, 5, 6, 8, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
}

BIN
res/fonts/font_message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

View File

@@ -0,0 +1,38 @@
{
"maxGlyphWidth": 16,
"maxGlyphHeight": 16,
"glyphWidths": [
7, 11, 13, 12, 12, 10, 11, 10, 13, 12, 13, 13, 14, 12, 14, 10,
14, 13, 14, 13, 13, 12, 14, 12, 12, 13, 14, 13, 14, 13, 13, 13,
13, 13, 13, 11, 12, 13, 12, 13, 12, 13, 13, 13, 13, 13, 13, 13,
14, 13, 13, 13, 13, 13, 14, 13, 13, 13, 13, 13, 14, 14, 12, 13,
13, 13, 13, 11, 13, 11, 13, 10, 12, 12, 12, 13, 13, 13, 13, 13,
13, 10, 12, 10, 13, 11, 13, 11, 12, 10, 13, 13, 14, 13, 13, 12,
14, 13, 14, 11, 13, 13, 14, 13, 14, 13, 13, 13, 14, 13, 14, 12,
14, 13, 14, 11, 13, 14, 13, 14, 11, 12, 13, 13, 12, 13, 11, 13,
14, 13, 12, 13, 12, 12, 13, 13, 13, 13, 13, 13, 14, 13, 13, 12,
13, 13, 13, 11, 13, 11, 12, 10, 11, 13, 12, 13, 11, 12, 12, 12,
12, 11, 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10,
9, 11, 11, 8, 11, 11, 10, 11, 11, 12, 11, 13, 11, 11, 10, 11,
11, 12, 11, 11, 10, 10, 10, 10, 10, 10, 9, 10, 10, 6, 7, 9,
6, 11, 10, 10, 10, 10, 10, 10, 9, 10, 10, 11, 10, 10, 10, 0,
10, 11, 8, 10, 11, 8, 8, 10, 10, 10, 10, 8, 8, 9, 9, 12,
11, 11, 11, 11, 11, 7, 7, 8, 8, 12, 12, 13, 13, 13, 13, 13,
12, 13, 13, 13, 12, 13, 13, 12, 13, 10, 12, 12, 12, 12, 12, 12,
13, 11, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 0, 11,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 7, 7, 4, 6, 7, 5,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 11, 7, 7, 7, 7, 7, 5, 5, 5, 5, 7, 7,
7, 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 7, 7, 11, 11,
7, 7, 7, 7, 10, 10, 7, 7, 5, 7, 7, 7, 6, 6, 7, 7,
7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 5, 7, 14,
14, 7, 1, 2, 4, 8, 16, 5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -0,0 +1,38 @@
{
"maxGlyphWidth": 16,
"maxGlyphHeight": 16,
"glyphWidths": [
7, 10, 10, 10, 10, 9, 10, 9, 10, 10, 10, 11, 11, 9, 11, 9,
11, 10, 11, 9, 11, 10, 11, 9, 10, 11, 11, 10, 11, 10, 11, 11,
11, 10, 11, 10, 10, 11, 10, 11, 9, 11, 10, 9, 10, 10, 10, 10,
11, 11, 10, 11, 11, 10, 11, 11, 11, 11, 11, 10, 11, 11, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 10, 11, 9,
11, 10, 11, 9, 11, 10, 11, 10, 11, 10, 11, 10, 11, 9, 11, 9,
11, 10, 11, 10, 10, 11, 10, 11, 9, 10, 10, 10, 10, 9, 9, 10,
11, 11, 9, 10, 10, 10, 11, 11, 10, 11, 11, 10, 11, 11, 10, 9,
10, 10, 10, 10, 10, 10, 10, 9, 10, 10, 9, 10, 9, 10, 10, 10,
10, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 8, 7, 7, 7, 7, 7, 7, 6, 7, 7, 3, 6, 7,
4, 7, 7, 7, 7, 7, 6, 7, 6, 7, 7, 7, 7, 6, 7, 0,
6, 10, 5, 6, 9, 5, 8, 7, 7, 8, 8, 6, 6, 8, 8, 8,
8, 8, 8, 8, 8, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 11, 12, 11, 11, 11, 11, 11, 12, 7, 6, 6, 7, 6, 9,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 3, 5, 6, 4,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 10, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 10, 6, 6, 6, 6, 6, 4, 4, 4, 4, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10,
6, 6, 6, 6, 8, 8, 5, 7, 4, 6, 6, 6, 5, 5, 6, 6,
6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 5, 12,
12, 6, 1, 2, 4, 8, 16, 5, 6, 8, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
}

BIN
res/fonts/font_system.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

38
res/fonts/font_unown.json Normal file
View File

@@ -0,0 +1,38 @@
{
"maxGlyphWidth": 12,
"maxGlyphHeight": 16,
"glyphWidths": [
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]
}

BIN
res/fonts/font_unown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

75
res/fonts/meson.build Normal file
View File

@@ -0,0 +1,75 @@
fonts = {
'font_system.NFGR': files('font_system.png', 'font_system.json'),
'font_message.NFGR': files('font_message.png', 'font_message.json'),
'font_subscreen.NFGR': files('font_subscreen.png', 'font_subscreen.json'),
'font_unown.NFGR': files('font_unown.png', 'font_unown.json'),
}
nfgr_gen = generator(nitrogfx_exe,
arguments: [ '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', ],
output: '@BASENAME@.NFGR',
)
pl_font_nfgrs = []
foreach target, inputs: fonts
nfgr = custom_target(target,
output: target,
input: inputs,
command: [
nitrogfx_exe,
'@INPUT0@',
'@OUTPUT@',
'-metadata', '@INPUT1@',
]
)
pl_font_nfgrs += mv_gen.process(nfgr)
# pl_font_nfgrs += nfgr_gen.process(inputs[0],
# extra_args: [ '-metadata', inputs[1], ],
# )
endforeach
font_special_chars_png = files('font_special_chars.png')
font_special_chars_ncgr = ncgr_gen.process(font_special_chars_png,
extra_args: [ '-sopc', '-version101', ],
)
font_special_chars_ncgr_lz = lz_gen.process(font_special_chars_ncgr)
font_special_chars_nclr = nclr_gen.process(font_special_chars_png,
extra_args: [ '-bitdepth', '4', '-nopad', '-pcmp', ],
)
screen_indicators_png = files('screen_indicators.png')
screen_indicators_ncgr = ncgr_gen.process(screen_indicators_png,
extra_args: [ '-sopc', '-version101', ],
)
screen_indicators_nclr = nclr_gen.process(screen_indicators_png,
extra_args: [ '-bitdepth', '4', ],
)
pl_font_order = files('pl_font.order')
pl_font_ignore = files('pl_font.ignore')
pl_font_narc = custom_target('pl_font.narc',
output: [
'pl_font.narc',
'pl_font.naix',
],
input: [
pl_font_nfgrs,
font_special_chars_ncgr_lz,
font_special_chars_nclr,
screen_indicators_ncgr,
screen_indicators_nclr,
pl_font_order,
pl_font_ignore,
],
command: [
knarc_exe,
'-d', '@PRIVATE_DIR@',
'-p', '@OUTPUT0@',
'--order', pl_font_order,
'--ignore', pl_font_ignore,
'--naix',
],
)
nitrofs_files += pl_font_narc[0]
naix_headers += pl_font_narc[1]

1
res/fonts/pl_font.ignore Normal file
View File

@@ -0,0 +1 @@
font_special_chars.NCGR

8
res/fonts/pl_font.order Normal file
View File

@@ -0,0 +1,8 @@
font_system.NFGR
font_message.NFGR
font_subscreen.NFGR
font_unown.NFGR
font_special_chars.NCGR.lz
screen_indicators.NCGR
font_special_chars.NCLR
screen_indicators.NCLR

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

View File

@@ -30,8 +30,29 @@ s_to_bin_gen = generator(make_script_bin_sh,
output: '@BASENAME@'
)
mv_gen = generator(find_program('mv'),
arguments: [ '@INPUT@', '@OUTPUT@', ],
output: '@PLAINNAME@',
)
ncgr_gen = generator(nitrogfx_exe,
arguments: [ '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', ],
output: '@BASENAME@.NCGR',
)
nclr_gen = generator(nitrogfx_exe,
arguments: [ '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', ],
output: '@BASENAME@.NCLR',
)
lz_gen = generator(nitrogfx_exe,
arguments: [ '@INPUT@', '@OUTPUT@', '@EXTRA_ARGS@', ],
output: '@PLAINNAME@.lz',
)
subdir('battle')
subdir('field')
subdir('fonts')
subdir('items')
subdir('pokemon')
subdir('sound')

View File

@@ -29,7 +29,6 @@ prebuilt_files = [
'oekaki.narc',
'opening.narc',
'pl_bag_gra.narc',
'pl_font.narc',
'pl_plist_gra.narc',
'pl_pst_gra.narc',
'pl_wifinote.narc',

Binary file not shown.