Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/scripts/hexdump.sh @ 3:2c135c81b16c
MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:44:09 +0200 |
| parents | b50eed0cc0ef |
| children |
comparison
equal
deleted
inserted
replaced
| 0:6015a75abc2d | 3:2c135c81b16c |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 FILE=$1 | |
| 4 if [ ! -f "$FILE" ] | |
| 5 then | |
| 6 echo usage: bash scripts/hexdump.sh input.ttf | |
| 7 exit 1 | |
| 8 fi | |
| 9 | |
| 10 NAME=$(basename "$FILE" | sed 's/[.-]/_/g') | |
| 11 | |
| 12 echo "// This is an automatically generated file. Do not edit." | |
| 13 echo "const unsigned char _binary_$NAME[] =" | |
| 14 od -v -An -tx1 "$FILE" | sed 's/ *//g;s/[0-9a-f][0-9a-f]/\\x&/g;s/.*/"&"/' | |
| 15 echo ";" | |
| 16 echo "const unsigned int _binary_${NAME}_size = sizeof(_binary_${NAME}) - 1;" |
