diff --git a/elevenclock/__init__.py b/elevenclock/__init__.py index 6d9a2efa..8bd56c8a 100644 --- a/elevenclock/__init__.py +++ b/elevenclock/__init__.py @@ -488,6 +488,7 @@ class Clock(QWidget): clockFormat: str = "" settingsEnvironment: str = "" currentTaskbarHwnd: int = 0 + baseHtmlFontTag: str = "" LastCapturedBackgroundColor: int = -1 LastCapturedForegroundColor: str = "" @@ -819,31 +820,21 @@ def __init__(self, dpix: float, dpiy: float, screen: QScreen, index: int, isCove except Exception as e: self.font.setPointSize(9) report(e) - + + DISABLE_SEMIBOLD = not self.getSettings("CustomClockStringsDisabled") and "" in self.getSettingsValue("CustomClockStrings") if isTaskbarDark(): - self.fontfamilies = [element.replace("Segoe UI Variable Display", "Segoe UI Variable Display Semib") for element in self.fontfamilies] - if self.fontfamilies != []: - self.font.setFamilies(self.fontfamilies) - if lang["locale"] in ("zh_TW", "zh_CN", "ko"): - self.font.setWeight(QFont.Weight.Normal) - else: - self.font.setWeight(QFont.Weight.DemiBold) - else: - self.font.fromString(self.customFont) - self.font.setLetterSpacing(QFont.PercentageSpacing, 100) - self.label.setFont(self.font) + self.fontfamilies = [element.replace("Segoe UI Variable Display", f"Segoe UI Variable Display{'' if DISABLE_SEMIBOLD else ' Semib'}") for element in self.fontfamilies] + self.font.setFamilies(self.fontfamilies if self.fontfamilies != [] else self.customFont) + self.font.setLetterSpacing(QFont.PercentageSpacing, 110 if DISABLE_SEMIBOLD else 100) self.label.bgopacity = .1 else: self.fontfamilies = [element.replace("Segoe UI Variable Display Semib", "Segoe UI Variable Display") for element in self.fontfamilies] - if self.fontfamilies != []: - self.font.setFamilies(self.fontfamilies) - else: - self.font.fromString(self.customFont) + self.font.setFamilies(self.fontfamilies if self.fontfamilies != [] else self.customFont) self.font.setWeight(QFont.Weight.ExtraLight) self.font.setLetterSpacing(QFont.PercentageSpacing, 110) - self.label.setFont(self.font) self.label.bgopacity = .5 - + self.label.setFont(self.font) + if self.getSettings("UseCustomFontColor"): print("🟡 Using custom font color:", self.getSettingsValue('UseCustomFontColor')) self.lastTheme = -1 @@ -1020,7 +1011,7 @@ def loadTimeFormat(self): clockFormat = f"

"+clockFormat.replace("\n", "
").replace(" ", "")+"

" except Exception as e: report(e) - + print("🔵 Loaded date time format:", clockFormat.replace("\n", "\\n"), f" (clock {self.index}") self.clockFormat = clockFormat except Exception as e: diff --git a/elevenclock/settings.py b/elevenclock/settings.py index 39fb9d47..9841c0a1 100644 --- a/elevenclock/settings.py +++ b/elevenclock/settings.py @@ -553,6 +553,7 @@ def setCustomFont(v):
  • {_("Any text can be placed here. To place items such as date and time, please use the 1989 C standard. Check the format codes on the following link:")} {_("Python date and time formats")}
  • {_("To disable the zero-padding effect, add a # in between the % and the code: non-zero-padded hours would be %#H, and zero-padded hours would be %H")}
  • {_("Use the nonation {%H+1} to specify offsets. Replace %H with the desired value and +1 for a positive or negative number (+n or -n, respectively, for a n offset), representing the offset.")}
  • +
  • {_('You can use HTML tags to set bold, italics or change the color of a piece of text through the <span style="color: red"></span> tag')}
  • {_("Click on Apply to apply and preview the format")}
  • {_("If you don't understand what is happening, please uncheck the checkbox over the text area")} """