#!/usr/bin/env python #**************************************************************************** # textpaint.py, provides text painting utility functions # # FlyWay, a VFR/IFR Route Planner for Pilots # Copyright (C) 2002, Douglas W. Bell # # This is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License, Version 2. This program is # distributed in the hope that it will be useful, but WITTHOUT ANY WARRANTY. #***************************************************************************** from qt import * def drawCenterText(painter, x, y, text): """Draw text centered about x,y""" length = painter.fontMetrics().width(text) painter.drawText(x - length / 2, y, text) def drawRightText(painter, x, y, text): """Draw text centered about x,y""" length = painter.fontMetrics().width(text) painter.drawText(x - length, y, text)