MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / norm_name

Function norm_name

src_classic/utils.py:5326–5335  ·  view source on GitHub ↗

Recreate font name that contains PDF hex codes. E.g. #20 -> space, chr(32)

(name)

Source from the content-addressed store, hash-verified

5324 """
5325
5326 def norm_name(name):
5327 """Recreate font name that contains PDF hex codes.
5328
5329 E.g. #20 -> space, chr(32)
5330 """
5331 while "#" in name:
5332 p = name.find("#")
5333 c = int(name[p + 1 : p + 3], 16)
5334 name = name.replace(name[p : p + 3], chr(c))
5335 return name
5336
5337 def get_fontnames(doc, item):
5338 """Return a list of fontnames for an item of page.get_fonts().

Callers 2

get_fontnamesMethod · 0.85
get_fontnamesFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…