diff --git a/tests/reference/coreToOdt_SaveFlat_document.fodt b/tests/reference/coreToOdt_SaveFlat_document.fodt index 78c9ab59..ceafb01c 100644 --- a/tests/reference/coreToOdt_SaveFlat_document.fodt +++ b/tests/reference/coreToOdt_SaveFlat_document.fodt @@ -1,65 +1,65 @@ - 2024-04-24T18:30:38 - novelWriter/2.5a2 + 2024-05-22T17:02:41 + novelWriter/2.5a4 Jane Smith 1234 P42DT12H34M56S Test Project - 2024-04-24T18:30:38 + 2024-05-22T17:02:41 Jane Smith - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tests/reference/coreToOdt_SaveFull_content.xml b/tests/reference/coreToOdt_SaveFull_content.xml index 0654b0f3..cbd651d2 100644 --- a/tests/reference/coreToOdt_SaveFull_content.xml +++ b/tests/reference/coreToOdt_SaveFull_content.xml @@ -1,7 +1,7 @@ - + diff --git a/tests/reference/coreToOdt_SaveFull_styles.xml b/tests/reference/coreToOdt_SaveFull_styles.xml index 03395db1..ef297c8f 100644 --- a/tests/reference/coreToOdt_SaveFull_styles.xml +++ b/tests/reference/coreToOdt_SaveFull_styles.xml @@ -1,55 +1,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt index 902f37a5..3d56619d 100644 --- a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt +++ b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt @@ -1,41 +1,41 @@ - 2024-05-10T15:23:56 - novelWriter/2.5a3 + 2024-05-22T17:05:07 + novelWriter/2.5a4 lipsum.com 45 P0DT0H36M8S Lorem Ipsum - 2024-05-10T15:23:56 + 2024-05-22T17:05:07 lipsum.com - + - + - + - + - + - + @@ -43,7 +43,7 @@ - + diff --git a/tests/test_core/test_core_buildsettings.py b/tests/test_core/test_core_buildsettings.py index df891745..d08bd6c4 100644 --- a/tests/test_core/test_core_buildsettings.py +++ b/tests/test_core/test_core_buildsettings.py @@ -148,7 +148,7 @@ def testCoreBuildSettings_BuildValues(): build = BuildSettings() strSetting = "headings.fmtTitle" - intSetting = "format.textSize" + intSetting = "odt.pageCountOffset" boolSetting = "filter.includeNovel" floatSetting = "format.lineHeight" diff --git a/tests/test_core/test_core_toodt.py b/tests/test_core/test_core_toodt.py index 59977577..c924d762 100644 --- a/tests/test_core/test_core_toodt.py +++ b/tests/test_core/test_core_toodt.py @@ -1043,10 +1043,26 @@ def testCoreToOdt_ODTParagraphStyle(): assert parStyle._tAttr["font-weight"] == ["fo", None] parStyle.setFontWeight("normal") assert parStyle._tAttr["font-weight"] == ["fo", "normal"] - parStyle.setFontWeight("inherit") - assert parStyle._tAttr["font-weight"] == ["fo", "inherit"] parStyle.setFontWeight("bold") assert parStyle._tAttr["font-weight"] == ["fo", "bold"] + parStyle.setFontWeight("100") + assert parStyle._tAttr["font-weight"] == ["fo", "100"] + parStyle.setFontWeight("200") + assert parStyle._tAttr["font-weight"] == ["fo", "200"] + parStyle.setFontWeight("300") + assert parStyle._tAttr["font-weight"] == ["fo", "300"] + parStyle.setFontWeight("400") + assert parStyle._tAttr["font-weight"] == ["fo", "400"] + parStyle.setFontWeight("500") + assert parStyle._tAttr["font-weight"] == ["fo", "500"] + parStyle.setFontWeight("600") + assert parStyle._tAttr["font-weight"] == ["fo", "600"] + parStyle.setFontWeight("700") + assert parStyle._tAttr["font-weight"] == ["fo", "700"] + parStyle.setFontWeight("800") + assert parStyle._tAttr["font-weight"] == ["fo", "800"] + parStyle.setFontWeight("900") + assert parStyle._tAttr["font-weight"] == ["fo", "900"] parStyle.setFontWeight("stuff") assert parStyle._tAttr["font-weight"] == ["fo", None] @@ -1116,10 +1132,26 @@ def testCoreToOdt_ODTTextStyle(): assert txtStyle._tAttr["font-weight"] == ["fo", None] txtStyle.setFontWeight("normal") assert txtStyle._tAttr["font-weight"] == ["fo", "normal"] - txtStyle.setFontWeight("inherit") - assert txtStyle._tAttr["font-weight"] == ["fo", "inherit"] txtStyle.setFontWeight("bold") assert txtStyle._tAttr["font-weight"] == ["fo", "bold"] + txtStyle.setFontWeight("100") + assert txtStyle._tAttr["font-weight"] == ["fo", "100"] + txtStyle.setFontWeight("200") + assert txtStyle._tAttr["font-weight"] == ["fo", "200"] + txtStyle.setFontWeight("300") + assert txtStyle._tAttr["font-weight"] == ["fo", "300"] + txtStyle.setFontWeight("400") + assert txtStyle._tAttr["font-weight"] == ["fo", "400"] + txtStyle.setFontWeight("500") + assert txtStyle._tAttr["font-weight"] == ["fo", "500"] + txtStyle.setFontWeight("600") + assert txtStyle._tAttr["font-weight"] == ["fo", "600"] + txtStyle.setFontWeight("700") + assert txtStyle._tAttr["font-weight"] == ["fo", "700"] + txtStyle.setFontWeight("800") + assert txtStyle._tAttr["font-weight"] == ["fo", "800"] + txtStyle.setFontWeight("900") + assert txtStyle._tAttr["font-weight"] == ["fo", "900"] txtStyle.setFontWeight("stuff") assert txtStyle._tAttr["font-weight"] == ["fo", None] @@ -1129,10 +1161,10 @@ def testCoreToOdt_ODTTextStyle(): assert txtStyle._tAttr["font-style"] == ["fo", None] txtStyle.setFontStyle("normal") assert txtStyle._tAttr["font-style"] == ["fo", "normal"] - txtStyle.setFontStyle("inherit") - assert txtStyle._tAttr["font-style"] == ["fo", "inherit"] txtStyle.setFontStyle("italic") assert txtStyle._tAttr["font-style"] == ["fo", "italic"] + txtStyle.setFontStyle("oblique") + assert txtStyle._tAttr["font-style"] == ["fo", "oblique"] txtStyle.setFontStyle("stuff") assert txtStyle._tAttr["font-style"] == ["fo", None] diff --git a/tests/test_tools/test_tools_manussettings.py b/tests/test_tools/test_tools_manussettings.py index e1b12202..e9bfb8e7 100644 --- a/tests/test_tools/test_tools_manussettings.py +++ b/tests/test_tools/test_tools_manussettings.py @@ -27,6 +27,7 @@ from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QFontDialog from novelwriter import CONFIG, SHARED +from novelwriter.common import describeFont from novelwriter.constants import nwHeadFmt from novelwriter.core.buildsettings import BuildSettings, FilterMode from novelwriter.tools.manussettings import ( @@ -547,11 +548,8 @@ def testBuildSettings_Format(monkeypatch, qtbot, nwGUI): """Test the Format Tab of the GuiBuildSettings dialog.""" build = BuildSettings() - textFont = str(CONFIG.textFont.family()) - build.setValue("format.buildLang", "en_US") build.setValue("format.textFont", "") # Will fall back to config value - build.setValue("format.textSize", 12) build.setValue("format.lineHeight", 1.2) build.setValue("format.justifyText", False) @@ -577,8 +575,7 @@ def testBuildSettings_Format(monkeypatch, qtbot, nwGUI): assert bSettings.toolStack.currentWidget() is fmtTab # Check initial values - assert fmtTab.textFont.text() == textFont - assert fmtTab.textSize.value() == 12 + assert fmtTab._textFont == CONFIG.textFont assert fmtTab.lineHeight.value() == 1.2 assert fmtTab.justifyText.isChecked() is False @@ -599,8 +596,9 @@ def testBuildSettings_Format(monkeypatch, qtbot, nwGUI): assert fmtTab.rightMargin.value() == 15.0 # Change values - fmtTab.textFont.setText("Arial") - fmtTab.textSize.setValue(11) + testFont = QFont("Arial", 11) + fmtTab._textFont = testFont + fmtTab.textFont.setText(describeFont(testFont)) fmtTab.lineHeight.setValue(1.15) fmtTab.justifyText.setChecked(True) @@ -617,8 +615,7 @@ def testBuildSettings_Format(monkeypatch, qtbot, nwGUI): # Save values fmtTab.saveContent() - assert build.getStr("format.textFont") == "Arial" - assert build.getInt("format.textSize") == 11 + assert build.getStr("format.textFont") == testFont.toString() assert build.getFloat("format.lineHeight") == 1.15 assert build.getBool("format.justifyText") is True @@ -646,8 +643,7 @@ def testBuildSettings_Format(monkeypatch, qtbot, nwGUI): mp.setattr(QFontDialog, "getFont", lambda *a: (font, True)) fmtTab.btnTextFont.click() - assert fmtTab.textFont.text() == "Times" - assert fmtTab.textSize.value() == 10 + assert fmtTab._textFont == font # Finish bSettings._dialogButtonClicked(bSettings.buttonBox.button(QtDialogClose))