22 #include <com/sun/star/i18n/ScriptType.hpp>
123 const std::optional<editeng::SvxBorderLine>&
142 const std::optional<editeng::SvxBorderLine>&
161 const std::optional<editeng::SvxBorderLine>&
180 const std::optional<editeng::SvxBorderLine>&
200 const bool bVertLayoutLRBT)
const
212 case SvxShadowLocation::TopLeft:
213 aLocation = SvxShadowLocation::BottomLeft;
215 case SvxShadowLocation::TopRight:
216 aLocation = SvxShadowLocation::TopLeft;
218 case SvxShadowLocation::BottomLeft:
219 aLocation = SvxShadowLocation::BottomRight;
221 case SvxShadowLocation::BottomRight:
222 aLocation = SvxShadowLocation::TopRight;
224 case SvxShadowLocation::NONE:
225 case SvxShadowLocation::End:
234 case SvxShadowLocation::TopLeft:
235 aLocation = SvxShadowLocation::BottomRight;
237 case SvxShadowLocation::TopRight:
238 aLocation = SvxShadowLocation::BottomLeft;
240 case SvxShadowLocation::BottomLeft:
241 aLocation = SvxShadowLocation::TopRight;
243 case SvxShadowLocation::BottomRight:
244 aLocation = SvxShadowLocation::TopLeft;
246 case SvxShadowLocation::NONE:
247 case SvxShadowLocation::End:
256 case SvxShadowLocation::TopLeft:
257 aLocation = SvxShadowLocation::TopRight;
259 case SvxShadowLocation::TopRight:
260 aLocation = SvxShadowLocation::BottomRight;
262 case SvxShadowLocation::BottomLeft:
263 aLocation = SvxShadowLocation::TopLeft;
265 case SvxShadowLocation::BottomRight:
266 aLocation = SvxShadowLocation::BottomLeft;
268 case SvxShadowLocation::NONE:
269 case SvxShadowLocation::End:
283 const bool bVertLayoutLRBT,
const bool bSkipLeft,
284 const bool bSkipRight)
const
286 sal_uInt16 nSpace = 0;
291 case SvxShadowItemSide::TOP:
292 if(( aLoc == SvxShadowLocation::TopLeft ||
293 aLoc == SvxShadowLocation::TopRight ) &&
294 ( nOrient == 0_deg10 || nOrient == 1800_deg10 ||
295 ( nOrient == 900_deg10 && !bSkipRight ) ||
296 ( nOrient == 2700_deg10 && !bSkipLeft )))
302 case SvxShadowItemSide::BOTTOM:
303 if(( aLoc == SvxShadowLocation::BottomLeft ||
304 aLoc == SvxShadowLocation::BottomRight ) &&
305 ( nOrient == 0_deg10 || nOrient == 1800_deg10 ||
306 ( nOrient == 900_deg10 && !bSkipLeft ) ||
307 ( nOrient == 2700_deg10 && !bSkipRight )))
313 case SvxShadowItemSide::LEFT:
314 if(( aLoc == SvxShadowLocation::TopLeft ||
315 aLoc == SvxShadowLocation::BottomLeft ) &&
316 ( nOrient == 900_deg10 || nOrient == 2700_deg10 ||
317 ( nOrient == 0_deg10 && !bSkipLeft ) ||
318 ( nOrient == 1800_deg10 && !bSkipRight )))
324 case SvxShadowItemSide::RIGHT:
325 if(( aLoc == SvxShadowLocation::TopRight ||
326 aLoc == SvxShadowLocation::BottomRight ) &&
327 ( nOrient == 900_deg10 || nOrient == 2700_deg10 ||
328 ( nOrient == 0_deg10 && !bSkipRight ) ||
329 ( nOrient == 1800_deg10 && !bSkipLeft )))
347 switch ( nDir.
get() )
361 #if OSL_DEBUG_LEVEL > 0
363 OSL_FAIL(
"Unsupported direction" );
383 SAL_WARN(
"sw.core",
"unsupported direction for VertLRBT");
391 switch ( nDir.
get() )
402 #if OSL_DEBUG_LEVEL > 0
404 OSL_FAIL(
"Unsupported direction" );
420 nDir =
MapDirection(nDir, bVertFormat, bVertLayoutLRBT);
425 bool bVertical = bVertFormat && !bVertLayoutLRBT;
494 aTmpSize.
setHeight( pHeight->GetHeight() );
517 aTmpSize.
setHeight( pHeight->GetHeight() );
546 aTmpSize.
setHeight( pHeight->GetHeight() );
585 if( pItem->GetValue() )
589 FontKerning::FontSpecific :
590 FontKerning::Asian );
632 if( pTwoLinesItem && pTwoLinesItem->
GetValue() )
644 : m_aSub(rFont.m_aSub)
757 FontKerning::FontSpecific :
758 FontKerning::Asian );
867 &
m_aSub[nWhich], pSh,
true );
924 const sal_uInt16 nOldAscent )
const
931 const sal_uInt16 nDesc = nDescent>0
941 short nKernx = - short( Font::GetFontSize().
Height() / 6 );
995 const OUString oldText = rInf.
GetText();
1002 const OUString oldStr = rInf.
GetText();
1003 bool bCaseMapLengthDiffers(aTmp.getLength() != oldStr.getLength());
1005 if(bCaseMapLengthDiffers && rInf.
GetLen())
1012 const OUString aSnippet(oldStr.copy(sal_Int32(nOldIdx), sal_Int32(nOldLen)));
1040 aTextSize.setHeight(
1041 static_cast<tools::Long>(
CalcEscHeight( o3tl::narrowing<sal_uInt16>(aTextSize.Height()), nAscent)) );
1048 assert(!
"this is presumably dead code");
1062 assert(!
"this is presumably dead code");
1081 if( !rInf.
GetLen() || !nLn )
1091 nOldUnder = GetUnderline();
1119 const OUString oldStr = rInf.
GetText();
1121 bool bCaseMapLengthDiffers(aString.getLength() != oldStr.getLength());
1123 if(bCaseMapLengthDiffers && rInf.
GetLen())
1130 const OUString aSnippet(oldStr.copy(sal_Int32(nOldIdx), sal_Int32(nOldLen)));
1155 const OUString oldStr = rInf.
GetText();
1168 const bool bAsianFont =
1172 if (
CH_BLANK == oldStr[sal_Int32(nTmp)] || bAsianFont ||
1175 && i18n::ScriptType::ASIAN == pSI->ScriptType(nTmp +
TextFrameIndex(1))))
1216 nOldUnder = GetUnderline();
1265 const OUString oldStr = rInf.
GetText();
1300 const OUString oldText = rInf.
GetText();
1322 bool bVertLRBT =
false;
1337 switch ( nDir.
get() )
1340 rPos.AdjustY(nOfst );
1343 rPos.AdjustX(nOfst );
1346 rPos.AdjustX( -nOfst );
1355 switch ( nDir.
get() )
1358 rPos.AdjustY(nOfst );
1361 rPos.AdjustX(nOfst );
1364 rPos.AdjustX( -nOfst );
1372 switch ( nDir.
get() )
1375 rPos.AdjustY( -nOfst );
1378 rPos.AdjustX( -nOfst );
1381 rPos.AdjustX(nOfst );
1391 OSL_ENSURE(
m_bPos,
"DrawTextInfo: Undefined Position" );
1392 OSL_ENSURE(
m_bSize,
"DrawTextInfo: Undefined Width" );
1399 bool bVertLRBT =
false;
1405 nDir = bBidiPor ? 1800_deg10 :
UnMapDirection(nDir, bVert, bVertLRBT);
1407 switch ( nDir.
get() )
1429 : m_aPos( rPoint ), m_nEnd( nEnd ), m_pFont( &rFnt )
1442 SwFont aFont(&rSet, &rIDocumentSettingAccess);
1447 case i18n::ScriptType::LATIN:
1450 case i18n::ScriptType::ASIAN:
1453 case i18n::ScriptType::COMPLEX:
1465 rMutableOut.
SetFont(aOldFont);
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
const SvxFontItem & GetCTLFont(bool=true) const
SwViewShell const * GetShell() const
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
const SvxColorItem & GetColor(bool=true) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SvxFontHeightItem & GetSize(bool=true) const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
void SetWordLineMode(const bool bWordLineMode)
const SvxContourItem & GetContour(bool=true) const
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
vcl::RenderContext * GetpOut() const
const SvxCharRotateItem & GetCharRotate(bool=true) const
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
tools::Long GetCharacterSpacing() const
const SvxUnderlineItem & GetUnderline(bool=true) const
const SvxOverlineItem & GetOverline(bool=true) const
const SvxPostureItem & GetCTLPosture(bool=true) const
const Color & GetTextLineColor() const
sal_uInt16 GetFontHeight(const SwViewShell *pSh, const OutputDevice &rOut)
const Color & GetUnderColor() const
std::optional< editeng::SvxBorderLine > m_aTopBorder
const SvxShadowedItem & GetShadowed(bool=true) const
void SwitchHorizontalToVertical(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from horizontal to vertical layout...
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
TextFrameIndex GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
void SetIdx(TextFrameIndex const nNew)
const SvxLanguageItem & GetLanguage(bool=true) const
const SvxCrossedOutItem & GetCrossedOut(bool=true) const
void SetUnderline(const FontLineStyle eUnderline)
const SvxCharHiddenItem & GetCharHidden(bool=true) const
const std::optional< editeng::SvxBorderLine > & GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
const SvxFont & GetActualFont() const
void SetGreyWave(bool bNew)
void SetEmphasisMark(const FontEmphasisMark eValue)
const SvxLanguageItem & GetCJKLanguage(bool=true) const
sal_uInt16 GetFontAscent(const SwViewShell *pSh, const OutputDevice &rOut)
void SetPos(const Point &rNew)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
sal_uInt16 GetWidth() const
void SetWidth(sal_uInt16 nNew)
sal_uInt8 m_nContentControlCount
#define DFLT_ESC_AUTO_SUB
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
void SetOutline(const bool bOutline)
void SetPropWidth(const sal_uInt16 nNew)
tools::Long AttrSetToLineHeight(const IDocumentSettingAccess &rIDocumentSettingAccess, const SwAttrSet &rSet, const vcl::RenderContext &rOut, sal_Int16 nScript)
Helper for filters to find true lineheight of a font.
FontPitch GetPitch() const
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
sal_uInt16 m_nLeftBorderDist
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
FontFamily GetFamily() const
FontItalic GetPosture() const
void DrawCapital(SwDrawTextInfo &rInf)
void SetColor(const Color &rColor)
const SwScriptInfo * GetScriptInfo() const
constexpr tools::Long Width() const
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
const Color & GetOverlineColor() const
void SetShadow(const bool bShadow)
sal_uInt16 m_nShadowWidth
sal_uInt16 m_nRightBorderDist
const Color & GetColor() const
Degree10 GetValue() const
void DrawStretchText(const Point &rStartPt, sal_uLong nWidth, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1)
const SwTextFrame * GetFrame() const
const SvxFontHeightItem & GetCJKSize(bool=true) const
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
const Color & GetOverColor() const
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
const vcl::Font & GetFont() const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
void SetUnderFnt(SwUnderlineFont *pULFnt)
rtl_TextEncoding GetCharSet() const
const SvxCaseMapItem & GetCaseMap(bool=true) const
const SvxFontHeightItem & GetCTLSize(bool=true) const
void SetKern(tools::Long nNew)
void DrawStretchText_(SwDrawTextInfo &rInf)
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
#define DFLT_ESC_AUTO_SUPER
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
FontEmphasisMark GetEmphasisMark() const
void SetShadowColor(const Color &rColor)
const SvxAutoKernItem & GetAutoKern(bool=true) const
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
void SetUnderline(const FontLineStyle eUnderline)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
void SetShadowLocation(const SvxShadowLocation aLocation)
const std::optional< editeng::SvxBorderLine > & GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
SwUnderlineFont * GetUnderFnt() const
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
void SetStrikeout(const FontStrikeout eStrikeout)
SwFontScript GetActual() const
void SetLen(TextFrameIndex const nNew)
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
const OUString & GetText() const
const OUString & GetStyleName() const
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
std::optional< editeng::SvxBorderLine > m_aLeftBorder
const SvxWeightItem & GetCTLWeight(bool=true) const
const SvxCharScaleWidthItem & GetCharScaleW(bool=true) const
UNDERLYING_TYPE get() const
bool ApplyAutoColor(vcl::Font *pFnt=nullptr)
void SetTransparent(const bool bTrans)
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
std::optional< editeng::SvxBorderLine > m_aBottomBorder
sal_uInt8 m_nInputFieldCount
FontWeight GetWeight() const
void SetUnderColor(const Color &rColor)
void SetRightBorderDist(const sal_uInt16 nRightDist)
void SetShadowWidth(const sal_uInt16 nWidth)
const Point & GetPos() const
void DrawStretchCapital(SwDrawTextInfo &rInf)
const SvxTwoLinesItem & Get2Lines(bool=true) const
void SetCaseMap(const SvxCaseMap eNew)
const std::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
Size GetCapitalSize(SwDrawTextInfo &rInf)
sal_uInt16 GetFontHangingBaseline(const SwViewShell *pSh, const OutputDevice &rOut)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
const sal_Unicode CH_BLANK
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
void SetRelief(const FontRelief eNew)
#define CH_TXT_ATR_FIELDSTART
const SvxFontItem & GetCJKFont(bool=true) const
void SetEscapement(const short nNewEsc)
Provides access to settings of a document.
void DrawStretchText_(SwDrawTextInfo &rInf)
const SvxLanguageItem & GetCTLLanguage(bool=true) const
SvxCaseMap GetCaseMap() const
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
const SvxEscapementItem & GetEscapement(bool=true) const
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDSTART
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
void SetOverColor(const Color &rColor)
std::optional< Color > mxBackColor
sal_uInt16 m_nBottomBorderDist
const SvxEmphasisMarkItem & GetEmphasisMark(bool=true) const
void SetFixKerning(const short nNewKern)
sal_uInt16 CalcShadowSpace(const SvxShadowItemSide nShadow, const bool bVertLayout, const bool bVertLayoutLRBT, const bool bSkipLeft, const bool bSkipRight) const
Calculate the shadow space on the specified side dependent from the orientation and connection with n...
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
FontLineStyle GetLineStyle() const
void SwitchLTRtoRTL(SwRect &rRect) const
Calculates the coordinates of a rectangle when switching from LTR to RTL layout.
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
Size GetTextSize_(SwDrawTextInfo &rInf)
SwFont & operator=(const SwFont &rFont)
const OUString & GetFamilyName() const
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
LanguageType GetLanguage() const
void Shift(Degree10 nDir)
bool IsSymbol(SwViewShell const *pSh)
void SetDevFont(const SwViewShell *pSh, OutputDevice &rOut)
LanguageType GetLanguage() const
tools::Long GetSpace() const
sal_uInt32 GetHeight() const
const SvxWeightItem & GetCJKWeight(bool=true) const
const void * m_nFontCacheId
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
void SetBackColor(std::optional< Color > xNewColor)
void SetAlign(const TextAlign eAlign)
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
const SvxKerningItem & GetKerning(bool=true) const
void SetFont(const vcl::Font &rNewFont)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
const Point & GetPos() const
void SetTextIdxLen(const OUString &rNewStr, TextFrameIndex const nNewIdx, TextFrameIndex const nNewLen)
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
tools::Long GetTextHeight() const
TextFrameIndex GetLen() const
const Size & GetSize() const
void SetActual(SwFontScript nNew)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
std::optional< editeng::SvxBorderLine > m_aRightBorder
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
OUString CalcCaseMap(const OUString &rTxt) const
bool IsRightToLeft() const
short GetEscapement() const
const SvxPostureItem & GetPosture(bool=true) const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
FontStrikeout GetStrikeout() const
vcl::RenderContext & GetOut() const
const SvxWordLineModeItem & GetWordLineMode(bool=true) const
#define CH_TXT_ATR_FIELDEND
tools::Long GetKern() const
constexpr sal_Int32 COMPLETE_STRING
void setHeight(tools::Long nHeight)
void DrawText(SwDrawTextInfo &rInf)
#define SPACING_PRECISION_FACTOR
#define SAL_WARN(area, stream)
void SetText(const OUString &rNew)
short GetFixKerning() const
void SetAutoKern(FontKerning nAutoKern)
TextFrameIndex GetIdx() const
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
SvxShadowLocation m_aShadowLocation
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
sal_uInt16 m_nTopBorderDist
const std::optional< editeng::SvxBorderLine > & GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void SetProportion(const sal_uInt8 nNewPropr)
SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout, const bool bVertLayoutLRBT) const
Get the absolute shadow location dependent from orientation.
void SetHighlightColor(const Color &aNewColor)
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
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...
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDEND
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
const SvxWeightItem & GetWeight(bool=true) const
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
void SetOverline(const FontLineStyle eOverline)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
const SvxFontItem & GetFont(bool=true) const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
void SetTopBorderDist(const sal_uInt16 nTopDist)
const SvxPostureItem & GetCJKPosture(bool=true) const
const SvxCharReliefItem & GetCharRelief(bool=true) const
const Color & GetValue() const
static Degree10 MapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
const void * GetOwner() const
Size GetTextSize(SwDrawTextInfo &rInf)
determine the TextSize (of the printer)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)