19#ifndef INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
64 sal_uInt16
CalcEscAscent(
const sal_uInt16 nOldAscent )
const;
66 const sal_uInt16 nOldAscent )
const;
88 inline void SetCharSet(
const rtl_TextEncoding eCharSet );
97 inline void SetShadow(
const bool bShadow );
108 inline void SetName(
const OUString& rName );
114 {
return GetFixKerning() >= 0 ? GetFixKerning() :
CheckKerning_( ); }
129#define SW_SCRIPTS (SwFontScript(int(SwFontScript::LAST)+1))
202 { rnFontCacheId =
m_aSub[nWhich].m_nFontCacheId; rIdx =
m_aSub[nWhich].m_nFontIndex; }
204 {
m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId;
m_aSub[nWhich].m_nFontIndex = nIdx; }
206 {
return m_aSub[nWhich].m_nFontCacheId != pFnt->
m_aSub[nWhich].m_nFontCacheId ||
207 !
m_aSub[nWhich].m_nFontCacheId || !pFnt->
m_aSub[nWhich].m_nFontCacheId; }
210 {
return m_aSub[nWhich].m_aSize; }
223 inline void SetOutline(
const bool bOutline );
225 const bool bVertLayoutLRBT =
false);
226 inline void SetShadow(
const bool bShadow );
271 {
return m_aSub[nWhich]; };
292 const bool bVertFormatLRBT =
false)
const;
295 {
return m_aSub[nWhich].GetFamilyName(); }
297 {
return m_aSub[nWhich].GetLanguage(); }
299 {
return m_aSub[nWhich].GetCharSet(); }
301 {
return m_aSub[nWhich].GetFontSize().Height(); }
352 const std::optional<editeng::SvxBorderLine>&
353 GetAbsTopBorder(
const bool bVertLayout,
const bool bVertLayoutLRBT)
const;
354 const std::optional<editeng::SvxBorderLine>&
356 const std::optional<editeng::SvxBorderLine>&
358 const std::optional<editeng::SvxBorderLine>&
398 const bool bVertLayoutLRBT)
const;
415 const SvxShadowItemSide nShadow,
const bool bVertLayout,
const bool bVertLayoutLRBT,
416 const bool bSkipLeft,
const bool bSkipRight )
const;
433 Font::SetColor( rColor );
440 Font::SetFillColor( rColor );
455 Font::SetFamily( eFamily );
461 m_aSub[nWhich].SetFamily( eFamily );
468 Font::SetFamilyName( rName );
474 m_aSub[nWhich].SetName( rName );
481 Font::SetStyleName( rStyleName );
487 m_aSub[nWhich].SetStyleName( rStyle );
494 Font::SetCharSet( eCharSet );
500 m_aSub[nWhich].SetCharSet( eCharSet );
507 Font::SetPitch( ePitch );
514 m_aSub[nWhich].SetPitch( ePitch );
521 Font::SetAlignment( eAlign );
536 Font::SetWeight( eWeight );
542 m_aSub[nWhich].SetWeight( eWeight );
549 Font::SetUnderline( eUnderline );
564 Font::SetOverline( eOverline );
579 Font::SetStrikeout( eStrikeout );
594 Font::SetItalic( eItalic );
600 m_aSub[nWhich].SetItalic( eItalic );
607 Font::SetOutline( bOutline );
622 Font::SetShadow( bShadow );
637 Font::SetKerning( nAutoKern );
644 if( nAutoKern != FontKerning::NONE )
645 nAutoKern = FontKerning::FontSpecific;
675 Font::SetWordLineMode( bWordLineMode );
689 Font::SetEmphasisMark( eValue );
715 Font::SetRelief( eNew );
737 Font::SetFontSize(
Size(
748 m_aSub[nWhich].SetSize( rSize );
816 m_aSub[nWhich].SetLanguage( eNewLang );
833 Font::SetVertical( bVertFormat );
834 Font::SetOrientation( nDir );
974 OSL_ENSURE(
m_pFont,
"No underline font" );
1001#define SV_STAT(nWhich) ++(g_SvStat.nWhich);
1005#define SV_STAT(nWhich)
Provides access to settings of a document.
constexpr tools::Long Height() const
constexpr tools::Long Width() const
sal_uInt16 nGetStretchTextSize
sal_uInt16 nDrawStretchText
sal_uInt8 GetPropr() const
void SetPropr(const sal_uInt8 nNewPropr)
void SetEscapement(const short nNewEsc)
void SetFont(SwFont *pNew)
To take Asian or other languages into consideration, an SwFont object consists of 3 SwSubFonts (Latin...
rtl_TextEncoding GetCharSet(const SwFontScript nWhich) const
void DrawStretchText_(SwDrawTextInfo &rInf)
void SetOverline(const FontLineStyle eOverline)
const OUString & GetName(const SwFontScript nWhich) const
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
bool IsInputField() const
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetPropWidth(const sal_uInt16 nNew)
const std::optional< Color > & GetBackColor() const
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
void SetGreyWave(const bool bNew)
void DrawText_(SwDrawTextInfo &rInf)
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
FontItalic GetItalic() const
sal_uInt16 GetBottomBorderSpace() const
sal_uInt16 GetTopBorderSpace() const
std::optional< Color > mxBackColor
void dumpAsXml(xmlTextWriterPtr writer) const
void SetShadowLocation(const SvxShadowLocation aLocation)
std::optional< editeng::SvxBorderLine > m_aLeftBorder
const std::optional< editeng::SvxBorderLine > & GetTopBorder() const
void SetStrikeout(const FontStrikeout eStrikeout)
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
void SetHighlightColor(const Color &aNewColor)
const std::optional< editeng::SvxBorderLine > & GetRightBorder() const
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)
sal_uInt16 GetBottomBorderDist() const
const Size & GetSize(SwFontScript nWhich) const
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
FontLineStyle GetUnderline() const
short GetEscapement() 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)
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
sal_uInt16 GetRightBorderSpace() const
void SetAlign(const TextAlign eAlign)
sal_uInt16 GetShadowWidth() const
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
void SetUnderColor(const Color &rColor)
const Color & GetShadowColor() const
void SetEmphasisMark(const FontEmphasisMark eValue)
void SetName(const OUString &rName, const SwFontScript nWhich)
Size GetTextSize_(SwDrawTextInfo &rInf)
void SetProportion(const sal_uInt8 nNewPropr)
std::optional< editeng::SvxBorderLine > m_aBottomBorder
const std::optional< editeng::SvxBorderLine > & GetBottomBorder() const
FontStrikeout GetStrikeout() const
void SetTopBorderDist(const sal_uInt16 nTopDist)
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
FontEmphasisMark GetEmphasisMark() const
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)
void SetFntChg(const bool bNew)
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 SetSize(const Size &rSize, const SwFontScript nWhich)
void SetBackColor(std::optional< Color > xNewColor)
void SetOutline(const bool bOutline)
SwFont & operator=(const SwFont &rFont)
SvxShadowLocation m_aShadowLocation
const SvxFont & GetActualFont() const
sal_uInt8 & GetContentControl()
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
void SetFillColor(const Color &rColor)
void SetFontCacheId(const void *nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich)
sal_uInt8 & GetInputField()
sal_uInt16 GetTopBorderDist() const
void DoOnCapitals(SwDoCapitals &rDo)
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
const Color & GetUnderColor() const
SwFontScript GetActual() const
FontLineStyle GetOverline() const
void SetRightBorderDist(const sal_uInt16 nRightDist)
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
void SetShadow(const bool bShadow)
sal_uInt16 m_nRightBorderDist
sal_uInt8 GetPropr() const
const std::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
SvxCaseMap GetCaseMap() const
bool IsContentControl() const
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
bool IsWordLineMode() const
sal_uInt16 GetRightBorderDist() const
sal_uInt16 m_nBottomBorderDist
void CheckFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
FontWeight GetWeight() const
void SetColor(const Color &rColor)
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
const Color & GetColor() const
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
bool IsSymbol(SwViewShell const *pSh)
sal_uInt8 m_nContentControlCount
tools::Long GetHeight(const SwFontScript nWhich) const
bool IsPaintBlank() const
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
LanguageType GetLanguage(const SwFontScript nWhich) const
void SetOverColor(const Color &rColor)
void SetUnderline(const FontLineStyle eUnderline)
SvxShadowLocation GetShadowLocation() const
void SetCaseMap(const SvxCaseMap eNew)
void SetShadowColor(const Color &rColor)
void SetWordLineMode(const bool bWordLineMode)
const SvxFont & GetFnt(const SwFontScript nWhich) const
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
sal_uInt16 GetLeftBorderDist() const
bool HasBorder() const
Check whether font has any border on any side.
void SetShadowWidth(const sal_uInt16 nWidth)
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
void SetRelief(const FontRelief eNew)
sal_uInt8 m_nInputFieldCount
sal_uInt16 m_nLeftBorderDist
tools::Long GetHeight() const
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
sal_uInt16 GetLeftBorderSpace() const
void SetActual(SwFontScript nNew)
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
const Color & GetHighlightColor() const
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
const void * m_nFontCacheId
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
void SetEscapement(const short nNewEsc)
void SetAutoKern(FontKerning nAutoKern)
sal_uInt16 m_nProportionalWidth
sal_uInt16 GetPropWidth() const
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
void SetProportion(const sal_uInt8 nNewPropr)
void SetOutline(const bool bOutline)
Size GetTextSize_(SwDrawTextInfo &rInf)
void SetItalic(const FontItalic eItalic)
void DoOnCapitals(SwDoCapitals &rDo)
void SetLanguage(LanguageType eNewLang)
void SetRelief(const FontRelief eNew)
void DrawCapital(SwDrawTextInfo &rInf)
void SetAlign(const TextAlign eAlign)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Size GetCapitalSize(SwDrawTextInfo &rInf)
void SetSize(const Size &rSize)
bool m_bSmallCapsPercentage66
void SetOverline(const FontLineStyle eOverline)
void SetStyleName(const OUString &rStyleName)
void SetCharSet(const rtl_TextEncoding eCharSet)
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
void SetWeight(const FontWeight eWeight)
bool IsSymbol(SwViewShell const *pSh)
void SetUnderline(const FontLineStyle eUnderline)
void SetPitch(const FontPitch ePitch)
void SetStrikeout(const FontStrikeout eStrikeout)
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
void SetFamily(const FontFamily eFamily)
void DrawStretchCapital(SwDrawTextInfo &rInf)
void SetName(const OUString &rName)
void SetColor(const Color &rColor)
void SetVertical(const Degree10 nDir, const bool bVertFormat)
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
void SetEmphasisMark(const FontEmphasisMark eValue)
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
void SetShadow(const bool bShadow)
void SetWordLineMode(const bool bWordLineMode)
void DrawStretchText_(SwDrawTextInfo &rInf)
void SetFillColor(const Color &rColor)
void SetPropWidth(const sal_uInt16 nNew)
std::unique_ptr< SwFont > m_pFont
void SetPos(const Point &rPoint)
TextFrameIndex GetEnd() const
const Point & GetPos() const
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
struct _xmlTextWriter * xmlTextWriterPtr
LanguageType GetAppLanguage()
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
constexpr OUStringChar CH_PAR
const sal_Unicode CH_BREAK
const sal_Unicode CH_NB_SPACE
const sal_Unicode CH_SIX_PER_EM
const sal_Unicode CH_BLANK
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
const sal_Unicode CH_FULL_BLANK
const sal_Unicode CH_BULLET