Browse Source

enable high dpi scaling

master
Ivan Holmes 5 years ago
parent
commit
e6bc73d9c7
  1. 4
      gui.py

4
gui.py

@ -9,7 +9,7 @@ Created on Wed May 29 00:02:24 2019
import sys, fitz, io, subprocess, os import sys, fitz, io, subprocess, os
from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidget, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidget, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea
from PyQt5.QtCore import QFile, QObject
from PyQt5.QtCore import QFile, QObject, Qt
from PyQt5.QtGui import QPixmap, QImage from PyQt5.QtGui import QPixmap, QImage
from PyQt5 import uic from PyQt5 import uic
from chordsheet.tableView import ChordTableView, BlockTableView , MItemModel, MProxyStyle from chordsheet.tableView import ChordTableView, BlockTableView , MItemModel, MProxyStyle
@ -28,6 +28,8 @@ if getattr(sys, 'frozen', False):
else: else:
scriptDir = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) scriptDir = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
pdfmetrics.registerFont(TTFont('FreeSans', os.path.join(scriptDir, 'fonts', 'FreeSans.ttf'))) pdfmetrics.registerFont(TTFont('FreeSans', os.path.join(scriptDir, 'fonts', 'FreeSans.ttf')))
if sys.platform == "darwin": if sys.platform == "darwin":
pdfmetrics.registerFont(TTFont('HelveticaNeue', 'HelveticaNeue.ttc', subfontIndex=0)) pdfmetrics.registerFont(TTFont('HelveticaNeue', 'HelveticaNeue.ttc', subfontIndex=0))

Loading…
Cancel
Save