19 lines
433 B
Python
19 lines
433 B
Python
from PyQt6 import QtGui
|
|
from piker.ui._style import DpiAwareFont
|
|
|
|
class MockScreen:
|
|
def physicalDotsPerInch(self):
|
|
return 169 # example HiDPI
|
|
def logicalDotsPerInch(self):
|
|
return 96
|
|
def name(self):
|
|
return "MockScreen"
|
|
|
|
# create font instance
|
|
font = DpiAwareFont()
|
|
|
|
# pass the mock screen to configure_to_dpi
|
|
font.configure_to_dpi(screen=MockScreen())
|
|
|
|
print("Computed pixel size:", font.px_size)
|