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() )
223 rStart.AdjustX(nKernStart );
224 rEnd.setX( nBlank + rData.rInf.GetPos().X() + nKernEnd );
225 rEnd.setY( rData.rInf.GetPos().Y() );
228 rStart.AdjustY( -nKernStart );
229 rEnd.setX( rData.rInf.GetPos().X() );
230 rEnd.setY( nBlank + rData.rInf.GetPos().Y() - nKernEnd );
233 rStart.AdjustX( -nKernStart );
234 rEnd.setX( rData.rInf.GetPos().X() - nKernEnd - nBlank );
235 rEnd.setY( rData.rInf.GetPos().Y() );
238 rStart.AdjustY(nKernStart );
239 rEnd.setX( rData.rInf.GetPos().X() );
240 rEnd.setY( nBlank + rData.rInf.GetPos().Y() + nKernEnd );
244 if ( rData.bSwitchL2R )
246 rData.rInf.GetFrame()->SwitchLTRtoRTL( rStart );
247 rData.rInf.GetFrame()->SwitchLTRtoRTL( rEnd );
250 if ( rData.bSwitchH2V )
252 rData.rInf.GetFrame()->SwitchHorizontalToVertical( rStart );
253 rData.rInf.GetFrame()->SwitchHorizontalToVertical( rEnd );
267 OSL_ENSURE( USHRT_MAX !=
m_nScrAscent,
"nScrAscent is going berzerk" );
291 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontAscent returned USHRT_MAX" );
305 OSL_ENSURE( USHRT_MAX !=
m_nScrHeight,
"nScrHeight is going berzerk" );
317#if OSL_DEBUG_LEVEL > 0
323 "GetTextHeight != Ascent + Descent" );
332 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontHeight returned USHRT_MAX" );
373 const bool bBrowse = ( pSh->
GetWin() &&
383 OSL_ENSURE( USHRT_MAX != nRet,
"GetFontLeading returned USHRT_MAX" );
469 m_nScrAscent = o3tl::narrowing<sal_uInt16>(
pOut->GetFontMetric().GetAscent());
475 pOut->SetFont( aOldOutFont );
494 rSh.GetWin()->GetOutDev() :
498 MapMode aTmpMap( MapUnit::MapTwip );
510 if( nTmpLeading <= 0 )
514 if( nTmpLeading < 0 )
534 OSL_ENSURE(
m_nPrtAscent < USHRT_MAX,
"GuessLeading: PrtAscent-Fault" );
582#define WRONG_SHOW_MIN 5
594 return nWidth1 == nWidth2;
606typedef std::vector<std::pair<TextFrameIndex, TextFrameIndex>>
SwForbidden;
612 const CalcLinePosData &rCalcLinePosData,
613 const Size &rPrtFontSize )
621 if (!pWList->
Check( nStart, nWrLen ))
635 SwForbidden::iterator pIter = rForbidden.begin();
648 while( nNext < nEnd )
650 while( pIter != rForbidden.end() && pIter->second <= nNext )
656 if( pIter == rForbidden.end() || nNextEnd <= pIter->
first )
659 rForbidden.insert(pIter, std::make_pair(nNextStart, nNextEnd));
660 pIter = rForbidden.begin();
665 nNext = pIter->second;
666 if( nNextStart < pIter->
first )
668 nNextEnd = pIter->first;
669 pIter->first = nNextStart;
677 lcl_calcLinePos( rCalcLinePosData, aStart, aEnd, nNextStart, nNextEnd - nNextStart );
680 if (wrongArea !=
nullptr)
703 LineInfo aLineInfo( LineStyle::Solid, 26 );
714 LineInfo aLineInfo( LineStyle::Dash );
724 nStart = nEnd + rInf.
GetIdx();
727 while (nWrLen && pWList->
Check( nStart, nWrLen ));
736 sal_Int32 nIndex, sal_Int32 nLen,
bool bCaret =
false,
752 sal_Int32 nLen,
bool bCaret =
false)
761 OSL_ENSURE( rInf.
GetShell(),
"SwFntObj::DrawText without shell" );
769 const bool bBrowse = ( pWin &&
781 const bool bDirectPrint = bPrt || bBrowse;
784 const bool bUseScrFont =
802#if OSL_DEBUG_LEVEL > 0
804 const bool bNoAdjust = bPrt ||
814 OSL_ENSURE( bNoAdjust && !bUseScrFont,
"Outdev Check failed" );
818 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
822 OSL_FAIL(
"Outdev Check failed" );
830 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
834 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
838 OSL_FAIL(
"Outdev Check failed" );
847 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
851 OSL_ENSURE( !bNoAdjust && bUseScrFont,
"Outdev Check failed" );
855 OSL_ENSURE( bNoAdjust && !bUseScrFont,
"Outdev Check failed" );
859 OSL_FAIL(
"Outdev Check failed" );
864 OSL_FAIL(
"Outdev Check failed" );
870 OSL_ENSURE( pTmpFont,
"No screen or printer font?" );
882 const bool bBidiPor = ( bSwitchL2R !=
944 sal_Int32(rInf.
GetLen()), nGridWidth,
false);
953 aTextOriginPos.AdjustX(nDelta);
959 aKernArray, {}, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
988 std::vector<sal_Bool> aKashidaArray;
992 sal_Int32 nZwi = sal_Int32(rInf.
GetLen()) - 1;
1005 nRest = nZwi - nRest;
1009 for( sal_Int32
i = 0;
i < nZwi; )
1021 bool bSpecialJust =
false;
1036 bSpecialJust =
true;
1049 bSpecialJust =
true;
1059 aKashidaArray.resize(aKernArray.
size(),
false);
1062 rInf.
GetLen(), nSpaceAdd ) != -1 )
1064 bSpecialJust =
true;
1068 aKashidaArray.clear();
1087 bSpecialJust =
true;
1097 for (sal_Int32
i = 0;
i < sal_Int32(rInf.
GetLen());
i++,
1101 nKernSum += nSpaceAdd;
1102 aKernArray.
adjust(
i, nKernSum);
1116 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), 1 );
1123 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
1128 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), sal_Int32(rInf.
GetLen()));
1132 Point aTmpPos( aTextOriginPos );
1135 for(
i = 0;
i < sal_Int32(rInf.
GetLen());
i++ )
1139 nKernSum += nSpaceAdd;
1142 sal_Int32(rInf.
GetIdx()) + j,
i - j);
1144 SwTwips nAdd = aKernArray[
i ] + nKernSum;
1147 aTmpPos.setX( aTextOriginPos.X() + nAdd );
1152 sal_Int32(rInf.
GetIdx()) + j,
i - j);
1191 OUString aBulletOverlay;
1213 xFormattingDevice = &rInf.
GetOut();
1218 MapMode aMapMode(xFormattingDevice->GetMapMode());
1221 if (xFormattingDevice->GetDPIX() == xFormattingDevice->GetDPIY())
1223 int nRatio = xFormattingDevice->GetDPIX() / 1440;
1224 if (nRatio * 1440 == xFormattingDevice->GetDPIX())
1225 nSubPixels = nRatio;
1231 std::vector<sal_Bool> aKashidaArray;
1236 bool bNoHalfSpace =
false;
1272 aKashidaArray.resize(aKernArray.
size(),
false);
1275 rInf.
GetLen(), nSpaceAdd ) != -1 )
1279 aKashidaArray.clear();
1280 bNoHalfSpace =
true;
1308 sal_Int32 nCopyStart = sal_Int32(rInf.
GetIdx());
1309 sal_Int32 nCopyLen = sal_Int32(rInf.
GetLen());
1311 aBulletOverlay = rInf.
GetText().copy( nCopyStart, nCopyLen );
1313 for( sal_Int32
i = 0;
i < aBulletOverlay.getLength(); ++
i )
1319 if ((
i + nCopyStart + 1 >= sal_Int32(rInf.
GetLen())) ||
1320 aKernArray[
i + nCopyStart] != aKernArray[
i + nCopyStart + 1])
1322 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BULLET));
1326 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BLANK));
1331 aBulletOverlay = aBulletOverlay.replaceAt(
i, 1, rtl::OUStringChar(
CH_BLANK));
1336 if ( nCnt < rInf.
GetIdx() )
1339 nCnt = nCnt - rInf.
GetIdx();
1358 aKernArray, aKashidaArray, sal_Int32(rInf.
GetIdx()), 1 );
1361 sal_Int32(rInf.
GetIdx()), 1 );
1366 bNoHalfSpace =
true;
1369 sal_Int32(nCnt), nSpaceAdd, rInf.
GetKern(), bNoHalfSpace);
1393 bSwitchH2V, bSwitchH2VLRBT);
1395 switch ( nDir.
get() )
1398 aEnd.setX( rInf.
GetPos().X() + nKernVal );
1399 aEnd.setY( rInf.
GetPos().Y() );
1402 aEnd.setX( rInf.
GetPos().X() );
1403 aEnd.setY( rInf.
GetPos().Y() - nKernVal );
1406 aEnd.setX( rInf.
GetPos().X() - nKernVal );
1407 aEnd.setY( rInf.
GetPos().Y() );
1410 aEnd.setX( rInf.
GetPos().X() );
1411 aEnd.setY( rInf.
GetPos().Y() + nKernVal );
1445 const tools::Long nHalfSpace = bNoHalfSpace ? 0 : nSpaceAdd / 2;
1446 CalcLinePosData aCalcLinePosData(rInf,
GetFont(), nCnt, bSwitchH2V,
1447 bSwitchH2VLRBT, bSwitchL2R, nHalfSpace,
1448 aKernArray, bBidiPor);
1463 sal_Int32 nLen = sal_Int32(rInf.
GetLen());
1474 sal_Int32 nIdx = sal_Int32(rInf.
GetIdx());
1478 nIdx, nLen, SalLayoutFlags::NONE, pGlyphs );
1501 aTextOriginPos.AdjustY(nShift ) ;
1503 aTextOriginPos.AdjustX(nShift ) ;
1506 for( sal_Int32
i = 1 ;
i < nLen ; ++
i )
1509 aKernArray.
adjust(
i - 1, nShift);
1511 aKernArray.
adjust(
i - 1, -nAdd);
1516 pTmpFont->
SetColor( aPreviousColor );
1542 bool bCaret(nMsrLn != nLn);
1558 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1572 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn)) );
1576 "Leading values should be already calculated" );
1581 GetTextArray(*pOutDev, rInf, aKernArray, sal_Int32(nLn), bCaret);
1585 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
1594 aTextSize.
setWidth(aKernArray[sal_Int32(nMsrLn) - 1]);
1600 const bool bCompress = rInf.
GetKanaComp() && nLn &&
1608 CountCompChg()),
"Compression without info" );
1624 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn), bCaret);
1645 aTextSize.
setWidth(aKernArray[sal_Int32(nMsrLn) - 1]);
1649 sal_Int32 nSpaceCount = 0;
1652 for(sal_Int32
i = 1;
i < sal_Int32(nMsrLn); ++
i)
1654 if (nOldValue != aKernArray[
i])
1657 nOldValue = aKernArray[
i];
1667 "Leading values should be already calculated" );
1678 if( 0 != nCharacterSpacing )
1679 nKern -= nCharacterSpacing;
1702 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1707 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
1787 sal_Int32 nDone = 0;
1799 nSpaceSum += nSpaceAdd;
1805 rInf.
GetText(), sal_Int32(nIdx),
1807 i18n::CharacterIteratorMode::SKIPCELL, 1, nDone));
1808 if ( nIdx <= nLastIdx )
1816 nRight = aKernArray[sal_Int32(nIdx - rInf.
GetIdx()) - 1] + nKernSum + nSpaceSum;
1823 if ( nIdx > rInf.
GetIdx() &&
1827 nCnt = nLastIdx - rInf.
GetIdx();
1829 nCnt = nIdx - rInf.
GetIdx();
1838 sal_uInt16 &rIndex,
const void *pOwn,
SwViewShell const *pSh,
1859 sal_uInt16 nZoom = USHRT_MAX;
1872 if ( ( pFntObj->
GetZoom( ) == nZoom ) &&
1886 while ( pFntObj && !( pFntObj->
m_aFont == *
static_cast<vcl::Font const *
>(pOwn) &&
1887 pFntObj->
GetZoom() == nZoom &&
1898 while( pTmpObj && !( pTmpObj->
m_aFont == *
static_cast<vcl::Font const *
>(pOwn) &&
1913 OSL_ENSURE(pFntObj,
"No Font, no Fun.");
1920 OSL_ENSURE( !pFntObj->
m_pPrinter,
"SwFntAccess: Printer Changed" );
1935 rnFontCacheId =
reinterpret_cast<void*
>(
reinterpret_cast<sal_IntPtr
>(pFntObj->
GetOwner()));
1944 static std::uintptr_t fontCacheIdCounter = 0;
1960 CountCompChg()),
"Compression without info" );
1975 const sal_uInt16 nGridWidth =
GetGridWidth(*pGrid, *pDoc);
1984 sal_Int32(rInf.
GetLen()), nGridWidth,
true);
1993 while(nTextBreak < rInf.
GetLen() && aKernArray[sal_Int32(nTextBreak)] <= nTextWidth)
1996 return nTextBreak + rInf.
GetIdx();
2010 const OUString* pTmpText;
2014 bool bTextReplaced =
false;
2024 const OUString aSnippet(rInf.
GetText().copy(sal_Int32(rInf.
GetIdx()), sal_Int32(nLn)));
2026 const bool bTitle = SvxCaseMap::Capitalize ==
m_aSub[
m_nActual].GetCaseMap();
2029 if ( bTitle && nLn )
2035 i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
2038 OUString aSnippetTmp(aSnippet.copy(0, 1));
2040 aTmpText = aTmpText.replaceAt( 0, aSnippetTmp.getLength(), rtl::OUStringChar(aSnippet[0]) );
2044 pTmpText = &aTmpText;
2047 bTextReplaced =
true;
2051 sal_Int32 nHyphPos = sal_Int32(*rInf.
GetHyphPos());
2055 *pTmpText, nTextWidth,
2057 sal_Int32(nTmpIdx), sal_Int32(nTmpLen),
2068 *pTmpText, nTextWidth,
2069 sal_Int32(nTmpIdx), sal_Int32(nTmpLen),
2073 if (bTextReplaced && sal_Int32(nTextBreak) != -1)
2075 if ( nTmpLen != nLn )
2077 rInf.
GetIdx(), nLn, nTextBreak );
2079 nTextBreak = nTextBreak + rInf.
GetIdx();
2090 ! bCompress && nTextWidth == 0)
2097 nTextBreak2 = nTextBreak2 - rInf.
GetIdx();
2099 if( nTextBreak2 < nLn )
2101 if( !nTextBreak2 && nLn )
2103 else if (nLn > nTextBreak2 + nTextBreak2)
2104 nLn = nTextBreak2 + nTextBreak2;
2107 sal_Int32(rInf.
GetIdx()), sal_Int32(nLn));
2114 if( nKern && nTextBreak2 )
2115 nKern *= sal_Int32(nTextBreak2) - 1;
2116 while (nTextBreak2 < nLn && nTextWidth >= aKernArray[sal_Int32(nTextBreak2)] + nKern)
2122 *rInf.
GetHyphPos() += nTextBreak2 - nTmpBreak;
2125 nTextBreak2 = nTextBreak2 + rInf.
GetIdx();
2134 bool bChgFntColor =
false;
2135 bool bChgLineColor =
false;
2143 bChgFntColor =
true;
2147 bChgLineColor =
true;
2156 bChgLineColor = pVSh && bOutputToWindow &&
2164 std::optional<Color> pCol;
2179 if(
GetFrame()->GetBackgroundBrush( aFillAttributes, pItem, pCol, aOrigBackRect,
false,
true ) )
2181 if (aFillAttributes && aFillAttributes->isUsed())
2206 if (pVSh && bOutputToWindow)
2219 Color aTmpColor( nNewColor );
2220 if ( pCol->IsDark() && aTmpColor.
IsDark() )
2222 else if ( pCol->IsBright() && aTmpColor.
IsBright() )
2227 if ( bChgFntColor || bChgLineColor )
2229 Color aNewColor( nNewColor );
2233 if ( pFont && aNewColor != pFont->
GetColor() )
2248 if ( bChgLineColor )
2254 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
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
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
bool IsAlwaysAutoColor() const
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