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

Method textlen

src/__init__.py:16879–16883  ·  view source on GitHub ↗

Return length of a string.

(x)

Source from the content-addressed store, hash-verified

16877 font = Font("helv")
16878
16879 def textlen(x):
16880 """Return length of a string."""
16881 return font.text_length(
16882 x, fontsize=fontsize, small_caps=small_caps
16883 ) # abbreviation
16884
16885 def char_lengths(x):
16886 """Return list of single character lengths for a string."""

Callers

nothing calls this directly

Calls 1

text_lengthMethod · 0.80

Tested by

no test coverage detected