Skip to content

Commit

Permalink
Add some progression text in console and a done message
Browse files Browse the repository at this point in the history
  • Loading branch information
HappiePlant committed Aug 24, 2024
1 parent 3beaac5 commit 26bb05d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/minecraft_seven/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ def check_minecraft_version(jar_path: str):


def main() -> None:
print("Getting jar file...")
jar_path = get_jar_path()
check_minecraft_version(jar_path)

tileset, glyphs, dimensions = build_font_assets(jar_path, MINECRAFT_VERSION)

print("Exporting...")
export_to_pixel_font_converter_batch(tileset, glyphs, dimensions)


Expand Down
4 changes: 2 additions & 2 deletions src/minecraft_seven/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ def build_tileset(
def build_font_assets(
jar_path: str, mc_version: str
) -> tuple[Image, str, OutputDimensions]:
print("Getting assets...")
dimensions = load_dimensions(mc_version)
providers, output_dimensions = get_assets(jar_path, dimensions)
for provider in providers:
print(provider.id)

print("Building tileset...")
tileset, glyphs = build_tileset(providers, output_dimensions)

return tileset, glyphs, output_dimensions
24 changes: 24 additions & 0 deletions src/minecraft_seven/pixel_font_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,27 @@ def export_to_pixel_font_converter_batch(
json.dump(settings, settings_output_file)

tileset.save("out/Minecraft Seven.png")

show_done_msg()


def show_done_msg():
print(f"""
Done!
1. Go to {link("https://yal.cc/r/20/pixelfont/", "[🔗 Pixel Font Converter]")}
2. Click `Menu` on the upper left and select `Batch process`
3. Navigate to the `out` folder in this repo and select both the `png` and `json` file. (by holding `Ctrl`)
4. Install the ttf in the downloaded zip!
""")


def link(uri: str, label: str = None):
if label is None:
label = uri
parameters = ""

# OSC 8 ; params ; URI ST <name> OSC 8 ;; ST
escape_mask = "\033]8;{};{}\033\\{}\033]8;;\033\\"

return escape_mask.format(parameters, uri, label)

0 comments on commit 26bb05d

Please sign in to comment.