diff --git a/LunaTranslator/LunaTranslator/LunaTranslator_main.py b/LunaTranslator/LunaTranslator/LunaTranslator_main.py index d9c8fb1f..9382a2d4 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator_main.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator_main.py @@ -40,7 +40,8 @@ if __name__ == "__main__": ) font = QFont() font.setStyleStrategy(QFont.StyleStrategy.PreferAntialias) - font.setHintingPreference(QFont.HintingPreference.PreferNoHinting) + font.setHintingPreference(QFont.HintingPreference.PreferFullHinting) + # 必须PreferFullHinting,不能PreferNoHinting,否则阿拉伯语显示不出来 QApplication.setFont(font) app = QApplication(sys.argv) diff --git a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/base.py b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/base.py index af133131..03bb2cf4 100644 --- a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/base.py +++ b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/base.py @@ -58,10 +58,10 @@ class base(QLabel): def move(self, point: QPoint): self.movedx = 0 self.movedy = 0 - text = self.text() - isarabic = any((ord(char) >= 0x0600 and ord(char) <= 0x06E0) for char in text) - if isarabic: - self.movedx -= self.width() + # text = self.text() + # isarabic = any((ord(char) >= 0x0600 and ord(char) <= 0x06E0) for char in text) + # if isarabic: + # self.movedx -= self.width() x, y = self.moveoffset() self.movedx -= x self.movedy -= y