summaryrefslogtreecommitdiff
path: root/sw/inc/viewopt.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-12-21 14:15:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-12-22 10:12:01 +0100
commit39a57fa8c047227060915534e64c4e90affa4b1a (patch)
treef022a7168e65674f2930b14787e8cabe964162c4 /sw/inc/viewopt.hxx
parenta3bc9dc51104d01ec203b8e2d5767dd055a42b58 (diff)
tdf#144862 explore alternatives to writer's on-screen glyph positioning
writer does glyph position adjusting to try and split the difference of the "printing" positions and "screen" positions. it seems to have been there from the initial import commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 Date: Mon Sep 18 23:08:29 2000 +0000 initial import we seem to sync with the printing positions after each whitespace so each initial glyph after whitespace is a stable position and is the 'printing' position while each following glyph is in a position which is somewhere between the 'printing' position and 'screen' position. Which leads to noticeably unstable positions of text during editing at various zoom levels and without a clear rationale for the heuristic. GlyphPositioningMode::Classic, the original mode which remains the default. GlyphPositioningMode::PreferLayout, takes the vcl provided print positions and just uses those unmodified for screen layout like editeng does. GlyphPositioningMode::ClassicInspired, which is similar to GlyphPositioningMode::Classic in using 'printing' positions for the start of runs, but using 'screen' positions for run content. GlyphPositioningMode::PreferReadability, replace the 'printing' positions with the screen-optimized positions for all content. use tools, options, writer, view, glyph positioning to change Change-Id: I6677af973268bc586d825c7fbf0b483aaf651ca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127089 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/inc/viewopt.hxx')
-rw-r--r--sw/inc/viewopt.hxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index e8a1c299b496..6c93602a85ae 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -126,6 +126,13 @@ namespace o3tl {
template<> struct typed_flags<ViewOptFlags> : is_typed_flags<ViewOptFlags, 0x01ff> {};
}
+enum class GlyphPositioningMode {
+ Classic,
+ ClassicInspired,
+ PreferLayout,
+ PreferReadability
+};
+
class SW_DLLPUBLIC SwViewOption
{
static Color s_aDocColor; // color of document boundaries
@@ -163,6 +170,7 @@ class SW_DLLPUBLIC SwViewOption
sal_uInt8 m_nPagePreviewRow; // Page Preview Row/Columns.
sal_uInt8 m_nPagePreviewCol; // Page Preview Row/Columns.
SwFillMode m_nShadowCursorFillMode; // FillMode for ShadowCursor.
+ GlyphPositioningMode m_eGlyphPositioningMode; // Positioning strategy for screen glyphs
bool m_bReadonly : 1; // Readonly-Doc.
bool m_bStarOneSetting : 1;// Prevent from UI automatics (no scrollbars in readonly documents).
bool m_bIsPagePreview : 1; // The preview mustn't print field/footnote/... shadings.
@@ -426,6 +434,12 @@ public:
void SetPrinting(bool b)
{ SetCore2Option(b, ViewOptCoreFlags2::Printing); }
+ GlyphPositioningMode GetGlyphPositioningMode() const
+ { return m_eGlyphPositioningMode; }
+
+ void SetGlyphPositioningMode(GlyphPositioningMode eMode)
+ { m_eGlyphPositioningMode = eMode; }
+
void SetCore2Option(bool b, ViewOptCoreFlags2 f)
{
if (b)
@@ -697,6 +711,7 @@ inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
m_nUIOptions = rVOpt.m_nUIOptions;
m_nTableDestination = rVOpt.m_nTableDestination;
m_nShadowCursorFillMode = rVOpt.m_nShadowCursorFillMode;
+ m_eGlyphPositioningMode = rVOpt.m_eGlyphPositioningMode;
}
// Helper function for checking HTML-capabilities.