Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idsulik/php-ass
PHP Advanced Substation Alpha (ASS) Subtitle Parser/Formatter
https://github.com/idsulik/php-ass
ass subtitle
Last synced: about 2 months ago
JSON representation
PHP Advanced Substation Alpha (ASS) Subtitle Parser/Formatter
- Host: GitHub
- URL: https://github.com/idsulik/php-ass
- Owner: idsulik
- License: mit
- Created: 2024-07-03T07:50:14.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T13:00:17.000Z (6 months ago)
- Last Synced: 2024-10-08T02:05:52.997Z (3 months ago)
- Topics: ass, subtitle
- Language: PHP
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Advanced Substation Alpha (ASS) Subtitle Parser/Formatter
## Overview
`php-acc` is a PHP library designed for working with Advanced Substation Alpha (ASS) subtitle files. This library allows
you to build, modify, and manage ASS subtitle files programmatically.## Features
- **Text Formatting**: Easily add and manage various text formatting options such as bold, italic, underline, and
strikeout.
- **Styling**: Apply styles including font, font size, and text color.
- **Positioning and Animation**: Set precise text positions, animate text with movement, fading, and transitions.## Installation
You can install the library via Composer. Add the following to your `composer.json`:
```json
{
"require": {
"idsulik/php-acc": "dev-main"
}
}
```Then run:
```bash
composer install
```Alternatively, you can clone the repository and include the necessary files manually.
## Usage
### Building Subtitle Text
The `EventTextBuilder` class allows you to construct ASS subtitle text with various commands. Here’s an example:
```php
addPlainText('Normal Text Before')
->addBoldText('Bold ')
->addItalicText('Italic ')
->addUnderlineText('Underline ')
->addStrikeoutText('Strikeout ')
->addFont('Arial')
->addFontSize(24)
->addPrimaryColor('FF0000')
->addSecondaryColor('00FF00')
->addOutlineColor('0000FF')
->addBackColor('FFFF00')
->addOutline(2)
->addShadow(3)
->addAlignment(5)
->addPosition(100.5, 200.75)
->addMove(0, 0, 100, 100, 1, 2)
->addFade(255, 128, 64, 0, 1000, 2000, 3000)
->addTransition(0, 1000, '1.0')
->resetStyle()
->addPlainText('Normal Text After');echo $builder->build();
```## Contributing
Contributions are welcome!
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.