Skip to content

Commit

Permalink
Don't close window
Browse files Browse the repository at this point in the history
  • Loading branch information
naghim committed May 2, 2024
1 parent 391d64c commit b8b6c9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ It will tell you which fonts are missing. Correct each font and try again.

If no fonts are missing, the fonts will be collected into a directory called `fonts`.

# Usage
# Usage (executable)

First, download the latest release from the repository: [GitHub Releases](https://github.com/naghim/Fontos/releases)

To use the program, drag a subtitle file into the `Fontos.exe` program.

The program will open a terminal window and will evaluate whether the fonts in the subtitle are installed or not.

If all fonts are installed, they will be collected into the `fonts` directory.

# Usage (Git repository)

First, install the Python requirements:

Expand Down
5 changes: 4 additions & 1 deletion fontos/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
import os

def main():
font_folder = 'fonts'
subtitle_filename = sys.argv[1] if len(sys.argv) > 1 else 'subtitle.ass'

if not os.path.exists(subtitle_filename):
print(f'{subtitle_filename} is missing!')
input()
sys.exit()

font_folder = os.path.join(os.path.dirname(subtitle_filename), 'fonts')

# First, find all installed fonts...
installed_font_ttfs = windows.find_installed_ttfs()

Expand All @@ -34,6 +36,7 @@ def main():
# All fonts are installed, let's save the fonts into a separate folder!
install.install_fonts(font_folder, subtitle_fonts, installed_fonts)
print('Installed fonts to', os.path.abspath(font_folder))
input()
return

# Not all fonts are found, let's print the ones that are missing
Expand Down

0 comments on commit b8b6c9b

Please sign in to comment.