docstr: Estimate the width of a text string when rendered with the given font.
docstr_tok: ["Estimate","the","width","of","a","text","string","when","rendered","with","the","given","font","."]
code: def text_width(self, text: str, fontsize: float) -> float:
      """Estimate the width of a text string when rendered with the given font."""
      # NFKC: split ligatures, combine diacritics
      return len(unicodedata.normalize("NFKC", text)) * (
          fontsize / self.CHAR_ASPECT
      )
  
imports: from __future__ import annotations
  import logging
  import unicodedata
  import zlib
  from importlib.resources import files
  from pikepdf import Dictionary, Name, Pdf
  from pikepdf.canvas import Font
label_desc: Use image node_id 2 for calling the GlyphlessFont obj's underlying member method code with example usage: obj.text_width(text, fontsize) and returns: unknown