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

Method norm_name

src/__init__.py:7616–7625  ·  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

7614 """
7615
7616 def norm_name(name):
7617 """Recreate font name that contains PDF hex codes.
7618
7619 E.g. #20 -> space, chr(32)
7620 """
7621 while "#" in name:
7622 p = name.find("#")
7623 c = int(name[p + 1 : p + 3], 16)
7624 name = name.replace(name[p : p + 3], chr(c))
7625 return name
7626
7627 def get_fontnames(doc, item):
7628 """Return a list of fontnames for an item of page.get_fonts().

Callers

nothing calls this directly

Calls 1

findMethod · 0.80

Tested by

no test coverage detected