22#include <com/sun/star/i18n/ScriptType.hpp>
123const std::optional<editeng::SvxBorderLine>&
142const std::optional<editeng::SvxBorderLine>&
161const std::optional<editeng::SvxBorderLine>&
180const 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 );
943 if ( nKernx < GetFixKerning() )
944 return GetFixKerning();
1003 const OUString oldText = rInf.
GetText();
1010 const OUString oldStr = rInf.
GetText();
1011 bool bCaseMapLengthDiffers(aTmp.getLength() != oldStr.getLength());
1013 if(bCaseMapLengthDiffers && rInf.
GetLen())
1021 const OUString aSnippet(oldStr.copy(sal_Int32(nOldIdx), sal_Int32(nOldLen)));
1029 const OUString aMeasureSnippet(oldStr.copy(sal_Int32(nOldIdx), sal_Int32(nOldMeasureLen)));
1030 const OUString aNewMeasureText(
CalcCaseMap(aMeasureSnippet));
1064 assert(!
"this is presumably dead code");
1078 assert(!
"this is presumably dead code");
1097 if( !rInf.
GetLen() || !nLn )
1107 nOldUnder = GetUnderline();
1135 const OUString oldStr = rInf.
GetText();
1137 bool bCaseMapLengthDiffers(aString.getLength() != oldStr.getLength());
1139 if(bCaseMapLengthDiffers && rInf.
GetLen())
1146 const OUString aSnippet(oldStr.copy(sal_Int32(nOldIdx), sal_Int32(nOldLen)));
1171 const OUString oldStr = rInf.
GetText();
1184 const bool bAsianFont =
1188 if (
CH_BLANK == oldStr[sal_Int32(nTmp)] || bAsianFont ||
1232 nOldUnder = GetUnderline();
1281 const OUString oldStr = rInf.
GetText();
1316 const OUString oldText = rInf.
GetText();
1338 bool bVertLRBT =
false;
1353 switch ( nDir.
get() )
1371 switch ( nDir.
get() )
1388 switch ( nDir.
get() )
1407 OSL_ENSURE(
m_bPos,
"DrawTextInfo: Undefined Position" );
1408 OSL_ENSURE(
m_bSize,
"DrawTextInfo: Undefined Width" );
1415 bool bVertLRBT =
false;
1421 nDir = bBidiPor ? 1800_deg10 :
UnMapDirection(nDir, bVert, bVertLRBT);
1423 switch ( nDir.
get() )
1445 : m_aPos( rPoint ), m_nEnd( nEnd ), m_pFont( &rFnt )
1458 SwFont aFont(&
rSet, &rIDocumentSettingAccess);
1463 case i18n::ScriptType::LATIN:
1466 case i18n::ScriptType::ASIAN:
1469 case i18n::ScriptType::COMPLEX:
1481 rMutableOut.
SetFont(aOldFont);
@ SMALL_CAPS_PERCENTAGE_66
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...
Provides access to settings of a document.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
const Color & GetOverlineColor() const
tools::Long GetTextHeight() const
const Color & GetTextLineColor() const
void DrawStretchText(const Point &rStartPt, sal_Int32 nWidth, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1)
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
SvxCaseMap GetCaseMap() const
const Color & GetValue() const
FontStrikeout GetStrikeout() const
FontEmphasisMark GetEmphasisMark() const
sal_uInt8 & GetProportionalHeight()
sal_uInt32 GetHeight() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
short GetEscapement() const
OUString CalcCaseMap(const OUString &rTxt) const
LanguageType GetLanguage() const
FontItalic GetPosture() const
FontLineStyle GetLineStyle() const
const Color & GetColor() const
Degree10 GetValue() const
FontWeight GetWeight() const
const SvxOverlineItem & GetOverline(bool=true) const
const SvxWeightItem & GetCTLWeight(bool=true) const
const SvxPostureItem & GetCJKPosture(bool=true) const
const SvxFontItem & GetFont(bool=true) const
const SvxFontItem & GetCTLFont(bool=true) const
const SvxColorItem & GetColor(bool=true) const
const SvxKerningItem & GetKerning(bool=true) const
const SvxLanguageItem & GetCJKLanguage(bool=true) const
const SvxPostureItem & GetCTLPosture(bool=true) const
const SvxFontHeightItem & GetSize(bool=true) const
const SvxUnderlineItem & GetUnderline(bool=true) const
const SvxCharReliefItem & GetCharRelief(bool=true) const
const SvxTwoLinesItem & Get2Lines(bool=true) const
const SvxLanguageItem & GetLanguage(bool=true) const
const SvxFontItem & GetCJKFont(bool=true) const
const SvxFontHeightItem & GetCJKSize(bool=true) const
const SvxShadowedItem & GetShadowed(bool=true) const
const SvxCharHiddenItem & GetCharHidden(bool=true) const
const SvxContourItem & GetContour(bool=true) const
const SvxEmphasisMarkItem & GetEmphasisMark(bool=true) const
const SvxAutoKernItem & GetAutoKern(bool=true) const
const SvxWordLineModeItem & GetWordLineMode(bool=true) const
const SvxEscapementItem & GetEscapement(bool=true) const
const SvxLanguageItem & GetCTLLanguage(bool=true) const
const SvxFontHeightItem & GetCTLSize(bool=true) const
const SvxCrossedOutItem & GetCrossedOut(bool=true) const
const SvxWeightItem & GetCJKWeight(bool=true) const
const SvxCaseMapItem & GetCaseMap(bool=true) const
const SvxPostureItem & GetPosture(bool=true) const
const SvxCharRotateItem & GetCharRotate(bool=true) const
const SvxWeightItem & GetWeight(bool=true) const
const SvxCharScaleWidthItem & GetCharScaleW(bool=true) const
const void * GetOwner() const
void SetKern(tools::Long nNew)
void SetGreyWave(bool bNew)
TextFrameIndex GetIdx() const
void SetPos(const Point &rNew)
TextFrameIndex GetLen() const
const OUString & GetText() const
void Shift(Degree10 nDir)
void SetMeasureLen(TextFrameIndex const nNew)
SwViewShell const * GetShell() const
tools::Long GetKern() const
tools::Long GetCharacterSpacing() const
void SetText(const OUString &rNew)
const SwScriptInfo * GetScriptInfo() const
vcl::RenderContext & GetOut() const
void SetWidth(sal_uInt16 nNew)
TextFrameIndex GetMeasureLen() const
bool ApplyAutoColor(vcl::Font *pFnt=nullptr)
void SetIdx(TextFrameIndex const nNew)
SwUnderlineFont * GetUnderFnt() const
vcl::RenderContext * GetpOut() const
void SetTextIdxLen(const OUString &rNewStr, TextFrameIndex const nNewIdx, TextFrameIndex const nNewLen)
const SwTextFrame * GetFrame() const
void SetLen(TextFrameIndex const nNew)
sal_uInt16 GetWidth() const
const Point & GetPos() const
const Size & GetSize() const
void SetUnderFnt(SwUnderlineFont *pULFnt)
tools::Long GetSpace() const
sal_uInt16 GetFontHeight(const SwViewShell *pSh, const OutputDevice &rOut)
void SetDevFont(const SwViewShell *pSh, OutputDevice &rOut)
TextFrameIndex GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
sal_uInt16 GetFontAscent(const SwViewShell *pSh, const OutputDevice &rOut)
void DrawText(SwDrawTextInfo &rInf)
sal_uInt16 GetFontHangingBaseline(const SwViewShell *pSh, const OutputDevice &rOut)
Size GetTextSize(SwDrawTextInfo &rInf)
determine the TextSize (of the printer)
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
void DrawStretchText_(SwDrawTextInfo &rInf)
void SetOverline(const FontLineStyle eOverline)
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetPropWidth(const sal_uInt16 nNew)
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
std::optional< Color > mxBackColor
void SetShadowLocation(const SvxShadowLocation aLocation)
std::optional< editeng::SvxBorderLine > m_aLeftBorder
void SetStrikeout(const FontStrikeout eStrikeout)
void SetHighlightColor(const Color &aNewColor)
SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout, const bool bVertLayoutLRBT) const
Get the absolute shadow location dependent from orientation.
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
void SetEscapement(const short nNewEsc)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
void SetAlign(const TextAlign eAlign)
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
void SetUnderColor(const Color &rColor)
void SetEmphasisMark(const FontEmphasisMark eValue)
void SetProportion(const sal_uInt8 nNewPropr)
std::optional< editeng::SvxBorderLine > m_aBottomBorder
void SetTopBorderDist(const sal_uInt16 nTopDist)
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
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 SetBackColor(std::optional< Color > xNewColor)
void SetOutline(const bool bOutline)
SwFont & operator=(const SwFont &rFont)
SvxShadowLocation m_aShadowLocation
const SvxFont & GetActualFont() const
sal_uInt16 m_nTopBorderDist
sal_uInt16 m_nShadowWidth
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
const std::optional< editeng::SvxBorderLine > & GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
const Color & GetUnderColor() const
SwFontScript GetActual() const
void SetRightBorderDist(const sal_uInt16 nRightDist)
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
void SetShadow(const bool bShadow)
sal_uInt16 m_nRightBorderDist
const std::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
sal_uInt16 m_nBottomBorderDist
void SetColor(const Color &rColor)
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
sal_uInt8 m_nContentControlCount
std::optional< editeng::SvxBorderLine > m_aRightBorder
LanguageType GetLanguage() const
void SetTransparent(const bool bTrans)
void SetAutoKern(FontKerning nAutoKern)
const std::optional< editeng::SvxBorderLine > & GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void SetOverColor(const Color &rColor)
void SetUnderline(const FontLineStyle eUnderline)
void SetCaseMap(const SvxCaseMap eNew)
void SetShadowColor(const Color &rColor)
void SetWordLineMode(const bool bWordLineMode)
void SetShadowWidth(const sal_uInt16 nWidth)
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetRelief(const FontRelief eNew)
sal_uInt8 m_nInputFieldCount
sal_uInt16 m_nLeftBorderDist
const std::optional< editeng::SvxBorderLine > & GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void SetFixKerning(const short nNewKern)
std::optional< editeng::SvxBorderLine > m_aTopBorder
const Color & GetOverColor() const
void SetActual(SwFontScript nNew)
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
bool IsRightToLeft() const
sal_Int16 ScriptType(const TextFrameIndex nPos) const
const void * m_nFontCacheId
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
Size GetTextSize_(SwDrawTextInfo &rInf)
void DrawCapital(SwDrawTextInfo &rInf)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Size GetCapitalSize(SwDrawTextInfo &rInf)
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
bool IsSymbol(SwViewShell const *pSh)
void SetUnderline(const FontLineStyle eUnderline)
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
void DrawStretchCapital(SwDrawTextInfo &rInf)
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
void DrawStretchText_(SwDrawTextInfo &rInf)
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.
const Point & GetPos() const
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDSTART
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxAutoKernItem > RES_CHRATR_AUTOKERN(17)
constexpr TypedWhichId< SvxShadowItem > RES_CHRATR_SHADOW(41)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxShadowedItem > RES_CHRATR_SHADOWED(13)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CTL_WEIGHT(31)
constexpr TypedWhichId< SvxContourItem > RES_CHRATR_CONTOUR(4)
constexpr TypedWhichId< SvxCharReliefItem > RES_CHRATR_RELIEF(36)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxEscapementItem > RES_CHRATR_ESCAPEMENT(6)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
constexpr OUStringLiteral CH_TXT_ATR_SUBST_FIELDEND
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CTL_POSTURE(30)
constexpr TypedWhichId< SvxEmphasisMarkItem > RES_CHRATR_EMPHASIS_MARK(33)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SvxOverlineItem > RES_CHRATR_OVERLINE(38)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
constexpr TypedWhichId< SvxWordLineModeItem > RES_CHRATR_WORDLINEMODE(16)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_CJK_WEIGHT(26)
constexpr TypedWhichId< SvxKerningItem > RES_CHRATR_KERNING(9)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxTwoLinesItem > RES_CHRATR_TWO_LINES(34)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_CJK_POSTURE(25)
constexpr TypedWhichId< SvxBoxItem > RES_CHRATR_BOX(40)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
#define CH_TXT_ATR_FIELDEND
#define CH_TXT_ATR_FIELDSTART
#define SAL_WARN(area, stream)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
#define SPACING_PRECISION_FACTOR
UNDERLYING_TYPE get() const
static Degree10 MapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
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.
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
const sal_Unicode CH_BLANK
constexpr sal_Int32 COMPLETE_STRING