better docs
This commit is contained in:
parent
6fdc14e7fc
commit
f084bb0d1b
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
42
README.md
42
README.md
|
@ -2,25 +2,57 @@
|
||||||
|
|
||||||
a collection of fonts that are licenced under the Open Font Licence
|
a collection of fonts that are licenced under the Open Font Licence
|
||||||
|
|
||||||
**except for**:
|
**except for**
|
||||||
|
|
||||||
- `sources/JohnnyGLTFont.zip` by u/JohnnyDZ0707 [(link)](https://old.reddit.com/r/GirlsLastTour/comments/e5wprz/i_made_a_font_link_in_comments_english_numbers/)
|
- `sources/JohnnyGLTFont.zip` by u/JohnnyDZ0707 [(link)](https://old.reddit.com/r/GirlsLastTour/comments/e5wprz/i_made_a_font_link_in_comments_english_numbers/)
|
||||||
|
|
||||||
|
## instructions
|
||||||
|
|
||||||
steps to extract everything from the zip files:
|
steps to extract everything from the zip files:
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> tips for windows users:
|
||||||
|
>
|
||||||
|
> - when extracting, you can select all the zip files via clicking on `Type` to sort by type, then selecting all the zip files
|
||||||
|
|
||||||
|
|
||||||
1. extract every `sources/*.zip` to `sources/ext/*`
|
1. extract every `sources/*.zip` to `sources/ext/*`
|
||||||
|
|
||||||
for windows: select everything in sources, right click, `Extract files...` (7-zip)
|
for windows: select everything in sources, right click, `Extract files...` (7-zip)
|
||||||
|
|
||||||
modify the path to add a `ext/` after `sources/`
|
modify the path to add a `ext/` after `sources/`
|
||||||
|
|
||||||
![instructions](extract.png)
|
![instructions](extract-7zip-example.png)
|
||||||
|
|
||||||
2. run `python extract.py`
|
2. run `python extract.py`
|
||||||
|
|
||||||
this will extract all the fonts to `files/`
|
this will extract all the fonts to `files/`
|
||||||
|
|
||||||
tips for windows users:
|
for windows users or non-power users:
|
||||||
|
- right-click in the newly created `fonts` folder
|
||||||
|
- right-click, and click on `Open in Terminal`
|
||||||
|
- then, type out '`python extract.py`' (without the single quotes btw) within the black box
|
||||||
|
- press enter to run it
|
||||||
|
|
||||||
- when extracting, you can select all the zip files via clicking on `Type` to sort by type, then selecting all the zip files
|
![example](extract-terminal-example.png)
|
||||||
- inside the new `files` folder, you can select all the fonts, right click, and `Install` or `Install for all users`
|
|
||||||
|
if you get an error, you might need to install python from [here](https://www.python.org/downloads/)
|
||||||
|
|
||||||
|
3. install the fonts in `files/`
|
||||||
|
|
||||||
|
- **for windows**
|
||||||
|
select all the fonts, right-click, `Install` or `Install for all users`
|
||||||
|
|
||||||
|
- **for mac**
|
||||||
|
copy the fonts to `~/Library/Fonts/`
|
||||||
|
|
||||||
|
- **for Plan9 or 9front**
|
||||||
|
copy the fonts to `/lib/font/bit/` after converting them with <https://git.sr.ht/~ft/ttfs>
|
||||||
|
|
||||||
|
- **for bsds**
|
||||||
|
copy the fonts to `~/.fonts/` or `/usr/local/share/fonts/`
|
||||||
|
|
||||||
|
- **for linux**
|
||||||
|
copy the fonts to `~/.local/share/fonts/`, `/usr/share/fonts/`, or `/usr/local/share/fonts/`
|
||||||
|
|
||||||
|
for *nix systems, you can also use a font manager if you prefer
|
||||||
|
|
BIN
extract-terminal-example.png
(Stored with Git LFS)
Normal file
BIN
extract-terminal-example.png
(Stored with Git LFS)
Normal file
Binary file not shown.
28
extract.py
28
extract.py
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import copy2
|
from shutil import copy2
|
||||||
|
from sys import argv
|
||||||
|
from shutil import get_terminal_size
|
||||||
|
|
||||||
|
|
||||||
# sources: source font zip files are
|
# sources: source font zip files are
|
||||||
# sources/ext: extracted content of source/*.zip
|
# sources/ext: extracted content of source/*.zip
|
||||||
|
@ -27,19 +30,40 @@ def main():
|
||||||
pre_exists: bool = PRE_DIR.exists()
|
pre_exists: bool = PRE_DIR.exists()
|
||||||
tracking: list[str] = []
|
tracking: list[str] = []
|
||||||
|
|
||||||
|
# get terminal size, if possible
|
||||||
|
col: int = 0
|
||||||
|
lns: int = 0
|
||||||
|
try:
|
||||||
|
col, lns = get_terminal_size()
|
||||||
|
except Exception:
|
||||||
|
col, lns = 0, 0
|
||||||
|
|
||||||
# recursively iterate through SOURCES_EXT_DIR
|
# recursively iterate through SOURCES_EXT_DIR
|
||||||
for path in SOURCES_EXT_DIR.rglob('*'):
|
for path in SOURCES_EXT_DIR.rglob('*'):
|
||||||
# if it is an otf or ttf file, copy just the file to FILES_DIR
|
# if it is an otf or ttf file, copy just the file to FILES_DIR
|
||||||
if path.is_file() and path.suffix in ['.otf', '.ttf']:
|
if path.is_file() and path.suffix in ['.otf', '.ttf']:
|
||||||
|
# if the file starts with a dot, skip
|
||||||
|
if path.stem.startswith('.'):
|
||||||
|
if "-v" in argv:
|
||||||
|
print(f"{path.relative_to(SOURCES_DIR)} (skipped)")
|
||||||
|
continue
|
||||||
|
|
||||||
# if we already copied either its otf or ttf counterpart, skip
|
# if we already copied either its otf or ttf counterpart, skip
|
||||||
if path.stem in tracking:
|
if path.stem in tracking:
|
||||||
print(f"{path} (skipped)")
|
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
tracking.append(path.stem)
|
tracking.append(path.stem)
|
||||||
dest = FILES_DIR.joinpath(path.name)
|
dest = FILES_DIR.joinpath(path.name)
|
||||||
copy2(path, dest)
|
copy2(path, dest)
|
||||||
print(f"{path} -> {dest}")
|
|
||||||
|
# print 'path' and 'dest' in a short format
|
||||||
|
if "-v" in argv:
|
||||||
|
print(f"{str(path.relative_to(SOURCES_DIR.parent))} -> {str(dest.relative_to(FILES_DIR.parent))}")
|
||||||
|
else:
|
||||||
|
print(f"\r{str(dest.relative_to(FILES_DIR.parent)).ljust(col)}", end="")
|
||||||
|
else:
|
||||||
|
print()
|
||||||
|
|
||||||
# if PRE_DIR exists, recursively iterate through it and then see
|
# if PRE_DIR exists, recursively iterate through it and then see
|
||||||
# what files in the PRE_DIR are not in PRE_DIR
|
# what files in the PRE_DIR are not in PRE_DIR
|
||||||
|
|
Loading…
Reference in a new issue