-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Emmanuel Peralta
committed
Sep 16, 2024
1 parent
f505deb
commit 4790bca
Showing
6 changed files
with
315 additions
and
28 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import unittest | ||
from pathlib import Path | ||
from xml.etree import ElementTree | ||
|
||
from build import read_fixed_from_xml | ||
from utils.smallvwf import VwfAsset | ||
|
||
|
||
class VwfRendererTestCase(unittest.TestCase): | ||
def test_render(self): | ||
vwf = VwfAsset("./fonts/8x8vwf.png") | ||
strings = [] | ||
# with open("./text/fr/monsters.xml", encoding='utf-8') as datasource: | ||
# tree = ElementTree.parse(datasource) | ||
# root = tree.getroot() | ||
# | ||
# for child in root: | ||
# text = child.text | ||
# if text: | ||
# strings.append(text) | ||
|
||
strings = [ | ||
"Objets", "Magie", "Equiper", "Statut", "Placer", "Changer", "Options", "Sauver" | ||
] | ||
|
||
vwf.set_strings(strings) | ||
|
||
vwf.render() | ||
renderd = Path("./renderd.bin") | ||
serialized = vwf.serialize() | ||
|
||
renderd.write_bytes(serialized) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if __name__ == "__main__": | ||
texts = [ | ||
"Requis", | ||
"Garde", | ||
"Rang" | ||
] | ||
t = ' '.join(texts) | ||
|
||
available = sorted({c for c in t}) | ||
print(''.join(sorted(available))) | ||
print (len(available)) | ||
mp_needed = [available.index(c) + 0xdd for c in "Requis"] | ||
# mp_needed[mp_needed.index(0xdd)]= 0xff | ||
|
||
garde_text = [available.index(c) + 0xdd for c in "Garde "] | ||
garde_text[garde_text.index(0xdd)]= 0xff | ||
|
||
passer_text = [available.index(c) + 0xdd for c in "Rang"] | ||
|
||
print(mp_needed) | ||
print(garde_text) | ||
print(passer_text) |
Oops, something went wrong.