summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorAttila Szűcs <attila.szucs@collabora.com>2024-02-20 03:19:09 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-20 18:38:00 +0100
commit684d63e133fddeca68055a83d85f75bd73319d39 (patch)
tree2fde3b4b8dc6779057297b8911161317aff081e1 /editeng/source
parentd10fd2fd532d14500f67cebcc57a1b0f06786baa (diff)
tdf#67347 fix stacked text kern problems
Disabled some kerning calculations in case of stacked text. Without this: -x position of characters was strange, and the last characters was different. -thin characters, like 'j', 'i', ' ', ... could result issues at editing the text. (if width of character + kern was < 0) Change-Id: I40a23ef445fc9683a1cfd619ea23f1536c525d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163608 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit3.cxx4
-rw-r--r--editeng/source/items/svxfont.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index b54e1328a0ac..8bbcebcebf2a 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1249,14 +1249,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
if (bContinueLastPortion)
{
- Size aSize = aTmpFont.QuickGetTextSize( GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, &aCharPositionArray);
+ Size aSize = aTmpFont.QuickGetTextSize( GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, &aCharPositionArray, bStacked);
pPortion->adjustSize(aSize.Width(), 0);
if (pPortion->GetSize().Height() < aSize.Height())
pPortion->setHeight(aSize.Height());
}
else
{
- Size aSize = aTmpFont.QuickGetTextSize(GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, &aCharPositionArray);
+ Size aSize = aTmpFont.QuickGetTextSize(GetRefDevice(), rParaPortion.GetNode()->GetString(), nTmpPos, nPortionLen, &aCharPositionArray, bStacked);
pPortion->SetSize(aSize);
}
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 876bc06868f8..a4367de4680e 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -442,7 +442,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut )
}
Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
- const sal_Int32 nIdx, const sal_Int32 nLen, KernArray* pDXArray ) const
+ const sal_Int32 nIdx, const sal_Int32 nLen, KernArray* pDXArray, bool bStacked ) const
{
if ( !IsCaseMap() && !IsFixKerning() )
{
@@ -477,7 +477,7 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
}
SAL_INFO( "editeng.quicktextsize", "SvxFont::QuickGetTextSize after GetTextArray(): Text length: " << nLen << " Text size: " << aTxtSize.Width() << "x" << aTxtSize.Height());
- if( IsFixKerning() && ( nLen > 1 ) )
+ if( IsFixKerning() && ( nLen > 1 ) && !bStacked)
{
auto nKern = GetFixKerning();
tools::Long nOldValue = (*pDXArray)[0];