Mercurial > hgrepos > Python2 > PyMuPDF
diff mupdf-source/thirdparty/harfbuzz/src/gen-def.py @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mupdf-source/thirdparty/harfbuzz/src/gen-def.py Mon Sep 15 11:43:07 2025 +0200 @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +"usage: gen-def.py harfbuzz.def hb.h [hb-blob.h hb-buffer.h ...]" + +import os, re, sys + +if len (sys.argv) < 3: + sys.exit(__doc__) + +output_file = sys.argv[1] +header_paths = sys.argv[2:] + +headers_content = [] +for h in header_paths: + if h.endswith (".h"): + with open (h, encoding='utf-8') as f: headers_content.append (f.read ()) + +symbols = sorted (re.findall (r"^hb_\w+(?= \()", "\n".join (headers_content), re.M)) +if '--experimental-api' not in sys.argv: + # Move these to harfbuzz-sections.txt when got stable + experimental_symbols = \ +"""hb_subset_repack_or_fail +hb_subset_input_override_name_table +""".splitlines () + symbols = [x for x in symbols if x not in experimental_symbols] +symbols = "\n".join (symbols) + +result = symbols if os.getenv ('PLAIN_LIST', '') else """EXPORTS +%s +LIBRARY lib%s-0.dll""" % (symbols, output_file.replace ('src/', '').replace ('.def', '')) + +with open (output_file, "w") as f: f.write (result)
