19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
45 constexpr OUStringChar
CH_PAR =
u'\u00B6';
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 );
116 { m_nFontCacheId =
nullptr; m_nProportionalWidth = nNew; }
119 { m_nFontCacheId =
nullptr; m_nFontIndex = m_nOrgHeight = m_nOrgAscent = 0; m_nProportionalWidth =100; m_bSmallCapsPercentage66 =
false; }
129 #define SW_SCRIPTS (SwFontScript(int(SwFontScript::LAST)+1))
199 { rnFontCacheId = m_aSub[nWhich].m_nFontCacheId; rIdx = m_aSub[nWhich].m_nFontIndex; }
201 { m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId; m_aSub[nWhich].m_nFontIndex = nIdx; }
203 {
return m_aSub[nWhich].m_nFontCacheId != pFnt->
m_aSub[nWhich].m_nFontCacheId ||
204 !m_aSub[nWhich].m_nFontCacheId || !pFnt->
m_aSub[nWhich].m_nFontCacheId; }
207 {
return m_aSub[nWhich].m_aSize; }
220 inline void SetOutline(
const bool bOutline );
222 const bool bVertLayoutLRBT =
false);
223 inline void SetShadow(
const bool bShadow );
250 bool IsTox()
const {
return ( 0 != m_nToxCount ); }
252 bool IsRef()
const {
return ( 0 != m_nRefCount ); }
254 bool IsMeta()
const {
return (0 != m_nMetaCount); }
268 {
return m_aSub[nWhich]; };
271 {
return m_aSub[
m_nActual].IsSymbol( pSh ); }
287 {
return m_aSub[
m_nActual].GetEmphasisMark(); }
289 const bool bVertFormatLRBT =
false)
const;
292 {
return m_aSub[nWhich].GetFamilyName(); }
294 {
return m_aSub[nWhich].GetLanguage(); }
296 {
return m_aSub[nWhich].GetCharSet(); }
298 {
return m_aSub[nWhich].GetFontSize().Height(); }
308 { m_aSub[
m_nActual].DoOnCapitals( rDo ); }
316 {
return m_aSub[
m_nActual].GetModelPositionForViewPoint_( rInf ); }
322 { m_aSub[
m_nActual].DrawStretchText_( rInf ); }
325 {
return m_aSub[
m_nActual].CheckKerning(); }
328 {
return m_aSub[
m_nActual].GetAscent( pSh, rOut ); }
330 {
return m_aSub[
m_nActual].GetHeight( pSh, rOut ); }
349 const std::optional<editeng::SvxBorderLine>&
350 GetAbsTopBorder(
const bool bVertLayout,
const bool bVertLayoutLRBT)
const;
351 const std::optional<editeng::SvxBorderLine>&
353 const std::optional<editeng::SvxBorderLine>&
355 const std::optional<editeng::SvxBorderLine>&
395 const bool bVertLayoutLRBT)
const;
412 const SvxShadowItemSide nShadow,
const bool bVertLayout,
const bool bVertLayoutLRBT,
413 const bool bSkipLeft,
const bool bSkipRight )
const;
430 Font::SetColor( rColor );
437 Font::SetFillColor( rColor );
452 Font::SetFamily( eFamily );
458 m_aSub[nWhich].SetFamily( eFamily );
465 Font::SetFamilyName( rName );
471 m_aSub[nWhich].SetName( rName );
478 Font::SetStyleName( rStyleName );
484 m_aSub[nWhich].SetStyleName( rStyle );
491 Font::SetCharSet( eCharSet );
497 m_aSub[nWhich].SetCharSet( eCharSet );
504 Font::SetPitch( ePitch );
511 m_aSub[nWhich].SetPitch( ePitch );
518 Font::SetAlignment( eAlign );
533 Font::SetWeight( eWeight );
539 m_aSub[nWhich].SetWeight( eWeight );
546 Font::SetUnderline( eUnderline );
561 Font::SetOverline( eOverline );
576 Font::SetStrikeout( eStrikeout );
591 Font::SetItalic( eItalic );
597 m_aSub[nWhich].SetItalic( eItalic );
604 Font::SetOutline( bOutline );
619 Font::SetShadow( bShadow );
634 Font::SetKerning( nAutoKern );
641 if( nAutoKern != FontKerning::NONE )
642 nAutoKern = FontKerning::FontSpecific;
672 Font::SetWordLineMode( bWordLineMode );
686 Font::SetEmphasisMark( eValue );
712 Font::SetRelief( eNew );
734 Font::SetFontSize(
Size(
745 m_aSub[nWhich].SetSize( rSize );
813 m_aSub[nWhich].SetLanguage( eNewLang );
830 Font::SetVertical( bVertFormat );
831 Font::SetOrientation( nDir );
971 OSL_ENSURE( m_pFont,
"No underline font" );
977 void SetPos(
const Point& rPoint ) { m_aPos = rPoint; }
992 { nGetTextSize = nDrawText = nGetStretchTextSize = nDrawStretchText = nChangeFont = 0; }
998 #define SV_STAT(nWhich) ++(g_SvStat.nWhich);
1002 #define SV_STAT(nWhich)
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
rtl_TextEncoding GetCharSet(const SwFontScript nWhich) const
const sal_Unicode CH_BREAK
void SetPropr(const sal_uInt8 nNewPropr)
sal_uInt16 GetLeftBorderSpace() const
sal_uInt16 GetShadowWidth() const
const std::optional< editeng::SvxBorderLine > & GetBottomBorder() const
sal_uInt8 GetPropr() const
void SetFamily(const FontFamily eFamily)
const sal_Unicode CH_NB_SPACE
void SetWordLineMode(const bool bWordLineMode)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
bool m_bSmallCapsPercentage66
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
void SetName(const OUString &rName)
const Color & GetUnderColor() const
bool IsInputField() const
sal_uInt8 GetPropr() const
std::optional< editeng::SvxBorderLine > m_aTopBorder
sal_uInt16 GetTopBorderDist() const
sal_uInt16 GetRightBorderSpace() const
void SetFillColor(const Color &rColor)
constexpr OUStringChar CH_PAR
void SetFillColor(const Color &rColor)
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
void SetGreyWave(const bool bNew)
void SetUnderline(const FontLineStyle eUnderline)
Size GetTextSize_(SwDrawTextInfo &rInf)
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
const std::optional< editeng::SvxBorderLine > & GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
const SvxFont & GetActualFont() const
void SetEmphasisMark(const FontEmphasisMark eValue)
void SetSize(const Size &rSize)
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
void SetVertical(const Degree10 nDir, const bool bVertFormat)
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
bool HasBorder() const
Check whether font has any border on any side.
const sal_Unicode CH_BULLET
bool IsSymbol(SwViewShell const *pSh)
void SetAlign(const TextAlign eAlign)
sal_uInt8 m_nContentControlCount
const Size & GetSize(SwFontScript nWhich) const
FontStrikeout GetStrikeout() const
void SetOutline(const bool bOutline)
void SetPropWidth(const sal_uInt16 nNew)
void dumpAsXml(xmlTextWriterPtr writer) const
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
sal_uInt16 m_nLeftBorderDist
void DrawText_(SwDrawTextInfo &rInf)
void DrawCapital(SwDrawTextInfo &rInf)
void SetColor(const Color &rColor)
constexpr tools::Long Width() const
void SetShadow(const bool bShadow)
sal_uInt16 m_nShadowWidth
sal_uInt16 m_nRightBorderDist
void SetPitch(const FontPitch ePitch)
const Color & GetOverColor() const
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
sal_uInt16 GetRightBorderDist() const
void SetFntChg(const bool bNew)
void DrawStretchText_(SwDrawTextInfo &rInf)
SvxCaseMap GetCaseMap() const
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
void SetShadowColor(const Color &rColor)
void SetUnderline(const FontLineStyle eUnderline)
void SetShadowLocation(const SvxShadowLocation aLocation)
const std::optional< editeng::SvxBorderLine > & GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
FontEmphasisMark GetEmphasisMark() const
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
const std::optional< Color > & GetBackColor() const
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
void SetStrikeout(const FontStrikeout eStrikeout)
void SetLanguage(LanguageType eNewLang)
sal_uInt16 m_nProportionalWidth
void SetItalic(const FontItalic eItalic)
SwFontScript GetActual() const
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
const std::optional< editeng::SvxBorderLine > & GetRightBorder() const
std::optional< editeng::SvxBorderLine > m_aLeftBorder
void SetOverline(const FontLineStyle eOverline)
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
void SetTransparent(const bool bTrans)
void SetCharSet(const rtl_TextEncoding eCharSet)
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
std::optional< editeng::SvxBorderLine > m_aBottomBorder
void SetWordLineMode(const bool bWordLineMode)
sal_uInt8 m_nInputFieldCount
void SetEscapement(const short nNewEsc)
void SetUnderColor(const Color &rColor)
void SetRightBorderDist(const sal_uInt16 nRightDist)
const sal_Unicode CH_FULL_BLANK
void SetShadowWidth(const sal_uInt16 nWidth)
const Point & GetPos() const
void DrawStretchCapital(SwDrawTextInfo &rInf)
void SetCaseMap(const SvxCaseMap eNew)
void CheckFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
const std::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
Size GetCapitalSize(SwDrawTextInfo &rInf)
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
sal_uInt16 GetBottomBorderDist() const
FontLineStyle GetOverline() const
const sal_Unicode CH_BLANK
TextFrameIndex GetCapitalBreak(SwViewShell const *pSh, const OutputDevice *pOut, const SwScriptInfo *pScript, const OUString &rText, tools::Long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen)
sal_uInt16 GetHangingBaseline(SwViewShell const *pSh, const OutputDevice &rOut)
sal_uInt16 GetTopBorderSpace() const
TextFrameIndex GetEnd() const
sal_uInt16 GetPropWidth() const
void SetRelief(const FontRelief eNew)
void SetProportion(const sal_uInt8 nNewPropr)
void SetShadow(const bool bShadow)
sal_uInt8 & GetContentControl()
void SetEscapement(const short nNewEsc)
Provides access to settings of a document.
void DrawStretchText_(SwDrawTextInfo &rInf)
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
const Color & GetColor() const
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
void DoOnCapitals(SwDoCapitals &rDo)
void SetPos(const Point &rPoint)
void SetAutoKern(FontKerning nAutoKern)
void SetOverColor(const Color &rColor)
void SetPropWidth(const sal_uInt16 nNew)
bool IsPaintBlank() const
std::optional< Color > mxBackColor
sal_uInt16 m_nBottomBorderDist
void SetFixKerning(const short nNewKern)
sal_uInt16 nGetStretchTextSize
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...
FontLineStyle GetUnderline() const
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
sal_uInt16 GetLeftBorderDist() const
void SetOutline(const bool bOutline)
Size GetTextSize_(SwDrawTextInfo &rInf)
SwFont & operator=(const SwFont &rFont)
const OUString & GetName(const SwFontScript nWhich) const
std::unique_ptr< SwFont > m_pFont
void SetStyleName(const OUString &rStyleName)
FontWeight GetWeight() const
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
bool IsSymbol(SwViewShell const *pSh)
LanguageType GetLanguage() const
void DoOnCapitals(SwDoCapitals &rDo)
const void * m_nFontCacheId
void SetRelief(const FontRelief eNew)
sal_uInt8 & GetInputField()
void SetBackColor(std::optional< Color > xNewColor)
void SetAlign(const TextAlign eAlign)
constexpr tools::Long Height() const
void SetSize(const Size &rSize, const SwFontScript nWhich)
void SetFontCacheId(const void *nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich)
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
SvxShadowLocation GetShadowLocation() const
FontItalic GetItalic() const
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
void SetActual(SwFontScript nNew)
LanguageType GetAppLanguage()
std::optional< editeng::SvxBorderLine > m_aRightBorder
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
sal_uInt16 GetBottomBorderSpace() const
void SetWeight(const FontWeight eWeight)
const Color & GetHighlightColor() const
const Color & GetShadowColor() const
sal_uInt16 nDrawStretchText
void SetName(const OUString &rName, const SwFontScript nWhich)
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
const std::optional< editeng::SvxBorderLine > & GetTopBorder() const
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
bool IsContentControl() const
short GetFixKerning() const
struct _xmlTextWriter * xmlTextWriterPtr
void SetAutoKern(FontKerning nAutoKern)
void SetFont(SwFont *pNew)
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
SvxShadowLocation m_aShadowLocation
LanguageType GetLanguage(const SwFontScript nWhich) const
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
sal_uInt16 m_nTopBorderDist
bool IsWordLineMode() const
const std::optional< editeng::SvxBorderLine > & GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
void SetEmphasisMark(const FontEmphasisMark eValue)
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)
void SetStrikeout(const FontStrikeout eStrikeout)
short GetEscapement() const
void SetEscapement(const short nNewEsc)
void SetOverline(const FontLineStyle eOverline)
tools::Long GetHeight() const
void SetTopBorderDist(const sal_uInt16 nTopDist)
const SvxFont & GetFnt(const SwFontScript nWhich) const
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
tools::Long GetHeight(const SwFontScript nWhich) const
void SetColor(const Color &rColor)
const sal_Unicode CH_SIX_PER_EM
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)