Advertisement
Guest User

Untitled

a guest
May 5th, 2022
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # The Walking Dead: The Final Season
  2. # .TTF/.OTF to .FONT importer
  3. # by MerlinSVK Aug 2018
  4. # version 1.0
  5. # script for QuickBMS http://aluigi.org/papers.htm#quickbms
  6.  
  7. open FDDE TTF 0 EXIST
  8. open FDDE HEAD 1
  9. open FDDE TAIL 2
  10.  
  11. if EXIST == 0
  12. open FDDE OTF 0
  13. endif
  14.  
  15. get NAME basename
  16. string FONT_NAME p "%s.%s" NAME "font_NEW"
  17.  
  18. get FONT_SIZE asize 0
  19. get HEAD_SIZE asize 1
  20. get TAIL_SIZE asize 2
  21.  
  22. log MEMORY_FILE 0 HEAD_SIZE 1 # copy header into memory_file
  23. get MEM_SIZE asize MEMORY_FILE
  24.  
  25. append
  26. log MEMORY_FILE 0 FONT_SIZE 0 # append font file
  27. log MEMORY_FILE 0 TAIL_SIZE 2 # append tail
  28. append
  29.  
  30. get MEM_SIZE asize MEMORY_FILE
  31. xmath ARCHIVE_SIZE "MEM_SIZE - 0x20"
  32.  
  33. goto 0x20 MEMORY_FILE
  34. get SKIP long MEMORY_FILE
  35. math SKIP + 0x18
  36.  
  37. goto SKIP MEMORY_FILE SEEK_CUR
  38. savepos OFFSET MEMORY_FILE
  39.  
  40. xmath OFFSET2 "OFFSET + 0x04"
  41. xmath FONT_SIZE2 "FONT_SIZE + 8"
  42.  
  43. putVarChr MEMORY_FILE 0x04 ARCHIVE_SIZE longlong
  44. putVarChr MEMORY_FILE OFFSET FONT_SIZE2 long
  45. putVarChr MEMORY_FILE OFFSET2 FONT_SIZE long
  46.  
  47. get MEM_SIZE asize MEMORY_FILE
  48. log FONT_NAME 0 MEM_SIZE MEMORY_FILE
Advertisement
RAW Paste Data Copied
Advertisement