23#include <officecfg/Office/Common.hxx>
31#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
32#include <com/sun/star/i18n/WordType.hpp>
33#include <com/sun/star/i18n/XBreakIterator.hpp>
47#include <accessibilityoptions.hxx>
87 :
SwCacheObj(reinterpret_cast<void *>(nFontCacheId))
92 , m_nGuessedLeading(USHRT_MAX)
93 , m_nExtLeading(USHRT_MAX)
95 , m_nPrtAscent(USHRT_MAX)
97 , m_nPrtHeight(USHRT_MAX)
98 , m_nPropWidth(rFont.GetPropWidth())
99 , m_nScrHangingBaseline(0)
100 , m_nPrtHangingBaseline(0)
156 return &rRefDev != &rOutDev &&
164struct CalcLinePosData
169 const bool bSwitchH2V;
170 const bool bSwitchH2VLRBT;
171 const bool bSwitchL2R;
177 TextFrameIndex const _nCnt,
const bool _bSwitchH2V,
const bool _bSwitchH2VLRBT,
const bool _bSwitchL2R,
182 bSwitchH2V( _bSwitchH2V ),
183 bSwitchH2VLRBT( _bSwitchH2VLRBT ),
184 bSwitchL2R( _bSwitchL2R ),
185 nHalfSpace( _nHalfSpace ),
186 rKernArray( _rKernArray ),
187 bBidiPor( _bBidiPor )
203 if ( nEnd < rData.nCnt
204 &&
CH_BLANK == rData.rInf.GetText()[sal_Int32(rData.rInf.GetIdx() + nEnd)] )
207 nBlank -= nTmpSpaceAdd;
209 nBlank -= rData.nHalfSpace;
213 sal_Int32 nKernStart = nStart ? rData.rKernArray[sal_Int32(nStart) - 1] : 0;
214 sal_Int32 nKernEnd = rData.rKernArray[sal_Int32(nEnd) - 1];
216 const Degree10 nDir = rData.bBidiPor ? 1800_deg10
218 rData.bSwitchH2V, rData.bSwitchH2VLRBT);
220 switch ( nDir.
get() )
224 rEnd.
setX( nBlank + rData.rInf.GetPos().X() + nKernEnd );
225 rEnd.
setY( rData.rInf.GetPos().Y() );
229 rEnd.
setX( rData.rInf.GetPos().X() );
230 rEnd.
setY( nBlank + rData.rInf.GetPos().Y() - nKernEnd );
234 rEnd.
setX( rData.rInf.GetPos().X() - nKernEnd - nBlank );
235 rEnd.
setY( rData.rInf.GetPos().Y() );
239 rEnd.
setX( rData.rInf.GetPos().X() );
240 rEnd.
setY( nBlank + rData.rInf.GetPos().Y() + nKernEnd );
247 if ( rData.bBidiPor )
248 std::swap(rStart, rEnd);
250 if ( rData.bSwitchL2R )
252 rData.rInf.GetFrame()->SwitchLTRtoRTL( rStart );
253 rData.rInf.GetFrame()->SwitchLTRtoRTL( rEnd );
257 std::swap(rStart, rEnd);
260 if ( rData.bSwitchH2V )
262 rData.rInf.GetFrame()->SwitchHorizontalToVertical( rStart );
263 rData.rInf.GetFrame()->SwitchHorizontalToVertical( rEnd );
277 OSL_ENSURE( USHRT_MAX !=
m_nScrAscent,
"nScrAscent is going berzerk" );
301 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontAscent returned USHRT_MAX" );
315 OSL_ENSURE( USHRT_MAX !=
m_nScrHeight,
"nScrHeight is going berzerk" );
327#if OSL_DEBUG_LEVEL > 0
333 "GetTextHeight != Ascent + Descent" );
342 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontHeight returned USHRT_MAX" );
383 const bool bBrowse = ( pSh->
GetWin() &&
393 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontLeading returned USHRT_MAX" );
479 m_nScrAscent = o3tl::narrowing<sal_uInt16>(
pOut->GetFontMetric().GetAscent());
485 pOut->SetFont( aOldOutFont );
504 rSh.GetWin()->GetOutDev() :
508 MapMode aTmpMap( MapUnit::MapTwip );
520 if( nTmpLeading <= 0 )
524 if( nTmpLeading < 0 )
544 OSL_ENSURE(
m_nPrtAscent < USHRT_MAX,
"GuessLeading: PrtAscent-Fault" );
592#define WRONG_SHOW_MIN 5
604 return nWidth1 == nWidth2;
616typedef std::vector<std::pair<TextFrameIndex, TextFrameIndex>>
SwForbidden;
622 const CalcLinePosData &rCalcLinePosData,
623 const Size &rPrtFontSize )
631 if (!pWList->
Check( nStart, nWrLen ))
645 SwForbidden::iterator pIter = rForbidden.begin();
658 while( nNext < nEnd )
660 while( pIter != rForbidden.end() && pIter->second <= nNext )
666 if( pIter == rForbidden.end() || nNextEnd <= pIter->
first )
669 rForbidden.insert(pIter, std::make_pair(nNextStart, nNextEnd));
670 pIter = rForbidden.begin();
675 nNext = pIter->second;
676 if( nNextStart < pIter->
first )
678 nNextEnd = pIter->first;
679 pIter->first = nNextStart;
687 lcl_calcLinePos( rCalcLinePosData, aStart, aEnd, nNextStart, nNextEnd - nNextStart );
690 if (wrongArea !=
nullptr)
713 LineInfo aLineInfo( LineStyle::Solid, 26 );
724 LineInfo aLineInfo( LineStyle::Dash );
734 nStart = nEnd + rInf.
GetIdx();
737 while (nWrLen && pWList->
Check( nStart, nWrLen ));
746 sal_Int32 nIndex, sal_Int32 nLen,
bool bCaret =
false,
762 sal_Int32 nLen,
bool bCaret =
false)
771 OSL_ENSURE( rInf.
GetShell(),
"SwFntObj::DrawText without shell" );
779 const bool bBrowse = ( pWin &&
791 const bool bDirectPrint = bPrt || bBrowse;
794 const bool bUseScrFont =
812#if OSL_DEBUG_LEVEL > 0
814 const bool bNoAdjust = bPrt ||
824 OSL_ENSURE( bNoAdjust && !bUseScrFont,
"Outdev Check failed" );
828 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
832 OSL_FAIL(
"Outdev Check failed" );
840 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
844 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
848 OSL_FAIL(
"Outdev Check failed" );
857 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
861 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
865 OSL_ENSURE( bNoAdjust && !bUseScrFont,
"Outdev Check failed" );
869 OSL_FAIL(
"Outdev Check failed" );
874 OSL_FAIL(
"Outdev Check failed" );
880 OSL_ENSURE( pTmpFont,
"No screen or printer font?" );
892 const bool bBidiPor = ( bSwitchL2R !=
954 sal_Int32(rInf.
GetLen()), nGridWidth,
false);
963 aTextOriginPos.
AdjustX(nDelta);
969 aKernArray, {}, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
998 std::vector<sal_Bool> aKashidaArray;
1002 sal_Int32 nZwi = sal_Int32(rInf.
GetLen()) - 1;
1015 nRest = nZwi - nRest;
1019 for( sal_Int32
i = 0;
i < nZwi; )
1031 bool bSpecialJust =
false;
1046 bSpecialJust =
true;
1059 bSpecialJust =
true;
1069 aKashidaArray.resize(aKernArray.
size(),
false);
1072 rInf.
GetLen(), nSpaceAdd ) != -1 )
1074 bSpecialJust =
true;
1078 aKashidaArray.clear();
1097 bSpecialJust =
true;
1107 for (sal_Int32
i = 0;
i < sal_Int32(rInf.
GetLen());
i++,
1111 nKernSum += nSpaceAdd;
1112 aKernArray.
adjust(
i, nKernSum);
1126 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), 1 );
1133 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
1138 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
1142 Point aTmpPos( aTextOriginPos );
1145 for(
i = 0;
i < sal_Int32(rInf.
GetLen());
i++ )
1149 nKernSum += nSpaceAdd;
1152 sal_Int32(rInf.
GetIdx()) + j,
i - j);
1154 SwTwips nAdd = aKernArray[
i ] + nKernSum;
1157 aTmpPos.
setX( aTextOriginPos.
X() + nAdd );
1162 sal_Int32(rInf.
GetIdx()) + j,
i - j);
1201 OUString aBulletOverlay;
1223 xFormattingDevice = &rInf.
GetOut();
1228 MapMode aMapMode(xFormattingDevice->GetMapMode());
1231 if (xFormattingDevice->GetDPIX() == xFormattingDevice->GetDPIY())
1233 int nRatio = xFormattingDevice->GetDPIX() / 1440;
1234 if (nRatio * 1440 == xFormattingDevice->GetDPIX())
1235 nSubPixels = nRatio;
1241 std::vector<sal_Bool> aKashidaArray;
1246 bool bNoHalfSpace =
false;
1282 aKashidaArray.resize(aKernArray.
size(),
false);
1285 rInf.
GetLen(), nSpaceAdd ) != -1 )
1289 aKashidaArray.clear();
1290 bNoHalfSpace =
true;
1318 sal_Int32 nCopyStart = sal_Int32(rInf.
GetIdx());
1319 sal_Int32 nCopyLen = sal_Int32(rInf.
GetLen());
1321 aBulletOverlay = rInf.
GetText().copy( nCopyStart, nCopyLen );
1323 for( sal_Int32
i = 0;
i < aBulletOverlay.getLength(); ++
i )
1329 if ((
i + nCopyStart + 1 >= sal_Int32(rInf.
GetLen())) ||
1330 aKernArray[
i + nCopyStart] != aKernArray[
i + nCopyStart + 1])
1332 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BULLET));
1336 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BLANK));
1341 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BLANK));
1346 if ( nCnt < rInf.
GetIdx() )
1349 nCnt = nCnt - rInf.
GetIdx();
1368 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), 1 );
1371 sal_Int32(rInf.
GetIdx()), 1 );
1376 bNoHalfSpace =
true;
1379 sal_Int32(nCnt), nSpaceAdd, rInf.
GetKern(), bNoHalfSpace);
1403 bSwitchH2V, bSwitchH2VLRBT);
1405 switch ( nDir.
get() )
1455 const tools::Long nHalfSpace = bNoHalfSpace ? 0 : nSpaceAdd / 2;
1456 CalcLinePosData aCalcLinePosData(rInf,
GetFont(), nCnt, bSwitchH2V,
1457 bSwitchH2VLRBT, bSwitchL2R, nHalfSpace,
1458 aKernArray, bBidiPor);
1473 sal_Int32 nLen = sal_Int32(rInf.
GetLen());
1484 sal_Int32 nIdx = sal_Int32(rInf.
GetIdx());
1488 nIdx, nLen, SalLayoutFlags::NONE, pGlyphs );
1511 aTextOriginPos.
AdjustY(nShift ) ;
1513 aTextOriginPos.
AdjustX(nShift ) ;
1516 for( sal_Int32
i = 1 ;
i < nLen ; ++
i )
1519 aKernArray.
adjust(
i - 1, nShift);
1521 aKernArray.
adjust(
i - 1, -nAdd);
1526 pTmpFont->
SetColor( aPreviousColor );
1552 bool bCaret(nMsrLn != nLn);
1568 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1582 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn)) );
1586 "Leading values should be already calculated" );
1591 GetTextArray(*pOutDev, rInf, aKernArray, sal_Int32(nLn), bCaret);
1595 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
1604 aTextSize.
setWidth(aKernArray[sal_Int32(nMsrLn) - 1]);
1610 const bool bCompress = rInf.
GetKanaComp() && nLn &&
1618 CountCompChg()),
"Compression without info" );
1634 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn), bCaret);
1655 aTextSize.
setWidth(aKernArray[sal_Int32(nMsrLn) - 1]);
1659 sal_Int32 nSpaceCount = 0;
1662 for(sal_Int32
i = 1;
i < sal_Int32(nMsrLn); ++
i)
1664 if (nOldValue != aKernArray[
i])
1667 nOldValue = aKernArray[
i];
1677 "Leading values should be already calculated" );
1688 if( 0 != nCharacterSpacing )
1689 nKern -= nCharacterSpacing;
1712 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1717 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
1797 sal_Int32 nDone = 0;
1809 nSpaceSum += nSpaceAdd;
1815 rInf.
GetText(), sal_Int32(nIdx),
1817 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone));
1818 if ( nIdx <= nLastIdx )
1826 nRight = aKernArray[sal_Int32(nIdx - rInf.
GetIdx()) - 1] + nKernSum + nSpaceSum;
1833 if ( nIdx > rInf.
GetIdx() &&
1837 nCnt = nLastIdx - rInf.
GetIdx();
1839 nCnt = nIdx - rInf.
GetIdx();
1848 sal_uInt16 &rIndex,
const void *pOwn,
SwViewShell const *pSh,
1869 sal_uInt16 nZoom = USHRT_MAX;
1882 if ( ( pFntObj->
GetZoom( ) == nZoom ) &&
1896 while ( pFntObj && !( pFntObj->
m_aFont == *
static_cast<vcl::Font const *
>(pOwn) &&
1897 pFntObj->
GetZoom() == nZoom &&
1908 while( pTmpObj && !( pTmpObj->
m_aFont == *
static_cast<vcl::Font const *
>(pOwn) &&
1923 OSL_ENSURE(pFntObj,
"No Font, no Fun.");
1930 OSL_ENSURE( !pFntObj->
m_pPrinter,
"SwFntAccess: Printer Changed" );
1945 rnFontCacheId =
reinterpret_cast<void*
>(
reinterpret_cast<sal_IntPtr
>(pFntObj->
GetOwner()));
1954 static std::uintptr_t fontCacheIdCounter = 0;
1970 CountCompChg()),
"Compression without info" );
1985 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1994 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
2003 while(nTextBreak < rInf.
GetLen() && aKernArray[sal_Int32(nTextBreak)] <= nTextWidth)
2006 return nTextBreak + rInf.
GetIdx();
2020 const OUString* pTmpText;
2024 bool bTextReplaced =
false;
2034 const OUString aSnippet(rInf.
GetText().copy(sal_Int32(rInf.
GetIdx()), sal_Int32(nLn)));
2036 const bool bTitle = SvxCaseMap::Capitalize ==
m_aSub[
m_nActual].GetCaseMap();
2039 if ( bTitle && nLn )
2045 i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
2048 OUString aSnippetTmp(aSnippet.copy(0, 1));
2050 aTmpText = aTmpText.replaceAt( 0, aSnippetTmp.getLength(), rtl::OUStringChar(aSnippet[0]) );
2054 pTmpText = &aTmpText;
2057 bTextReplaced =
true;
2061 sal_Int32 nHyphPos = sal_Int32(*rInf.
GetHyphPos());
2065 *pTmpText, nTextWidth,
2067 sal_Int32(nTmpIdx), sal_Int32(nTmpLen),
2078 *pTmpText, nTextWidth,
2079 sal_Int32(nTmpIdx), sal_Int32(nTmpLen),
2083 if (bTextReplaced && sal_Int32(nTextBreak) != -1)
2085 if ( nTmpLen != nLn )
2087 rInf.
GetIdx(), nLn, nTextBreak );
2089 nTextBreak = nTextBreak + rInf.
GetIdx();
2100 ! bCompress && nTextWidth == 0)
2107 nTextBreak2 = nTextBreak2 - rInf.
GetIdx();
2109 if( nTextBreak2 < nLn )
2111 if( !nTextBreak2 && nLn )
2113 else if (nLn > nTextBreak2 + nTextBreak2)
2114 nLn = nTextBreak2 + nTextBreak2;
2117 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn));
2124 if( nKern && nTextBreak2 )
2125 nKern *= sal_Int32(nTextBreak2) - 1;
2126 while (nTextBreak2 < nLn && nTextWidth >= aKernArray[sal_Int32(nTextBreak2)] + nKern)
2132 *rInf.
GetHyphPos() += nTextBreak2 - nTmpBreak;
2135 nTextBreak2 = nTextBreak2 + rInf.
GetIdx();
2144 bool bChgFntColor =
false;
2145 bool bChgLineColor =
false;
2153 bChgFntColor =
true;
2157 bChgLineColor =
true;
2166 bChgLineColor = pVSh && bOutputToWindow &&
2174 std::optional<Color> pCol;
2189 if(
GetFrame()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect,
false,
true ) )
2191 if (aFillAttributes && aFillAttributes->isUsed())
2216 if (pVSh && bOutputToWindow)
2229 Color aTmpColor( nNewColor );
2230 if ( pCol->IsDark() && aTmpColor.
IsDark() )
2232 else if ( pCol->IsBright() && aTmpColor.
IsBright() )
2237 if ( bChgFntColor || bChgLineColor )
2239 Color aNewColor( nNewColor );
2243 if ( pFont && aNewColor != pFont->
GetColor() )
2258 if ( bChgLineColor )
2264 if ( aNewColor !=
GetOut().GetOverlineColor() )
o3tl::strong_int< sal_Int32, struct Tag_TextFrameIndex > TextFrameIndex
Denotes a character index in a text frame at a layout level, after extent mapping from a text node at...
static OutputDevice * GetDefaultDevice()
basegfx::BColor getBColor() const
tools::Long GetDescent() const
tools::Long GetHangingBaseline() const
tools::Long GetExternalLeading() const
tools::Long GetBulletOffset() const
tools::Long GetAscent() const
tools::Long GetInternalLeading() const
bool IsFullstopCentered() const
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
void set(size_t nIndex, sal_Int32 nValue)
void adjust(size_t nIndex, sal_Int32 nDiff)
void SetDashCount(sal_uInt16 nDashCount)
void SetDashLen(double nDashLen)
void SetDistance(double nDistance)
const Fraction & GetScaleX() const
MapUnit GetMapUnit() const
static bool isKorean(LanguageType nLang)
GDIMetaFile * GetConnectMetaFile() const
const vcl::Font & GetFont() const
sal_Int32 GetTextBreak(const OUString &rStr, tools::Long nTextWidth, sal_Int32 nIndex, sal_Int32 nLen=-1, tools::Long nCharExtra=0, vcl::text::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
void DrawTextArray(const Point &rStartPt, const OUString &rStr, KernArraySpan aKernArray, o3tl::span< const sal_Bool > pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags=SalLayoutFlags::NONE, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetFont(const vcl::Font &rNewFont)
void DrawWaveLine(const Point &rStartPos, const Point &rEndPos, tools::Long nLineWidth=1, tools::Long nWaveHeight=3)
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
tools::Long GetTextArray(const OUString &rStr, KernArray *pDXAry, sal_Int32 nIndex=0, sal_Int32 nLen=-1, bool bCaret=false, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
FontMetric GetFontMetric() const
const Color & GetLineColor() const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
OutDevType GetOutDevType() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
LanguageType GetDigitLanguage() const
void DrawStretchText(const Point &rStartPt, sal_Int32 nWidth, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1)
virtual bool IsVirtual() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
static SalLayoutGlyphsCache * self()
const SalLayoutGlyphs * GetLayoutGlyphs(VclPtr< const OutputDevice > outputDevice, const OUString &text, const vcl::text::TextLayoutCache *layoutCache=nullptr)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetColor() const
bool IsAlwaysAutoColor() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
Access class for the Cache.
The Cache object base class Users of the Cache must derive a class from the SwCacheObj and store thei...
sal_uInt16 GetCachePos() const
const void * GetOwner() const
void SetCursorBidiLevel(sal_uInt8 nNew)
bool IsPosMatchesBounds() const
TextFrameIndex GetIdx() const
TextFrameIndex GetLen() const
const OUString & GetText() const
sw::WrongListIterator * GetSmartTags() const
sal_uInt16 GetKanaComp() const
TextFrameIndex * GetHyphPos() const
sw::WrongListIterator * GetGrammarCheck() const
SwViewShell const * GetShell() const
tools::Long GetKern() const
sw::WrongListIterator * GetWrong() const
void SetKanaDiff(tools::Long nNew)
tools::Long GetCharacterSpacing() const
const SwScriptInfo * GetScriptInfo() const
vcl::RenderContext & GetOut() const
TextFrameIndex GetMeasureLen() const
bool ApplyAutoColor(vcl::Font *pFnt=nullptr)
vcl::RenderContext * GetpOut() const
const SwTextFrame * GetFrame() const
void SetLen(TextFrameIndex const nNew)
sal_uInt16 GetWidth() const
const Point & GetPos() const
sal_Int32 GetOffset() const
bool IsIgnoreFrameRTL() const
TextFrameIndex GetNumberOfBlanks() const
tools::Long GetSpace() const
vcl::text::TextLayoutCache const * GetVclCache() const
SwFntAccess(const void *&rnFontCacheId, sal_uInt16 &rIndex, const void *pOwner, SwViewShell const *pShell, bool bCheck=false)
virtual SwCacheObj * NewObj() override
Can be use in NewObj.
SwViewShell const * m_pShell
static SwFntObj * Next(SwFntObj *pFntObj)
void GuessLeading(const SwViewShell &rSh, const FontMetric &rMet)
sal_uInt16 GetFontHeight(const SwViewShell *pSh, const OutputDevice &rOut)
void CreateScrFont(const SwViewShell &rSh, const OutputDevice &rOut)
sal_uInt16 GetZoom() const
void SetDevFont(const SwViewShell *pSh, OutputDevice &rOut)
TextFrameIndex GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
void CreatePrtFont(const OutputDevice &rOut)
sal_uInt16 GetExternalLeading() const
sal_uInt16 GetFontAscent(const SwViewShell *pSh, const OutputDevice &rOut)
sal_uInt16 GetFontLeading(const SwViewShell *pSh, const OutputDevice &rOut)
virtual ~SwFntObj() override
void DrawText(SwDrawTextInfo &rInf)
VclPtr< OutputDevice > m_pPrinter
sal_uInt16 GetGuessedLeading() const
sal_uInt16 GetPropWidth() const
sal_uInt16 GetFontHangingBaseline(const SwViewShell *pSh, const OutputDevice &rOut)
static MapMode * s_pPixMap
sal_uInt16 m_nScrHangingBaseline
sal_uInt16 m_nPrtHangingBaseline
SwFntObj(const SwSubFont &rFont, std::uintptr_t nFontCacheId, SwViewShell const *pSh)
Size GetTextSize(SwDrawTextInfo &rInf)
determine the TextSize (of the printer)
static tools::Long s_nPixWidth
sal_uInt16 m_nGuessedLeading
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
const std::optional< Color > & GetBackColor() const
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
TextFrameIndex GetCapitalBreak(SwViewShell const *pSh, const OutputDevice *pOut, const SwScriptInfo *pScript, const OUString &rText, tools::Long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen)
SwFontScript GetActual() const
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
SvxCaseMap GetCaseMap() const
LanguageType GetLanguage() const
tools::Long GetHeight() const
bool IsRightToLeft() const
SwPageFrame * FindPageFrame()
Of course Writer needs its own rectangles.
tools::Long Compress(KernArray &rKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, const sal_uInt16 nCompress, const sal_uInt16 nFontHeight, const bool bCentered, Point *pPoint=nullptr) const
sal_Int32 KashidaJustify(KernArray *pKernArray, sal_Bool *pKashidaArray, TextFrameIndex nStt, TextFrameIndex nLen, tools::Long nSpaceAdd=0) const
Performs a kashida justification on the kerning array.
sal_uInt8 DirType(const TextFrameIndex nPos) const
static void CJKJustify(const OUString &rText, KernArray &rKernArray, TextFrameIndex nStt, TextFrameIndex nLen, LanguageType aLang, tools::Long nSpaceAdd, bool bIsSpaceStop)
static TextFrameIndex ThaiJustify(std::u16string_view aText, KernArray *pKernArray, TextFrameIndex nIdx, TextFrameIndex nLen, TextFrameIndex nNumberOfBlanks=TextFrameIndex(0), tools::Long nSpaceAdd=0)
Performs a thai justification on the kerning array.
size_t CountKashida() const
static bool IsArabicText(const OUString &rText, TextFrameIndex nStt, TextFrameIndex nLen)
Checks if text is Arabic text.
size_t CountCompChg() const
sal_uInt16 GetPropWidth() const
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout.
SwTextGrid GetGridType() const
bool IsSnapToChars() const
bool IsPagePreview() const
const Color & GetFontColor() const
sal_uInt16 GetZoom() const
bool getBrowseMode() const
const SwViewOption * GetViewOptions() const
bool isOutputToWindow() const
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
vcl::Window * GetWin() const
const SwAccessibilityOptions * GetAccessibilityOptions() const
vcl::RenderContext & GetRefDev() const
WrongAreaLineType mLineType
reference_type * get() const
bool Check(TextFrameIndex &rStart, TextFrameIndex &rLen)
const SwWrongArea * GetWrongElement(TextFrameIndex nStart)
void SetFontSize(const Size &)
bool IsSameInstance(const Font &) const
void SetColor(const Color &)
FontStrikeout GetStrikeout() const
FontLineStyle GetOverline() const
void SetItalic(FontItalic)
void SetWeight(FontWeight)
const OUString & GetFamilyName() const
void SetUnderline(FontLineStyle)
const Size & GetFontSize() const
const Color & GetColor() const
void SetOverline(FontLineStyle)
FontLineStyle GetUnderline() const
rtl_TextEncoding GetCharSet() const
void SetLanguage(LanguageType)
bool IsWordLineMode() const
void SetStrikeout(FontStrikeout)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::vector< std::pair< TextFrameIndex, TextFrameIndex > > SwForbidden
static bool lcl_IsFontAdjustNecessary(const vcl::RenderContext &rOutDev, const vcl::RenderContext &rRefDev)
constexpr Color gWaveCol(COL_GRAY)
static void lcl_calcLinePos(const CalcLinePosData &rData, Point &rStart, Point &rEnd, TextFrameIndex const nStart, TextFrameIndex const nWrLen)
static vcl::DeleteOnDeinit< VclPtr< OutputDevice > > s_pFntObjPixOut
static void lcl_DrawLineForWrongListData(SwForbidden &rForbidden, const SwDrawTextInfo &rInf, sw::WrongListIterator *pWList, const CalcLinePosData &rCalcLinePosData, const Size &rPrtFontSize)
static bool lcl_IsFullstopCentered(const vcl::RenderContext &rOut)
static bool lcl_IsMonoSpaceFont(const vcl::RenderContext &rOut)
static void GetTextArray(const OutputDevice &rDevice, const OUString &rStr, KernArray &rDXAry, sal_Int32 nIndex, sal_Int32 nLen, bool bCaret=false, const vcl::text::TextLayoutCache *layoutCache=nullptr)
TextFrameIndex sw_CalcCaseMap(const SwFont &rFnt, const OUString &rOrigString, TextFrameIndex nOfst, TextFrameIndex nLen, TextFrameIndex nIdx)
UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
constexpr OUStringLiteral first
tools::Long SnapToGrid(KernArray &rKernArray, std::u16string_view aText, sal_Int32 nStt, sal_Int32 nLen, tools::Long nGridWidth, bool bForceLeft)
Snap ideographs to text grids: a) Ideographic open brackets are aligned to the rightmost edge of span...
void SnapToGridEdge(KernArray &rKernArray, sal_Int32 nLen, tools::Long nGridWidth, tools::Long nSpace, tools::Long nKern)
Snap ideographs to text grids edge ( used when snap to char is off ): space will be distributed ( in ...
void SpaceDistribution(KernArray &rKernArray, std::u16string_view aText, sal_Int32 nStt, sal_Int32 nLen, tools::Long nSpaceAdd, tools::Long nKern, bool bNoHalfSpace)
Distribute space between words and letters.
sal_Int32 GetModelPosition(const KernArray &rKernArray, sal_Int32 nLen, tools::Long nX)
Get model position base on given kern array.
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Color GetLineColor(Color const &rColor, DrawModeFlags nDrawMode, StyleSettings const &rStyleSettings)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwNodeOffset abs(const SwNodeOffset &a)
SwTextGridItem const * GetGridItem(SwPageFrame const *const)
sal_uInt16 GetGridWidth(SwTextGridItem const &, SwDoc const &)
Color aGlobalRetoucheColor
#define SPACING_PRECISION_FACTOR
UNDERLYING_TYPE get() const
const sal_Unicode CH_BLANK
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
const sal_Unicode CH_BULLET
constexpr sal_Int32 COMPLETE_STRING
#define NON_PRINTING_CHARACTER_COLOR