uuencode4ass
v1.0.0
Published
Encode fonts for SubStation Alpha format
Maintainers
Readme
UUEncode for ASS
This is a JavaScript implementation of the encoding algorithm for storing fonts or other binary data in Advanced SubStation Alpha (.ass) or SubStation Alpha (.ssa) files that are plain text.
Usage
import { encode, decode } from "uuencode4ass";
import { readFile, writeFile } from "fs/promises";
const fontBuffer = await readFile("DejaVuSans.ttf");
const fontEncoded = encode(fontBuffer);
// !!%!!!!5!1!!"!"!2E:54;"0(C1!!!&-!!!!(%>%25;/\*4$!!!";!!!!J*(5%^46I$%.1!!!`Q!!*[+
// 2V.61M(11&E!!++)!!!6XEV"6%CH-DB^!!#Y;!!!"DZ05S]S73VW,1!!PKA!!!"79WVB=0)*5SU!!,]!
// !!!<E'.W>#!!;2UZ!!$;E!!!!@ZG='>N=42W;A!!X*!!!!#L:W&T=!!(!!=!!.U]!!!!$'>M?79()#B!
// !!$>3!!)A=2I:7&E*=4CD!!*8QQ!!!!W;'BF91W@(]M!#6^%!!!!*'BN>(AFINPH!!F@;!!!9::L:8*O
// ...
const fontBufferDecoded = decode(fontEncoded);
await writeFile("DecodedFont.ttf", fontBufferDecoded);Tests
This library is tested to produce the same result as the Aegisub's implementation of this encoding.
License
MIT
