FontCollector for Advanced SubStation Alpha file.
Project description
FontCollector
FontCollector for Advanced SubStation Alpha file. This tool allows to recover and/or mux the fonts necessary in an mkv.
Installation
pip install FontCollector
Dependencies
FontCollector Usage
$ fontcollector --help
usage: fontcollector [-h] [--input INPUT [INPUT ...]] [-mkv MKV] [--use-ass-in-mkv] [--output OUTPUT] [-mkvtoolnix MKVTOOLNIX] [--delete-fonts] [--additional-fonts ADDITIONAL_FONTS [ADDITIONAL_FONTS ...]]
[--additional-fonts-recursive ADDITIONAL_FONTS_RECURSIVE [ADDITIONAL_FONTS_RECURSIVE ...]] [--exclude-system-fonts] [--collect-draw-fonts] [--dont-convert-variable-to-collection] [--logging [LOGGING]]
FontCollector for Advanced SubStation Alpha file.
options:
-h, --help show this help message and exit
--input INPUT [INPUT ...], -i INPUT [INPUT ...]
Subtitles file. Must be an ASS file/directory. You can specify more than one .ass file/path.
-mkv MKV
Video where the fonts will be merge. Must be a Matroska file.
--use-ass-in-mkv, -ass-mkv
If specified, it will use the .ass file muxed to the mkv and collect those fonts and mux them to the mkv. If not specified, it will do nothing.
--output OUTPUT, -o OUTPUT
Destination path of the font. If -o and -mkv aren't specified, it will be the current path.
-mkvtoolnix MKVTOOLNIX
Path to the MKVToolNix folder if not in variable environments. If -mkv is not specified, it will do nothing.
--delete-fonts, -d
If -d is specified, it will delete the font attached to the mkv before merging the new needed font. If -mkv is not specified, it will do nothing.
--additional-fonts ADDITIONAL_FONTS [ADDITIONAL_FONTS ...], -add-fonts ADDITIONAL_FONTS [ADDITIONAL_FONTS ...]
May be a directory containing font files or a single font file. You can specify more than one additional-fonts. If it is a directory, it won't search recursively for fonts
--additional-fonts-recursive ADDITIONAL_FONTS_RECURSIVE [ADDITIONAL_FONTS_RECURSIVE ...], -add-fonts-rec ADDITIONAL_FONTS_RECURSIVE [ADDITIONAL_FONTS_RECURSIVE ...]
Path to font directory, which will be recursively searched for fonts.
--exclude-system-fonts
If specified, FontCollector won't use the system font to find the font used by an .ass file.
--collect-draw-fonts
If specified, FontCollector will collect the font used by the draw. For more detail when this is usefull, see: https://github.com/libass/libass/issues/617
--dont-convert-variable-to-collection
If specified, FontCollector won't convert variable font to a font collection. see: https://github.com/libass/libass/issues/386
--logging [LOGGING], -log [LOGGING]
Destination path of log. If it isn't specified, it will be YYYY-MM-DD--HH-MM-SS_font_collector.log.
Examples
Recover fonts from 2 .ass files and save them in the current folder
fontCollector -i "file1.ass" "file2.ass"
Take all the .ass files from the current folder and save the font in the current folder
fontCollector -i .
Mux font from .ass file into an mkv
fontCollector -i "file1.ass" -mkv "example.mkv" -mkvtoolnix "C:\Program Files\MKVToolNix"
Mux the font from the .ass file into an mkv and delete the currently attached fonts.
fontCollector -i "file1.ass" -mkv "example.mkv" -mkvtoolnix "C:\Program Files\MKVToolNix" -d
MKVFontValidator Usage
$ mkvfontvalidator --help
usage: mkvfontvalidator [-h] -mkv MKV [-mkvtoolnix MKVTOOLNIX] [--need-draw-fonts] [--delete-fonts-not-used] [--logging [LOGGING]]
MKV font validator for Advanced SubStation Alpha file.
options:
-h, --help
show this help message and exit
-mkv MKV
The video file to be verified. Must be a Matroska file.
-mkvtoolnix MKVTOOLNIX
Path to the MKVToolNix folder if not in variable environments.
--need-draw-fonts
If specified, MKVFontValidator will report a error if a font used in a draw isn't muxed to the mkv. For more detail when this is usefull, see: https://github.com/libass/libass/issues/617
--delete-fonts-not-used, -d
If specified, MKVFontValidator will remove the fonts that aren't used by the subtitle(s) of the mkv file.
--logging [LOGGING], -log [LOGGING]
Destination path of log. If it isn't specified, it will be YYYY-MM-DD--HH-MM-SS_mkvfontvalidator.log.
Variable Font
Since Libass does not support variable font, this tool will automatically generate a OpenType Font Collection. The generated collection is designed to simulate how VSFilter/GDI handles variable font.
Acknowledgments
- fontmerge for the idea to automatically merge the font into the mkv.
- Myaamori-Aegisub-Scripts Without this tool, I probably could never have created the fontCollector. I got a lot of inspiration from his work.
- PyonFX I inspired myself from his setup.py to create mine.
- rcombs for her help with how VSFilter pick font when faux-bold need to be applied.
- assfc for all the idea behind the font_loader.
- Christopher Leung for his help on how GDI handle variable font.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fontcollector-4.0.1.tar.gz.
File metadata
- Download URL: fontcollector-4.0.1.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3440e1d25f7500be657dc4cadb9f46b7f159b8a587294ff37396d02d0cf00943
|
|
| MD5 |
21267e58fff48cb407f8d95aee5e7cdc
|
|
| BLAKE2b-256 |
077441153e81f9f3d088710faa792146e13b53c87adbe46da186d37b39bb789a
|
Provenance
The following attestation bundles were made for fontcollector-4.0.1.tar.gz:
Publisher:
publish_to_pypi.yml on moi15moi/FontCollector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fontcollector-4.0.1.tar.gz -
Subject digest:
3440e1d25f7500be657dc4cadb9f46b7f159b8a587294ff37396d02d0cf00943 - Sigstore transparency entry: 813267099
- Sigstore integration time:
-
Permalink:
moi15moi/FontCollector@0abf40073ca37cf9f3952a0bba4f6f1fb616fc42 -
Branch / Tag:
refs/tags/4.0.1 - Owner: https://github.com/moi15moi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@0abf40073ca37cf9f3952a0bba4f6f1fb616fc42 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fontcollector-4.0.1-py3-none-any.whl.
File metadata
- Download URL: fontcollector-4.0.1-py3-none-any.whl
- Upload date:
- Size: 66.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6a7590e949a4a9ecd65947214d96c7379b35cfd06a9203b5f6df9f8ad8c5087
|
|
| MD5 |
9baff2549ba98ef4bccaaad1f7c55f4f
|
|
| BLAKE2b-256 |
2eb3006833e40f54d1c75c55d6c5350b3f599dc1ddaabeb76a26fc016b5196b6
|
Provenance
The following attestation bundles were made for fontcollector-4.0.1-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on moi15moi/FontCollector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fontcollector-4.0.1-py3-none-any.whl -
Subject digest:
d6a7590e949a4a9ecd65947214d96c7379b35cfd06a9203b5f6df9f8ad8c5087 - Sigstore transparency entry: 813267101
- Sigstore integration time:
-
Permalink:
moi15moi/FontCollector@0abf40073ca37cf9f3952a0bba4f6f1fb616fc42 -
Branch / Tag:
refs/tags/4.0.1 - Owner: https://github.com/moi15moi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@0abf40073ca37cf9f3952a0bba4f6f1fb616fc42 -
Trigger Event:
release
-
Statement type: