예제 #1
0
파일: pidPDF.py 프로젝트: CKannas/rdkit
 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
예제 #2
0
파일: pidPDF.py 프로젝트: rwest/rdkit
 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
예제 #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
예제 #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