All Projects → irrwahn → svg2ass

irrwahn / svg2ass

Licence: BSD-3-Clause license
Svg2ass - convert SVG vector graphics to ASS subtitle draw instructions.

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to svg2ass

mdtable2csv
convert tables in .md to .csv
Stars: ✭ 91 (+313.64%)
Mutual labels:  converter
react-in-out-textarea
A simple React.js User Interface Component that is like Google Translate with full TypeScript Support
Stars: ✭ 28 (+27.27%)
Mutual labels:  converter
express-to-koa
Use express middlewares in Koa2, the one that really works.
Stars: ✭ 18 (-18.18%)
Mutual labels:  converter
ical2json
A simple node package to convert ical data to json
Stars: ✭ 46 (+109.09%)
Mutual labels:  converter
form-data-json
A zero dependency, cross browser library to easily get or set/manipulate form input values as/from a json object.
Stars: ✭ 37 (+68.18%)
Mutual labels:  converter
Text to MD
Convert your docs to markdown format.
Stars: ✭ 15 (-31.82%)
Mutual labels:  converter
bot-whatsapp
Unmaintained - Multipurpose WhatsApp Bot 🤖 using open-wa/wa-automate-nodejs library! ✨
Stars: ✭ 78 (+254.55%)
Mutual labels:  converter
Create-EXEFromPS1
Takes one PowerShell script and any number of supplementary files or even a directory and creates an exe using Windows's built in iexpress program. The exe will run on any machine with PowerShell 2.0+.
Stars: ✭ 81 (+268.18%)
Mutual labels:  converter
xml-to-json
Simple API that converts dynamic XML feeds to JSON through a URL or pasting the raw XML data. Made 100% in PHP.
Stars: ✭ 38 (+72.73%)
Mutual labels:  converter
can2mqtt
Bidirectional CAN-Bus to MQTT-Bridge
Stars: ✭ 39 (+77.27%)
Mutual labels:  converter
video2gif
A batch script for convert video to GIF files by FFmpeg.exe on Windows
Stars: ✭ 48 (+118.18%)
Mutual labels:  converter
ipynb-py-convert
Convert .py files runnable in VSCode or Atom/Hydrogen to Jupyter .ipynb notebooks and vice versa
Stars: ✭ 38 (+72.73%)
Mutual labels:  converter
Video-to-audio-converter
A simple tool to convert video files into mp3 audio files
Stars: ✭ 40 (+81.82%)
Mutual labels:  converter
Tracker
Even the best of apps have their issues
Stars: ✭ 113 (+413.64%)
Mutual labels:  converter
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: ✭ 31 (+40.91%)
Mutual labels:  converter
cyan
Cyan Color Converter
Stars: ✭ 68 (+209.09%)
Mutual labels:  converter
ubase
remove accents from utf8 strings
Stars: ✭ 14 (-36.36%)
Mutual labels:  converter
o2d3m
Wavefront OBJ to Doom3 map converter.
Stars: ✭ 15 (-31.82%)
Mutual labels:  converter
tyson
A TypeScript serialization/deserialization library to convert objects to/from JSON
Stars: ✭ 25 (+13.64%)
Mutual labels:  converter
svg2polylines
Rust library to convert SVG data to a list of flattened polylines. Also includes FFI bindings.
Stars: ✭ 16 (-27.27%)
Mutual labels:  converter

Svg2ass

Convert SVG vector graphics to ASS subtitle draw instructions.

Overview

SVG2ASS feeds on SVG files and drops ASS dialog lines, ready for pasting in e.g. Aegisub. Only a basic set of SVG funtionality is supported, whereas most of the more advanced features are simply ignored. You can work around some of these limitations by converting all objects to paths and flattening your SVG as much as feasible. The SVG/XML is not validated at all - garbage in, garbage out!

If you don't intend to build svg2ass yourself or just want to give it a quick test run, you may want to check out Gustavo Rodrigues' svg2ass-gui.

Supported SVG elements

  • g(roup)
  • line
  • rect
  • circle, ellipse
  • polyline, polygon
  • path

Supported SVG attributes

  • attributes essential to the elements listed above
  • select presentation attributes and inline CSS style attributes (colors/alpha for fill and stroke; stroke width)
  • transform (translate, scale, rotate, skewX, skewY, matrix)

Output format

The ASS dialog lines are generated according to this pattern:

    Dialogue: Layer,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text

Caveat:

  • Resulting shapes will appear noticeable larger than expected for stroke widths >1, due to the different semantics of SVG strokes and ASS borders. Deal with it, as this is not trivial to fix!
  • Keep in mind that ASS does not support "open" paths, only closed shapes. Thus any open ended path in SVG will be forcefully closed by any ASS interpreter after conversion. It is advisable to avoid open paths altogether in SVGs subject to ASS conversion. This applies to the polyline SVG element as well.
  • There is no explicit Unicode support build into the application. However, since only SVG keywords and attribute values are parsed, UTF-8 input should be processed just fine.
  • Thanks to the oversimplified parser there is no guarantee svg2ass accepts and sensibly converts any old SVG document.

Build

SVG2ASS should easily build on an average GNU/Linux or other POSIX compliant system by just executing make. On other systems just slab it together using compiler and linker, see Makefile - nothing fancy there. However, depending on your runtime environment, you might have provide your own getopt, strdup or strcasecmp implementations. Also, you might have to manually copy version.in to version.h

Apparently, it is advisable to change strip -s to strip -S in Makefile when building on macOS.

In case you wish to avoid the hassle of building from source altogether: As mentioned above, Gustavo Rodrigues created svg2ass-gui, a web GUI based on the svg2ass source code. You can try it live here.

Usage

Executing svg2ass -h displays a short help text. Among other general and ASS related, fairly self explaining command line options, SVG2ASS provides an option to render all shapes into a single drawing command per SVG file (which forces all shapes to use the same initial color and border width settings), or alternatively, produce a separate dialog line for each shape (which is the default).

License

Svg2ass is distributed under the Modified ("3-clause") BSD License. See LICENSE for more information.


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].