Python java.awt.Font() Examples

The following are 3 code examples of java.awt.Font(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module java.awt , or try the search function .
Example #1
Source File: Graph.py    From medicare-demo with Apache License 2.0 5 votes vote down vote up
def error(self, g):
        message = "Invalid Expression"
        g.font = awt.Font('Serif', awt.Font.BOLD, 20)
        width = g.fontMetrics.stringWidth(message)

        x = (self.size.width-width)/2
        y = (self.size.height+g.fontMetrics.height)/2
        g.drawString("Invalid Expression", x, y) 
Example #2
Source File: Graph.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def error(self, g):
        message = "Invalid Expression"
        g.font = awt.Font('Serif', awt.Font.BOLD, 20)
        width = g.fontMetrics.stringWidth(message)

        x = (self.size.width-width)/2
        y = (self.size.height+g.fontMetrics.height)/2
        g.drawString("Invalid Expression", x, y) 
Example #3
Source File: Graph.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def error(self, g):
        message = "Invalid Expression"
        g.font = awt.Font('Serif', awt.Font.BOLD, 20)
        width = g.fontMetrics.stringWidth(message)

        x = (self.size.width-width)/2
        y = (self.size.height+g.fontMetrics.height)/2
        g.drawString("Invalid Expression", x, y)