OTS-IDEMPOTENT(1)

πŸ’… ots-idempotent β€” font transcoder ✨

okay so bestie, welcome to the User Commands section of the manual, and today's main character is ots-idempotent. yes that's a mouthful, we're aware, but she's worth it 🫢


🌸 NAME 🌸

ots-idempotent β€” font transcoder


πŸŽ€ SYNOPSIS πŸŽ€

ots-idempotent FONT_FILE

πŸ¦‹ DESCRIPTION πŸ¦‹

so. ots-idempotent is a program that validates and transcodes a font file using OTS. that's the whole vibe.

but here's the iconic part β€” she doesn't just do it once. she transcodes the original font twice and then checks that the two transcoded fonts are identical. like, if you run it through the machine and then run the result through the machine again, you should get the exact same thing. that's what idempotent means, and honestly? slay.

here's the literal logic, verbatim, no cap:

t1 = ValidateAndTranscode(original_font);
if (validation_error)
  PrintErrorAndExit;
t2 = ValidateAndTranscode(t1);
if (validation_error)
  PrintErrorAndExit;
if (t1 != t2)
  PrintErrorAndExit;
πŸ’€ real talk: this tool is basically for OTS developers. it's not a general-purpose thing, it's a "does our own transcoder behave itself" check. iykyk.

🌈 EXAMPLES 🌈

running it on a normal, well-behaved font β€” smooth, no notes:

$ ./ots-idempotent sample.otf

and then... the malformed one 😭 she simply does not pass the vibe check:

$ ./ots-idempotent malformed.ttf
WARNING: bad range shift
ERROR at src/ots.cc:670 (ProcessGeneric)
Failed to sanitize file!

see that? warning first, then the error, then the dramatic little "Failed to sanitize file!" finale. periodt.


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? report bugs to <https://github.com/khaledhosny/ots/issues> πŸ’– the devs wanna know fr fr.


πŸ‘‘ SEE ALSO πŸ‘‘

the rest of the OTS girlies, go say hi:


OpenType Sanitizer, May 2021 β€” that's the source and the date bestie, mwah πŸ’‹ thanks for reading, go transcode something twice and make sure it matches 🧚✨