Example #1
0
 def stringWidth(self, s, font=None):
     "Return the logical width of the string if it were drawn \
     in the current font (defaults to self.font)."
     if not font:
         font = self.defaultFont
     fontname = self._findPostScriptFontName(font)
     return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001
Example #2
0
 def stringWidth(self, s, font=None):
     "Return the logical width of the string if it were drawn \
     in the current font (defaults to self.font)."
     if not font:
         font = self.defaultFont
     fontname = self._findPostScriptFontName(font)
     return pdfmetrics.stringwidth(s, fontname) * font.size * 0.001
Example #3
0
 def stringWidth(self, text, fontname, fontsize):
     "gets width of a string in the given font and size"
     return pdfmetrics.stringwidth(text, fontname) * 0.001 * fontsize
Example #4
0
 def stringWidth(self, text, fontname, fontsize):
     "gets width of a string in the given font and size"
     return pdfmetrics.stringwidth(text, fontname) * 0.001 * fontsize