Skip to main content

FontCollector for Advanced SubStation Alpha file.

Project description

FontCollector

FontCollector - Version FontCollector - Python Version FontCollector - Downloads FontCollector - Coverage FontCollector - mypy

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

Usage

$ fontcollector --help
usage: fontcollector [-h] --input [INPUT ...] [-mkv MKV] [--output OUTPUT] [-mkvpropedit MKVPROPEDIT] [--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 ...], -i [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.
  --output OUTPUT, -o OUTPUT
                        Destination path of the font. If -o and -mkv aren't specified, it will be the current path.
  -mkvpropedit MKVPROPEDIT
                        Path to mkvpropedit.exe 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" -mkvpropedit "C:\Program Files\MKVToolNix\mkvpropedit.exe"

Mux the font from the .ass file into an mkv and delete the currently attached fonts.

fontCollector -i "file1.ass" -mkv "example.mkv" -mkvpropedit "C:\Program Files\MKVToolNix\mkvpropedit.exe" -d

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fontcollector-3.1.1.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

fontcollector-3.1.1-py3-none-any.whl (56.7 kB view details)

Uploaded Python 3

File details

Details for the file fontcollector-3.1.1.tar.gz.

File metadata

  • Download URL: fontcollector-3.1.1.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fontcollector-3.1.1.tar.gz
Algorithm Hash digest
SHA256 42464cf3a42bfc30416dd6aca24aa80fd79c91dea98edf7099961ce995832f03
MD5 13a16efeb19aa3a3476bbbb3505b71f7
BLAKE2b-256 4a4dd735d13b5d88e1e9b448e25b8c12586e681546aa9f328389d17013002f65

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontcollector-3.1.1.tar.gz:

Publisher: publish_to_pypi.yml on moi15moi/FontCollector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fontcollector-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: fontcollector-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 56.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fontcollector-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26daf37aad4c96e329e1a37441da1bff879ee2984f510831ca98d72abb06cf71
MD5 5d6972d3365a4e4982aa9d330ca48833
BLAKE2b-256 6e11aa8190942ccc8f19b96e7cdd54d26441937807c7b4e5715aabf3f9d77bb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fontcollector-3.1.1-py3-none-any.whl:

Publisher: publish_to_pypi.yml on moi15moi/FontCollector

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page