Only scale down for scale < 2

py3.10_support
wattygetlood 2021-09-16 16:36:09 -04:00 committed by Tyler Goodlet
parent 9951e1d4c9
commit cf2d258a27
1 changed files with 7 additions and 3 deletions

View File

@ -124,14 +124,18 @@ class DpiAwareFont:
if scale > 1 and self._font_size: if scale > 1 and self._font_size:
# TODO: this denominator should probably be determined from # TODO: this denominator should probably be determined from
# relative aspect ratios or something? # relative aspect ratios or something?
inches = inches * (1 / scale) * (1 + 6/16) inches = inches * (1 + 6/16)
if scale < 2:
inches *= (1 / scale)
dpi = mx_dpi dpi = mx_dpi
log.info(f'USING MAX DPI {dpi}')
self._font_inches = inches self._font_inches = inches
font_size = math.floor(inches * dpi) font_size = math.floor(inches * dpi)
log.debug( log.info(
f"\nscreen:{screen.name()} with pDPI: {pdpi}, lDPI: {ldpi}" f"\nscreen:{screen.name()}"
f"pDPI: {pdpi}, lDPI: {ldpi}, scale: {scale}\n"
f"\nOur best guess font size is {font_size}\n" f"\nOur best guess font size is {font_size}\n"
) )
# apply the size # apply the size