本文整理汇总了Python中PyQt4.Qt.QFontDatabase.remove方法的典型用法代码示例。如果您正苦于以下问题:Python QFontDatabase.remove方法的具体用法?Python QFontDatabase.remove怎么用?Python QFontDatabase.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QFontDatabase
的用法示例。
在下文中一共展示了QFontDatabase.remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: writing_system_for_font
# 需要导入模块: from PyQt4.Qt import QFontDatabase [as 别名]
# 或者: from PyQt4.Qt.QFontDatabase import remove [as 别名]
def writing_system_for_font(font):
has_latin = True
systems = QFontDatabase().writingSystems(font.family())
# this just confuses the algorithm below. Vietnamese is Latin with lots of
# special chars
try:
systems.remove(QFontDatabase.Vietnamese)
except ValueError:
pass
system = QFontDatabase.Any
if QFontDatabase.Latin not in systems:
has_latin = False
# we need to show something
if systems:
system = systems[-1]
else:
systems.remove(QFontDatabase.Latin)
if not systems:
return system, has_latin
if len(systems) == 1 and systems[0] > QFontDatabase.Cyrillic:
return systems[0], has_latin
if len(systems) <= 2 and systems[-1] > QFontDatabase.Armenian and systems[-1] < QFontDatabase.Vietnamese:
return systems[-1], has_latin
if len(systems) <= 5 and systems[-1] >= QFontDatabase.SimplifiedChinese and systems[-1] <= QFontDatabase.Korean:
system = systems[-1]
return system, has_latin