Tool/library to add ruby text to subtitles
Project description
Migaku rubysubs
Tool/library to add ruby text to Advanced SubStation Alpha (.ass) subtitles.
rubysubs is licensed under LGPLv3. See LICENSE for further detail.
Installation
Run the following to install:
pip install rubysubs
For binary releases refer to the releases page.
Usage as tool
rubysubs <source subtitle> <output subtitle> [<tag parser> [arg0] [arg1] ...]
- Source subtilte: Path to source subtitle file
- Output subtilte: Path to output subtitle file
- Tag parser (optional):
- ruby (default): Ruby square bracket tags, no arguments
- ja: Migaku Japanese tag parser
- arg0: mode (furigana/kanji/kana, default: furigana)
- arg1: pitch highlighting (yes/no, default: yes)
- arg2: pitch shapes (yes/no, default: no)
- arg3: unknown word underlining (yes/no, default: yes)
- arg4: 1T word highlighting (yes/no, default: yes)
Examples:
rubysubs source.ass out.ass
rubysubs source_ja.ass out_ja_furigana_no_markings.ass ja furigana no no no no
rubysubs source_ja.ass out_ja_kana_all_markings.ass ja kana yes yes yes yes
Notes:
- Style info is pulled from the style called
Default
ScaleX
andScaleY
are reset to 100Spacing
andAngle
are reset to 0Italic
,Underline
andStrikeout
are reset.Bold
is supportedAlignment
is currently fixed to bottom-center withMarginV
being considered
PlayResX
andPlayResY
script info tags should be set to allow screen postion calculations. Defaults to 1920x1080- No ASS tags are supported
Usage as library
import sys
import rubysubs
from PyQt5.QtGui import QGuiApplication
# Required for QFontMetrics
qapp = QGuiApplication(sys.argv)
rubysubs.convert_sub_file('source.ass', 'out.ass', rubysubs.tag_parse_ruby.parse)
rubysubs.convert_sub_file('source_jp.ass', 'out_ja.ass', rubysubs.tag_parse_migaku_ja.parse)
Todo
- Support overlapping subtitles
- Automatic line breaks
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
rubysubs-0.1.0.tar.gz
(12.0 kB
view hashes)
Built Distributions
rubysubs-0.1.0-py3.9.egg
(33.1 kB
view hashes)
rubysubs-0.1.0-py3-none-any.whl
(18.5 kB
view hashes)