Standardise text sizes and margins
This commit is contained in:
@@ -93,17 +93,31 @@ class nwShortcode:
|
||||
}
|
||||
|
||||
|
||||
class nwHeaders:
|
||||
class nwStyles:
|
||||
|
||||
H_VALID = ("H0", "H1", "H2", "H3", "H4")
|
||||
H_LEVEL = {"H0": 0, "H1": 1, "H2": 2, "H3": 3, "H4": 4}
|
||||
H_SIZES = {0: 2.50, 1: 2.00, 2: 1.75, 3: 1.50, 4: 1.25}
|
||||
H_LABEL = {
|
||||
|
||||
T_LABEL = {
|
||||
"H0": QT_TRANSLATE_NOOP("Constant", "Title"),
|
||||
"H1": QT_TRANSLATE_NOOP("Constant", "Heading 1 (Partition)"),
|
||||
"H2": QT_TRANSLATE_NOOP("Constant", "Heading 2 (Chapter)"),
|
||||
"H3": QT_TRANSLATE_NOOP("Constant", "Heading 3 (Scene)"),
|
||||
"H4": QT_TRANSLATE_NOOP("Constant", "Heading 4 (Section)"),
|
||||
"TT": QT_TRANSLATE_NOOP("Constant", "Text Paragraph"),
|
||||
"SP": QT_TRANSLATE_NOOP("Constant", "Scene Separator"),
|
||||
}
|
||||
T_MARGIN = {
|
||||
"H0": (1.42, 0.50), # Title margins
|
||||
"H1": (1.42, 0.50), # Heading 1 margins
|
||||
"H2": (1.67, 0.50), # Heading 2 margins
|
||||
"H3": (1.17, 0.50), # Heading 3 margins
|
||||
"H4": (1.17, 0.50), # Heading 4 margins
|
||||
"TT": (0.00, 0.58), # Text margins
|
||||
"SP": (1.17, 1.17), # Separator margins
|
||||
"MT": (0.00, 0.58), # Meta margins
|
||||
"FT": (1.42, 0.47), # Footnote margins
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ from PyQt5.QtCore import QT_TRANSLATE_NOOP, QCoreApplication
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.common import checkUuid, isHandle, jsonEncode
|
||||
from novelwriter.constants import nwFiles, nwHeadFmt
|
||||
from novelwriter.constants import nwFiles, nwHeadFmt, nwStyles
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.enum import nwBuildFmt
|
||||
from novelwriter.error import logException
|
||||
@@ -87,20 +87,20 @@ SETTINGS_TEMPLATE: dict[str, tuple[type, str | int | float | bool]] = {
|
||||
"format.firstLineIndent": (bool, False),
|
||||
"format.firstIndentWidth": (float, 1.4),
|
||||
"format.indentFirstPar": (bool, False),
|
||||
"format.titleMarginT": (float, 1.42),
|
||||
"format.titleMarginB": (float, 0.50),
|
||||
"format.h1MarginT": (float, 1.42),
|
||||
"format.h1MarginB": (float, 0.50),
|
||||
"format.h2MarginT": (float, 1.67),
|
||||
"format.h2MarginB": (float, 0.50),
|
||||
"format.h3MarginT": (float, 1.17),
|
||||
"format.h3MarginB": (float, 0.50),
|
||||
"format.h4MarginT": (float, 1.17),
|
||||
"format.h4MarginB": (float, 0.50),
|
||||
"format.textMarginT": (float, 0.00),
|
||||
"format.textMarginB": (float, 0.50),
|
||||
"format.sepMarginT": (float, 1.17),
|
||||
"format.sepMarginB": (float, 1.17),
|
||||
"format.titleMarginT": (float, nwStyles.T_MARGIN["H0"][0]),
|
||||
"format.titleMarginB": (float, nwStyles.T_MARGIN["H0"][1]),
|
||||
"format.h1MarginT": (float, nwStyles.T_MARGIN["H1"][0]),
|
||||
"format.h1MarginB": (float, nwStyles.T_MARGIN["H1"][1]),
|
||||
"format.h2MarginT": (float, nwStyles.T_MARGIN["H2"][0]),
|
||||
"format.h2MarginB": (float, nwStyles.T_MARGIN["H2"][1]),
|
||||
"format.h3MarginT": (float, nwStyles.T_MARGIN["H3"][0]),
|
||||
"format.h3MarginB": (float, nwStyles.T_MARGIN["H3"][1]),
|
||||
"format.h4MarginT": (float, nwStyles.T_MARGIN["H4"][0]),
|
||||
"format.h4MarginB": (float, nwStyles.T_MARGIN["H4"][1]),
|
||||
"format.textMarginT": (float, nwStyles.T_MARGIN["TT"][0]),
|
||||
"format.textMarginB": (float, nwStyles.T_MARGIN["TT"][1]),
|
||||
"format.sepMarginT": (float, nwStyles.T_MARGIN["SP"][0]),
|
||||
"format.sepMarginB": (float, nwStyles.T_MARGIN["SP"][1]),
|
||||
"format.pageUnit": (str, "cm"),
|
||||
"format.pageSize": (str, "A4"),
|
||||
"format.pageWidth": (float, 21.0),
|
||||
@@ -159,8 +159,6 @@ SETTINGS_LABELS = {
|
||||
"format.indentFirstPar": QT_TRANSLATE_NOOP("Builds", "Indent First Paragraph"),
|
||||
|
||||
"format.grpMargins": QT_TRANSLATE_NOOP("Builds", "Text Margins"),
|
||||
"format.textMargin": QT_TRANSLATE_NOOP("Builds", "Text Paragraph"),
|
||||
"format.sepMargin": QT_TRANSLATE_NOOP("Builds", "Scene Separator"),
|
||||
|
||||
"format.grpPage": QT_TRANSLATE_NOOP("Builds", "Page Layout"),
|
||||
"format.pageUnit": QT_TRANSLATE_NOOP("Builds", "Unit"),
|
||||
|
||||
@@ -40,7 +40,7 @@ from novelwriter import SHARED
|
||||
from novelwriter.common import (
|
||||
checkInt, isHandle, isItemClass, isListInstance, isTitleTag, jsonEncode
|
||||
)
|
||||
from novelwriter.constants import nwFiles, nwHeaders, nwKeyWords
|
||||
from novelwriter.constants import nwFiles, nwKeyWords, nwStyles
|
||||
from novelwriter.enum import nwComment, nwItemClass, nwItemLayout, nwItemType
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.text.counting import standardCounter
|
||||
@@ -569,7 +569,7 @@ class NWIndex:
|
||||
for _, _, hItem in self._itemIndex.iterNovelStructure(
|
||||
rHandle=rootHandle, activeOnly=activeOnly
|
||||
):
|
||||
iLevel = nwHeaders.H_LEVEL.get(hItem.level, 0)
|
||||
iLevel = nwStyles.H_LEVEL.get(hItem.level, 0)
|
||||
hCount[iLevel] += 1
|
||||
return hCount
|
||||
|
||||
@@ -591,7 +591,7 @@ class NWIndex:
|
||||
rHandle=rHandle, activeOnly=activeOnly
|
||||
):
|
||||
tKey = f"{tHandle}:{sTitle}"
|
||||
iLevel = nwHeaders.H_LEVEL.get(hItem.level, 0)
|
||||
iLevel = nwStyles.H_LEVEL.get(hItem.level, 0)
|
||||
if iLevel > maxDepth:
|
||||
if pKey in tData:
|
||||
tData[pKey]["words"] += hItem.wordCount
|
||||
@@ -1251,7 +1251,7 @@ class IndexHeading:
|
||||
|
||||
def setLevel(self, level: str) -> None:
|
||||
"""Set the level of the heading if it's a valid value."""
|
||||
if level in nwHeaders.H_VALID:
|
||||
if level in nwStyles.H_VALID:
|
||||
self._level = level
|
||||
return
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ from novelwriter.common import (
|
||||
checkInt, isHandle, isItemClass, isItemLayout, isItemType, simplified,
|
||||
yesNo
|
||||
)
|
||||
from novelwriter.constants import nwHeaders, nwLabels, trConst
|
||||
from novelwriter.constants import nwLabels, nwStyles, trConst
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
@@ -518,7 +518,7 @@ class NWItem:
|
||||
|
||||
def setMainHeading(self, value: str) -> None:
|
||||
"""Set the main heading level."""
|
||||
if value in nwHeaders.H_LEVEL:
|
||||
if value in nwStyles.H_LEVEL:
|
||||
self._heading = value
|
||||
return
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ from PyQt5.QtGui import QFont
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.common import checkInt, formatTimeStamp, numberToRoman
|
||||
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwShortcode, nwUnicode, trConst
|
||||
from novelwriter.constants import (
|
||||
nwHeadFmt, nwKeyWords, nwLabels, nwShortcode, nwStyles, nwUnicode, trConst
|
||||
)
|
||||
from novelwriter.core.index import processComment
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.enum import nwComment, nwItemLayout
|
||||
@@ -167,15 +169,15 @@ class Tokenizer(ABC):
|
||||
self._keepBreaks = True # Keep line breaks in paragraphs
|
||||
|
||||
# Margins
|
||||
self._marginTitle = (1.417, 0.500)
|
||||
self._marginHead1 = (1.417, 0.500)
|
||||
self._marginHead2 = (1.668, 0.500)
|
||||
self._marginHead3 = (1.168, 0.500)
|
||||
self._marginHead4 = (1.168, 0.500)
|
||||
self._marginText = (0.000, 0.584)
|
||||
self._marginMeta = (0.000, 0.584)
|
||||
self._marginFoot = (1.417, 0.467)
|
||||
self._marginSep = (1.168, 1.168)
|
||||
self._marginTitle = nwStyles.T_MARGIN["H0"]
|
||||
self._marginHead1 = nwStyles.T_MARGIN["H1"]
|
||||
self._marginHead2 = nwStyles.T_MARGIN["H2"]
|
||||
self._marginHead3 = nwStyles.T_MARGIN["H3"]
|
||||
self._marginHead4 = nwStyles.T_MARGIN["H4"]
|
||||
self._marginText = nwStyles.T_MARGIN["TT"]
|
||||
self._marginMeta = nwStyles.T_MARGIN["MT"]
|
||||
self._marginFoot = nwStyles.T_MARGIN["FT"]
|
||||
self._marginSep = nwStyles.T_MARGIN["SP"]
|
||||
|
||||
# Title Formats
|
||||
self._fmtPart = nwHeadFmt.TITLE # Formatting for partitions
|
||||
|
||||
@@ -39,7 +39,7 @@ from PyQt5.QtGui import QFont
|
||||
|
||||
from novelwriter import __version__
|
||||
from novelwriter.common import xmlIndent
|
||||
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels
|
||||
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.formats.tokenizer import T_Formats, Tokenizer, stripEscape
|
||||
from novelwriter.types import FONT_STYLE, FONT_WEIGHTS
|
||||
@@ -285,14 +285,14 @@ class ToOdt(Tokenizer):
|
||||
self._headWeight = self._fontBold if self._boldHeads else None
|
||||
|
||||
hScale = self._scaleHeads
|
||||
self._fSizeTitle = f"{round((2.50 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeHead1 = f"{round((2.00 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeHead2 = f"{round((1.60 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeHead3 = f"{round((1.30 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeHead4 = f"{round((1.15 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeHead = f"{round((1.15 if hScale else 1.0) * self._fontSize):d}pt"
|
||||
self._fSizeText = f"{self._fontSize:d}pt"
|
||||
self._fSizeFoot = f"{round(0.8*self._fontSize):d}pt"
|
||||
self._fSizeTitle = self._emToPt(nwStyles.H_SIZES[0] if hScale else 1.0) # Was 2.50
|
||||
self._fSizeHead1 = self._emToPt(nwStyles.H_SIZES[1] if hScale else 1.0) # Was 2.00
|
||||
self._fSizeHead2 = self._emToPt(nwStyles.H_SIZES[2] if hScale else 1.0) # Was 1.60
|
||||
self._fSizeHead3 = self._emToPt(nwStyles.H_SIZES[3] if hScale else 1.0) # Was 1.30
|
||||
self._fSizeHead4 = self._emToPt(nwStyles.H_SIZES[4] if hScale else 1.0) # Was 1.15
|
||||
self._fSizeHead = self._emToPt(nwStyles.H_SIZES[4] if hScale else 1.0) # Was 1.15
|
||||
self._fSizeText = self._emToPt(1.0)
|
||||
self._fSizeFoot = self._emToPt(0.8)
|
||||
|
||||
mScale = self._lineHeight/1.15
|
||||
|
||||
@@ -805,6 +805,10 @@ class ToOdt(Tokenizer):
|
||||
"""Converts an em value to centimetres."""
|
||||
return f"{value*2.54/72*self._fontSize:.3f}cm"
|
||||
|
||||
def _emToPt(self, scale: float) -> str:
|
||||
"""Compute relative font size in points."""
|
||||
return f"{round(scale * self._fontSize):d}pt"
|
||||
|
||||
##
|
||||
# Style Elements
|
||||
##
|
||||
|
||||
@@ -34,7 +34,7 @@ from PyQt5.QtGui import (
|
||||
)
|
||||
from PyQt5.QtPrintSupport import QPrinter
|
||||
|
||||
from novelwriter.constants import nwHeaders, nwHeadFmt, nwKeyWords, nwLabels, nwUnicode
|
||||
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles, nwUnicode
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.formats.tokenizer import T_Formats, Tokenizer
|
||||
from novelwriter.types import (
|
||||
@@ -150,11 +150,11 @@ class ToQTextDocument(Tokenizer):
|
||||
|
||||
hScale = self._scaleHeads
|
||||
self._sHead = {
|
||||
self.T_TITLE: (nwHeaders.H_SIZES.get(0, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD1: (nwHeaders.H_SIZES.get(1, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD2: (nwHeaders.H_SIZES.get(2, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD3: (nwHeaders.H_SIZES.get(3, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD4: (nwHeaders.H_SIZES.get(4, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_TITLE: (nwStyles.H_SIZES.get(0, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD1: (nwStyles.H_SIZES.get(1, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD2: (nwStyles.H_SIZES.get(2, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD3: (nwStyles.H_SIZES.get(3, 1.0) * fPt) if hScale else fPt,
|
||||
self.T_HEAD4: (nwStyles.H_SIZES.get(4, 1.0) * fPt) if hScale else fPt,
|
||||
}
|
||||
|
||||
self._mText = (mPx * self._marginText[0], mPx * self._marginText[1])
|
||||
|
||||
@@ -37,7 +37,7 @@ from PyQt5.QtGui import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import checkInt
|
||||
from novelwriter.constants import nwHeaders, nwUnicode
|
||||
from novelwriter.constants import nwStyles, nwUnicode
|
||||
from novelwriter.core.index import processComment
|
||||
from novelwriter.enum import nwComment
|
||||
from novelwriter.text.patterns import REGEX_PATTERNS
|
||||
@@ -95,14 +95,14 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
|
||||
# Create Character Formats
|
||||
self._addCharFormat("text", SHARED.theme.colText)
|
||||
self._addCharFormat("header1", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[1])
|
||||
self._addCharFormat("header2", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[2])
|
||||
self._addCharFormat("header3", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[3])
|
||||
self._addCharFormat("header4", SHARED.theme.colHead, "b", nwHeaders.H_SIZES[4])
|
||||
self._addCharFormat("head1h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[1])
|
||||
self._addCharFormat("head2h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[2])
|
||||
self._addCharFormat("head3h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[3])
|
||||
self._addCharFormat("head4h", SHARED.theme.colHeadH, "b", nwHeaders.H_SIZES[4])
|
||||
self._addCharFormat("header1", SHARED.theme.colHead, "b", nwStyles.H_SIZES[1])
|
||||
self._addCharFormat("header2", SHARED.theme.colHead, "b", nwStyles.H_SIZES[2])
|
||||
self._addCharFormat("header3", SHARED.theme.colHead, "b", nwStyles.H_SIZES[3])
|
||||
self._addCharFormat("header4", SHARED.theme.colHead, "b", nwStyles.H_SIZES[4])
|
||||
self._addCharFormat("head1h", SHARED.theme.colHeadH, "b", nwStyles.H_SIZES[1])
|
||||
self._addCharFormat("head2h", SHARED.theme.colHeadH, "b", nwStyles.H_SIZES[2])
|
||||
self._addCharFormat("head3h", SHARED.theme.colHeadH, "b", nwStyles.H_SIZES[3])
|
||||
self._addCharFormat("head4h", SHARED.theme.colHeadH, "b", nwStyles.H_SIZES[4])
|
||||
self._addCharFormat("bold", colEmph, "b")
|
||||
self._addCharFormat("italic", colEmph, "i")
|
||||
self._addCharFormat("strike", SHARED.theme.colHidden, "s")
|
||||
|
||||
@@ -38,7 +38,7 @@ from PyQt5.QtWidgets import (
|
||||
)
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.constants import nwHeaders, nwUnicode
|
||||
from novelwriter.constants import nwStyles, nwUnicode
|
||||
from novelwriter.enum import nwDocAction, nwDocMode, nwItemType
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
@@ -250,7 +250,7 @@ class GuiDocViewer(QTextBrowser):
|
||||
SHARED.project.data.setLastHandle(tHandle, "viewer")
|
||||
self.docHeader.setHandle(tHandle)
|
||||
self.docHeader.setOutline({
|
||||
sTitle: (hItem.title, nwHeaders.H_LEVEL.get(hItem.level, 0))
|
||||
sTitle: (hItem.title, nwStyles.H_LEVEL.get(hItem.level, 0))
|
||||
for sTitle, hItem in SHARED.project.index.iterItemHeadings(tHandle)
|
||||
})
|
||||
self.updateDocMargins()
|
||||
|
||||
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import checkInt
|
||||
from novelwriter.constants import nwHeaders, nwLabels, nwLists, trConst
|
||||
from novelwriter.constants import nwLabels, nwLists, nwStyles, trConst
|
||||
from novelwriter.core.index import IndexHeading, IndexItem
|
||||
from novelwriter.enum import nwDocMode, nwItemClass
|
||||
from novelwriter.extensions.modified import NIconToolButton
|
||||
@@ -343,7 +343,7 @@ class _ViewPanelBackRefs(QTreeWidget):
|
||||
nwItem.itemType, nwItem.itemClass,
|
||||
nwItem.itemLayout, nwItem.mainHeading
|
||||
)
|
||||
iLevel = nwHeaders.H_LEVEL.get(hItem.level, 0) if nwItem.isDocumentLayout() else 5
|
||||
iLevel = nwStyles.H_LEVEL.get(hItem.level, 0) if nwItem.isDocumentLayout() else 5
|
||||
hDec = SHARED.theme.getHeaderDecorationNarrow(iLevel)
|
||||
|
||||
tKey = f"{tHandle}:{sTitle}"
|
||||
@@ -453,7 +453,7 @@ class _ViewPanelKeyWords(QTreeWidget):
|
||||
nwItem.itemLayout, nwItem.mainHeading
|
||||
)
|
||||
impLabel, impIcon = nwItem.getImportStatus()
|
||||
iLevel = nwHeaders.H_LEVEL.get(hItem.level, 0) if nwItem.isDocumentLayout() else 5
|
||||
iLevel = nwStyles.H_LEVEL.get(hItem.level, 0) if nwItem.isDocumentLayout() else 5
|
||||
hDec = SHARED.theme.getHeaderDecorationNarrow(iLevel)
|
||||
|
||||
# This can not use a get call to the dictionary as that would create an
|
||||
|
||||
@@ -34,7 +34,7 @@ from PyQt5.QtWidgets import QAction, QMenuBar
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import openExternalPath
|
||||
from novelwriter.constants import nwConst, nwHeaders, nwKeyWords, nwLabels, nwUnicode, trConst
|
||||
from novelwriter.constants import nwConst, nwKeyWords, nwLabels, nwStyles, nwUnicode, trConst
|
||||
from novelwriter.enum import nwDocAction, nwDocInsert, nwFocus, nwView
|
||||
from novelwriter.extensions.eventfilters import StatusTipFilter
|
||||
|
||||
@@ -700,28 +700,28 @@ class GuiMainMenu(QMenuBar):
|
||||
self.fmtMenu.addSeparator()
|
||||
|
||||
# Format > Heading 1 (Partition)
|
||||
self.aFmtHead1 = self.fmtMenu.addAction(trConst(nwHeaders.H_LABEL["H1"]))
|
||||
self.aFmtHead1 = self.fmtMenu.addAction(trConst(nwStyles.T_LABEL["H1"]))
|
||||
self.aFmtHead1.setShortcut("Ctrl+1")
|
||||
self.aFmtHead1.triggered.connect(
|
||||
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H1)
|
||||
)
|
||||
|
||||
# Format > Heading 2 (Chapter)
|
||||
self.aFmtHead2 = self.fmtMenu.addAction(trConst(nwHeaders.H_LABEL["H2"]))
|
||||
self.aFmtHead2 = self.fmtMenu.addAction(trConst(nwStyles.T_LABEL["H2"]))
|
||||
self.aFmtHead2.setShortcut("Ctrl+2")
|
||||
self.aFmtHead2.triggered.connect(
|
||||
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H2)
|
||||
)
|
||||
|
||||
# Format > Heading 3 (Scene)
|
||||
self.aFmtHead3 = self.fmtMenu.addAction(trConst(nwHeaders.H_LABEL["H3"]))
|
||||
self.aFmtHead3 = self.fmtMenu.addAction(trConst(nwStyles.T_LABEL["H3"]))
|
||||
self.aFmtHead3.setShortcut("Ctrl+3")
|
||||
self.aFmtHead3.triggered.connect(
|
||||
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H3)
|
||||
)
|
||||
|
||||
# Format > Heading 4 (Section)
|
||||
self.aFmtHead4 = self.fmtMenu.addAction(trConst(nwHeaders.H_LABEL["H4"]))
|
||||
self.aFmtHead4 = self.fmtMenu.addAction(trConst(nwStyles.T_LABEL["H4"]))
|
||||
self.aFmtHead4.setShortcut("Ctrl+4")
|
||||
self.aFmtHead4.triggered.connect(
|
||||
lambda: self.requestDocAction.emit(nwDocAction.BLOCK_H4)
|
||||
|
||||
@@ -40,7 +40,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import minmax
|
||||
from novelwriter.constants import nwHeaders, nwKeyWords, nwLabels, trConst
|
||||
from novelwriter.constants import nwKeyWords, nwLabels, nwStyles, trConst
|
||||
from novelwriter.core.index import IndexHeading
|
||||
from novelwriter.enum import nwDocMode, nwItemClass, nwOutline
|
||||
from novelwriter.extensions.modified import NIconToolButton
|
||||
@@ -683,7 +683,7 @@ class GuiNovelTree(QTreeWidget):
|
||||
def _updateTreeItemValues(self, trItem: QTreeWidgetItem, idxItem: IndexHeading,
|
||||
tHandle: str, sTitle: str) -> None:
|
||||
"""Set the tree item values from the index entry."""
|
||||
iLevel = nwHeaders.H_LEVEL.get(idxItem.level, 0)
|
||||
iLevel = nwStyles.H_LEVEL.get(idxItem.level, 0)
|
||||
hDec = SHARED.theme.getHeaderDecoration(iLevel)
|
||||
|
||||
trItem.setData(self.C_TITLE, QtDecoration, hDec)
|
||||
|
||||
@@ -42,7 +42,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import checkInt, formatFileFilter, makeFileNameSafe
|
||||
from novelwriter.constants import nwHeaders, nwKeyWords, nwLabels, trConst
|
||||
from novelwriter.constants import nwKeyWords, nwLabels, nwStyles, trConst
|
||||
from novelwriter.enum import nwDocMode, nwItemClass, nwItemLayout, nwItemType, nwOutline
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.extensions.configlayout import NColourLabel
|
||||
@@ -681,7 +681,7 @@ class GuiOutlineTree(QTreeWidget):
|
||||
novStruct = SHARED.project.index.novelStructure(rootHandle=rootHandle, activeOnly=True)
|
||||
for _, tHandle, sTitle, novIdx in novStruct:
|
||||
|
||||
iLevel = nwHeaders.H_LEVEL.get(novIdx.level, 0)
|
||||
iLevel = nwStyles.H_LEVEL.get(novIdx.level, 0)
|
||||
nwItem = SHARED.project.tree[tHandle]
|
||||
if iLevel == 0 or nwItem is None:
|
||||
continue
|
||||
|
||||
@@ -40,7 +40,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import minmax
|
||||
from novelwriter.constants import nwHeaders, nwLabels, nwUnicode, trConst
|
||||
from novelwriter.constants import nwLabels, nwStyles, nwUnicode, trConst
|
||||
from novelwriter.core.coretools import DocDuplicator, DocMerger, DocSplitter
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.dialogs.docmerge import GuiDocMerge
|
||||
@@ -642,7 +642,7 @@ class GuiProjectTree(QTreeWidget):
|
||||
|
||||
# Collect some information about the selected item
|
||||
qItem = self._getTreeItem(sHandle)
|
||||
sLevel = nwHeaders.H_LEVEL.get(pItem.mainHeading, 0)
|
||||
sLevel = nwStyles.H_LEVEL.get(pItem.mainHeading, 0)
|
||||
sIsParent = False if qItem is None else qItem.childCount() > 0
|
||||
|
||||
if SHARED.project.tree.isTrash(sHandle):
|
||||
|
||||
@@ -38,7 +38,7 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import describeFont
|
||||
from novelwriter.constants import nwHeaders, nwHeadFmt, nwKeyWords, nwLabels, trConst
|
||||
from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles, trConst
|
||||
from novelwriter.core.buildsettings import BuildSettings, FilterMode
|
||||
from novelwriter.extensions.configlayout import (
|
||||
NColourLabel, NFixedPage, NScrollableForm, NScrollablePage
|
||||
@@ -1092,7 +1092,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.titleMarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
trConst(nwHeaders.H_LABEL["H0"]),
|
||||
trConst(nwStyles.T_LABEL["H0"]),
|
||||
[trT, self.titleMarginT, 6, trB, self.titleMarginB],
|
||||
)
|
||||
|
||||
@@ -1104,7 +1104,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.h1MarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
trConst(nwHeaders.H_LABEL["H1"]),
|
||||
trConst(nwStyles.T_LABEL["H1"]),
|
||||
[trT, self.h1MarginT, 6, trB, self.h1MarginB],
|
||||
)
|
||||
|
||||
@@ -1116,7 +1116,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.h2MarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
trConst(nwHeaders.H_LABEL["H2"]),
|
||||
trConst(nwStyles.T_LABEL["H2"]),
|
||||
[trT, self.h2MarginT, 6, trB, self.h2MarginB],
|
||||
)
|
||||
|
||||
@@ -1128,7 +1128,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.h3MarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
trConst(nwHeaders.H_LABEL["H3"]),
|
||||
trConst(nwStyles.T_LABEL["H3"]),
|
||||
[trT, self.h3MarginT, 6, trB, self.h3MarginB],
|
||||
)
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.h4MarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
trConst(nwHeaders.H_LABEL["H4"]),
|
||||
trConst(nwStyles.T_LABEL["H4"]),
|
||||
[trT, self.h4MarginT, 6, trB, self.h4MarginB],
|
||||
)
|
||||
|
||||
@@ -1152,7 +1152,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.textMarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
self._build.getLabel("format.textMargin"),
|
||||
trConst(nwStyles.T_LABEL["TT"]),
|
||||
[trT, self.textMarginT, 6, trB, self.textMarginB],
|
||||
)
|
||||
|
||||
@@ -1164,7 +1164,7 @@ class _FormattingTab(NScrollableForm):
|
||||
self.sepMarginB.setFixedWidth(dbW)
|
||||
|
||||
self.addRow(
|
||||
self._build.getLabel("format.sepMargin"),
|
||||
trConst(nwStyles.T_LABEL["SP"]),
|
||||
[trT, self.sepMarginT, 6, trB, self.sepMarginB],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<office:document xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
|
||||
<office:meta>
|
||||
<meta:creation-date>2024-05-24T21:31:13</meta:creation-date>
|
||||
<meta:generator>novelWriter/2.5a4</meta:generator>
|
||||
<meta:creation-date>2024-10-17T22:22:08</meta:creation-date>
|
||||
<meta:generator>novelWriter/2.6a1</meta:generator>
|
||||
<meta:initial-creator>Jane Smith</meta:initial-creator>
|
||||
<meta:editing-cycles>1234</meta:editing-cycles>
|
||||
<meta:editing-duration>P42DT12H34M56S</meta:editing-duration>
|
||||
<dc:title>Test Project</dc:title>
|
||||
<dc:date>2024-05-24T21:31:13</dc:date>
|
||||
<dc:date>2024-10-17T22:22:08</dc:date>
|
||||
<dc:creator>Jane Smith</dc:creator>
|
||||
</office:meta>
|
||||
<office:font-face-decls>
|
||||
@@ -22,50 +22,50 @@
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="12pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="14pt" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="15pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra" />
|
||||
<style:style style:name="Text_20_body" style:family="paragraph" style:display-name="Text body" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.247cm" fo:line-height="115%" fo:text-align="left" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.246cm" fo:line-height="115%" fo:text-align="left" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="First_20_line_20_indent" style:family="paragraph" style:display-name="First line indent" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:text-indent="0.593cm" />
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_Meta" style:family="paragraph" style:display-name="Text Meta" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.247cm" fo:line-height="115%" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.246cm" fo:line-height="115%" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" fo:color="#813709" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Title" style:family="paragraph" style:display-name="Title" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
<style:paragraph-properties fo:margin-top="0.600cm" fo:margin-bottom="0.212cm" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.601cm" fo:margin-bottom="0.212cm" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="30pt" fo:font-weight="bold" />
|
||||
</style:style>
|
||||
<style:style style:name="Separator" style:family="paragraph" style:display-name="Separator" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.494cm" fo:line-height="115%" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.495cm" fo:line-height="115%" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_1" style:family="paragraph" style:display-name="Heading 1" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.600cm" fo:margin-bottom="0.212cm" />
|
||||
<style:paragraph-properties fo:margin-top="0.601cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="24pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_2" style:family="paragraph" style:display-name="Heading 2" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.706cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="19pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.707cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="21pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_3" style:family="paragraph" style:display-name="Heading 3" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="16pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="18pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_4" style:family="paragraph" style:display-name="Heading 4" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="4" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="14pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="15pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Header" style:family="paragraph" style:display-name="Header" style:parent-style-name="Header_20_and_20_Footer">
|
||||
<style:paragraph-properties fo:text-align="right" />
|
||||
</style:style>
|
||||
<style:style style:name="Footnote" style:family="paragraph" style:display-name="Footnote" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-bottom="0.198cm" fo:margin-left="0.600cm" fo:text-indent="-0.600cm" />
|
||||
<style:paragraph-properties fo:margin-bottom="0.199cm" fo:margin-left="0.601cm" fo:text-indent="-0.601cm" />
|
||||
<style:text-properties fo:font-size="10pt" />
|
||||
</style:style>
|
||||
</office:styles>
|
||||
|
||||
@@ -12,50 +12,50 @@
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="12pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="14pt" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-weight="normal" fo:font-style="normal" fo:font-size="15pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra" />
|
||||
<style:style style:name="Text_20_body" style:family="paragraph" style:display-name="Text body" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.247cm" fo:line-height="115%" fo:text-align="left" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.246cm" fo:line-height="115%" fo:text-align="left" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="First_20_line_20_indent" style:family="paragraph" style:display-name="First line indent" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:text-indent="0.593cm" />
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_Meta" style:family="paragraph" style:display-name="Text Meta" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.247cm" fo:line-height="115%" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.246cm" fo:line-height="115%" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" fo:color="#813709" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Title" style:family="paragraph" style:display-name="Title" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
<style:paragraph-properties fo:margin-top="0.600cm" fo:margin-bottom="0.212cm" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.601cm" fo:margin-bottom="0.212cm" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="30pt" fo:font-weight="bold" />
|
||||
</style:style>
|
||||
<style:style style:name="Separator" style:family="paragraph" style:display-name="Separator" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.494cm" fo:line-height="115%" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.495cm" fo:line-height="115%" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_1" style:family="paragraph" style:display-name="Heading 1" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.600cm" fo:margin-bottom="0.212cm" />
|
||||
<style:paragraph-properties fo:margin-top="0.601cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="24pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_2" style:family="paragraph" style:display-name="Heading 2" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.706cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="19pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.707cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="21pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_3" style:family="paragraph" style:display-name="Heading 3" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="16pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="18pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_4" style:family="paragraph" style:display-name="Heading 4" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="4" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.494cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="14pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.495cm" fo:margin-bottom="0.212cm" />
|
||||
<style:text-properties style:font-name="Liberation Serif" fo:font-family="Liberation Serif" fo:font-size="15pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Header" style:family="paragraph" style:display-name="Header" style:parent-style-name="Header_20_and_20_Footer">
|
||||
<style:paragraph-properties fo:text-align="right" />
|
||||
</style:style>
|
||||
<style:style style:name="Footnote" style:family="paragraph" style:display-name="Footnote" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-bottom="0.198cm" fo:margin-left="0.600cm" fo:text-indent="-0.600cm" />
|
||||
<style:paragraph-properties fo:margin-bottom="0.199cm" fo:margin-left="0.601cm" fo:text-indent="-0.601cm" />
|
||||
<style:text-properties fo:font-size="10pt" />
|
||||
</style:style>
|
||||
</office:styles>
|
||||
|
||||
@@ -9,8 +9,8 @@ body {font-family: 'Arial'; font-size: 12pt; font-weight: 400; font-style: norma
|
||||
p {text-align: justify; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.76em;}
|
||||
h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.85em; margin-bottom: 0.65em;}
|
||||
h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 2.18em; margin-bottom: 0.65em;}
|
||||
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.52em; margin-bottom: 0.65em;}
|
||||
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.52em; margin-bottom: 0.65em;}
|
||||
h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}
|
||||
h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}
|
||||
.title {font-size: 2.5em; margin-top: 1.85em; margin-bottom: 0.65em;}
|
||||
.sep, .skip {text-align: center; margin-top: 1.30em; margin-bottom: 1.30em;}
|
||||
a {color: rgb(66, 113, 174);}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"meta": {
|
||||
"projectName": "Lorem Ipsum",
|
||||
"novelAuthor": "lipsum.com",
|
||||
"buildTime": 1727777646,
|
||||
"buildTimeStr": "2024-10-01 12:14:06"
|
||||
"buildTime": 1729195330,
|
||||
"buildTimeStr": "2024-10-17 22:02:10"
|
||||
},
|
||||
"text": {
|
||||
"css": [
|
||||
@@ -11,8 +11,8 @@
|
||||
"p {text-align: justify; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.76em;}",
|
||||
"h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.85em; margin-bottom: 0.65em;}",
|
||||
"h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 2.18em; margin-bottom: 0.65em;}",
|
||||
"h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.52em; margin-bottom: 0.65em;}",
|
||||
"h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.52em; margin-bottom: 0.65em;}",
|
||||
"h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}",
|
||||
"h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}",
|
||||
".title {font-size: 2.5em; margin-top: 1.85em; margin-bottom: 0.65em;}",
|
||||
".sep, .skip {text-align: center; margin-top: 1.30em; margin-bottom: 1.30em;}",
|
||||
"a {color: rgb(66, 113, 174);}",
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<office:document xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
|
||||
<office:meta>
|
||||
<meta:creation-date>2024-10-01T12:11:50</meta:creation-date>
|
||||
<meta:generator>novelWriter/2.6a0</meta:generator>
|
||||
<meta:creation-date>2024-10-17T22:22:05</meta:creation-date>
|
||||
<meta:generator>novelWriter/2.6a1</meta:generator>
|
||||
<meta:initial-creator>lipsum.com</meta:initial-creator>
|
||||
<meta:editing-cycles>45</meta:editing-cycles>
|
||||
<meta:editing-duration>P0DT0H36M8S</meta:editing-duration>
|
||||
<dc:title>Lorem Ipsum</dc:title>
|
||||
<dc:date>2024-10-01T12:11:50</dc:date>
|
||||
<dc:date>2024-10-17T22:22:05</dc:date>
|
||||
<dc:creator>lipsum.com</dc:creator>
|
||||
</office:meta>
|
||||
<office:font-face-decls>
|
||||
@@ -22,50 +22,50 @@
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-weight="normal" fo:font-style="normal" fo:font-size="12pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.645cm" fo:margin-bottom="0.276cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-weight="normal" fo:font-style="normal" fo:font-size="14pt" />
|
||||
<style:paragraph-properties fo:margin-top="0.646cm" fo:margin-bottom="0.276cm" fo:keep-with-next="always" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-weight="normal" fo:font-style="normal" fo:font-size="15pt" />
|
||||
</style:style>
|
||||
<style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra" />
|
||||
<style:style style:name="Text_20_body" style:family="paragraph" style:display-name="Text body" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.322cm" fo:line-height="150%" fo:text-align="justify" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.320cm" fo:line-height="150%" fo:text-align="justify" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="First_20_line_20_indent" style:family="paragraph" style:display-name="First line indent" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:text-indent="0.593cm" />
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_Meta" style:family="paragraph" style:display-name="Text Meta" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.322cm" fo:line-height="150%" />
|
||||
<style:paragraph-properties fo:margin-top="0.000cm" fo:margin-bottom="0.320cm" fo:line-height="150%" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="12pt" fo:font-weight="normal" fo:color="#813709" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Title" style:family="paragraph" style:display-name="Title" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
<style:paragraph-properties fo:margin-top="0.782cm" fo:margin-bottom="0.276cm" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.784cm" fo:margin-bottom="0.276cm" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="30pt" fo:font-weight="bold" />
|
||||
</style:style>
|
||||
<style:style style:name="Separator" style:family="paragraph" style:display-name="Separator" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.645cm" fo:margin-bottom="0.645cm" fo:line-height="150%" fo:text-align="center" />
|
||||
<style:paragraph-properties fo:margin-top="0.646cm" fo:margin-bottom="0.646cm" fo:line-height="150%" fo:text-align="center" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="12pt" fo:font-weight="normal" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_1" style:family="paragraph" style:display-name="Heading 1" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.782cm" fo:margin-bottom="0.276cm" />
|
||||
<style:paragraph-properties fo:margin-top="0.784cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="24pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_2" style:family="paragraph" style:display-name="Heading 2" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.921cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="19pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.922cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="21pt" fo:font-weight="bold" fo:color="#2a6099" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_3" style:family="paragraph" style:display-name="Heading 3" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.645cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="16pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.646cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="18pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_4" style:family="paragraph" style:display-name="Heading 4" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="4" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.645cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="14pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
<style:paragraph-properties fo:margin-top="0.646cm" fo:margin-bottom="0.276cm" />
|
||||
<style:text-properties style:font-name="Arial" fo:font-family="Arial" fo:font-size="15pt" fo:font-weight="bold" fo:color="#444444" loext:opacity="100%" />
|
||||
</style:style>
|
||||
<style:style style:name="Header" style:family="paragraph" style:display-name="Header" style:parent-style-name="Header_20_and_20_Footer">
|
||||
<style:paragraph-properties fo:text-align="right" />
|
||||
</style:style>
|
||||
<style:style style:name="Footnote" style:family="paragraph" style:display-name="Footnote" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-bottom="0.198cm" fo:margin-left="0.600cm" fo:text-indent="-0.600cm" />
|
||||
<style:paragraph-properties fo:margin-bottom="0.199cm" fo:margin-left="0.601cm" fo:text-indent="-0.601cm" />
|
||||
<style:text-properties fo:font-size="10pt" />
|
||||
</style:style>
|
||||
</office:styles>
|
||||
|
||||
@@ -27,7 +27,7 @@ import pytest
|
||||
from PyQt5.QtGui import QFont
|
||||
|
||||
from novelwriter import CONFIG
|
||||
from novelwriter.constants import nwHeadFmt
|
||||
from novelwriter.constants import nwHeadFmt, nwStyles
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.formats.tokenizer import HeadingFormatter, Tokenizer, stripEscape
|
||||
from novelwriter.formats.tomarkdown import ToMarkdown
|
||||
@@ -74,14 +74,14 @@ def testFmtToken_Setters(mockGUI):
|
||||
assert tokens._lineHeight == 1.15
|
||||
assert tokens._blockIndent == 4.0
|
||||
assert tokens._doJustify is False
|
||||
assert tokens._marginTitle == (1.417, 0.500)
|
||||
assert tokens._marginHead1 == (1.417, 0.500)
|
||||
assert tokens._marginHead2 == (1.668, 0.500)
|
||||
assert tokens._marginHead3 == (1.168, 0.500)
|
||||
assert tokens._marginHead4 == (1.168, 0.500)
|
||||
assert tokens._marginText == (0.000, 0.584)
|
||||
assert tokens._marginMeta == (0.000, 0.584)
|
||||
assert tokens._marginSep == (1.168, 1.168)
|
||||
assert tokens._marginTitle == nwStyles.T_MARGIN["H0"]
|
||||
assert tokens._marginHead1 == nwStyles.T_MARGIN["H1"]
|
||||
assert tokens._marginHead2 == nwStyles.T_MARGIN["H2"]
|
||||
assert tokens._marginHead3 == nwStyles.T_MARGIN["H3"]
|
||||
assert tokens._marginHead4 == nwStyles.T_MARGIN["H4"]
|
||||
assert tokens._marginSep == nwStyles.T_MARGIN["SP"]
|
||||
assert tokens._marginText == nwStyles.T_MARGIN["TT"]
|
||||
assert tokens._marginMeta == nwStyles.T_MARGIN["MT"]
|
||||
assert tokens._hidePart is False
|
||||
assert tokens._hideChapter is False
|
||||
assert tokens._hideUnNum is False
|
||||
|
||||
Reference in New Issue
Block a user