1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:47:44 +00:00

Utilities: Add ttfdisasm for disassembling OpenType instructions

This utility when given a .tff font provides options for disassembling:

 - The 'fpgm' table, this a program that's run once when the font is
   loaded. It's used to define instructions and functions used by used
   by other programs.

 - The 'prep' table, this is a general program that's run when ever
   the font size (or other properties) changes.

 - And the programs associated with any individual glyph.

The disassembly is printed in a format that matches the examples from:
https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions

I'm mainly adding this because I think it's neat to be able to look
at these things, and think it'll be helpful for debugging an
interpreter.

With this you can see that all of the LiberationSerif-XXX.tff fonts in
Serenity have these programs ready to go.
This commit is contained in:
MacDue 2023-01-08 23:03:39 +00:00 committed by Andreas Kling
parent 768dc4cda1
commit 1cf45ee930
3 changed files with 201 additions and 0 deletions

View file

@ -488,6 +488,9 @@ if (BUILD_LAGOM)
add_executable(icc ../../Userland/Utilities/icc.cpp)
target_link_libraries(icc LibCore LibGfx LibMain)
add_executable(ttfdisasm ../../Userland/Utilities/ttfdisasm.cpp)
target_link_libraries(ttfdisasm LibGfx LibMain)
add_executable(js ../../Userland/Utilities/js.cpp)
target_link_libraries(js LibCrypto LibJS LibLine LibLocale LibMain LibTextCodec Threads::Threads)
if (EMSCRIPTEN)