LibreOffice Module sw (master)  1
swfont.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_SWFONT_HXX
21 
22 #include <memory>
23 #include <i18nlangtag/lang.h>
24 #include <tools/color.hxx>
25 #include <tools/gen.hxx>
26 #include <svl/poolitem.hxx>
27 #include <editeng/svxfont.hxx>
28 #include <swtypes.hxx>
29 #include "drawfont.hxx"
30 #include <editeng/borderline.hxx>
31 #include <optional>
32 #include <o3tl/enumarray.hxx>
33 
34 class SfxItemSet;
35 class SwAttrSet;
36 class SwDoCapitals; // DoCapitals
37 class SwScriptInfo; // GetTextSize_
38 class SwViewShell;
40 enum class SvxShadowItemSide;
41 
42 const sal_Unicode CH_BLANK = ' '; // ' ' blank spaces
43 const sal_Unicode CH_BREAK = 0x0A;
44 const sal_Unicode CH_TAB = '\t'; // \t
45 constexpr OUStringChar CH_PAR = u'\u00B6'; // paragraph
46 const sal_Unicode CH_BULLET = 0xB7; // centered dot
47 const sal_Unicode CH_FULL_BLANK = 0x3000;
48 const sal_Unicode CH_NB_SPACE = 0xA0;
49 const sal_Unicode CH_SIX_PER_EM = 0x2006; // six-per-em space
50 
51 Degree10 UnMapDirection( Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT );
52 
53 class SwSubFont : public SvxFont
54 {
55  friend class SwFont;
56  const void* m_nFontCacheId; // "MagicNumber" within the font cache
57  Size m_aSize; // foreigners only see this size
58  sal_uInt16 m_nFontIndex; // index in the font cache
59  sal_uInt16 m_nOrgHeight; // height including escapement/proportion
60  sal_uInt16 m_nOrgAscent; // ascent including escapement/proportion
61  sal_uInt16 m_nProportionalWidth; // proportional width
63 
64  sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const;
65  sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight,
66  const sal_uInt16 nOldAscent ) const;
67  void CalcEsc( SwDrawTextInfo const & rInf, Point& rPos );
68 
69  short CheckKerning_( );
70 
71  bool ChgFnt( SwViewShell const *pSh, OutputDevice& rOut );
72  bool IsSymbol( SwViewShell const *pSh );
73  sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut );
74  sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut );
77  void DrawText_( SwDrawTextInfo &rInf, const bool bGrey );
78  void DrawCapital( SwDrawTextInfo &rInf );
79  void DrawStretchCapital( SwDrawTextInfo &rInf );
80  void DoOnCapitals( SwDoCapitals &rDo );
81  void DrawStretchText_( SwDrawTextInfo &rInf );
84 
85  inline void SetColor( const Color& rColor );
86  inline void SetFillColor( const Color& rColor );
87  inline void SetCharSet( const rtl_TextEncoding eCharSet );
88  inline void SetPitch( const FontPitch ePitch );
89  inline void SetAlign( const FontAlign eAlign );
90  inline void SetUnderline( const FontLineStyle eUnderline );
91  inline void SetOverline( const FontLineStyle eOverline );
92  inline void SetStrikeout( const FontStrikeout eStrikeout );
93  inline void SetItalic( const FontItalic eItalic );
94  inline void SetOutline( const bool bOutline );
95  inline void SetVertical( const Degree10 nDir, const bool bVertFormat );
96  inline void SetShadow( const bool bShadow );
97  inline void SetAutoKern( FontKerning nAutoKern );
98  inline void SetWordLineMode( const bool bWordLineMode );
99  inline void SetEmphasisMark( const FontEmphasisMark eValue );
100  inline void SetRelief( const FontRelief eNew );
101 
102  // methods for sub-/superscript
103  inline void SetEscapement( const short nNewEsc );
104  inline void SetProportion( const sal_uInt8 nNewPropr );
105 
106  inline void SetFamily( const FontFamily eFamily );
107  inline void SetName( const OUString& rName );
108  inline void SetStyleName( const OUString& rStyleName );
109  inline void SetSize( const Size& rSize );
110  inline void SetWeight( const FontWeight eWeight );
111  inline void SetLanguage( LanguageType eNewLang );
112  short CheckKerning()
113  { return GetFixKerning() >= 0 ? GetFixKerning() : CheckKerning_( ); }
114  void SetPropWidth( const sal_uInt16 nNew )
115  { m_nFontCacheId = nullptr; m_nProportionalWidth = nNew; }
116 public:
117  SwSubFont() : m_aSize(0,0)
118  { m_nFontCacheId = nullptr; m_nFontIndex = m_nOrgHeight = m_nOrgAscent = 0; m_nProportionalWidth =100; m_bSmallCapsPercentage66 = false; }
119  sal_uInt16 GetPropWidth() const { return m_nProportionalWidth; }
120 };
121 
122 enum class SwFontScript
123 {
124  Latin, CJK, CTL, LAST = CTL
125 };
126 
127 // mostly used as a "unknown script" marker
128 #define SW_SCRIPTS (SwFontScript(int(SwFontScript::LAST)+1))
129 
130 class SwFont
131 {
132  // CJK == Chinese, Japanese, Korean
133  // CTL == Complex text layout ( Hebrew, Arabic )
134  o3tl::enumarray<SwFontScript, SwSubFont> m_aSub; // Latin-, CJK- and CTL-font
135 
136  std::unique_ptr<Color>
137  m_pBackColor; // background color (i.e. at character styles)
138  Color m_aHighlightColor; // highlight color
139  Color m_aUnderColor; // color of the underlining
140  Color m_aOverColor; // color of the overlining
141 
142  // character borders
143  std::optional<editeng::SvxBorderLine> m_aTopBorder;
144  std::optional<editeng::SvxBorderLine> m_aBottomBorder;
145  std::optional<editeng::SvxBorderLine> m_aRightBorder;
146  std::optional<editeng::SvxBorderLine> m_aLeftBorder;
147 
148  // border distance
149  sal_uInt16 m_nTopBorderDist;
151  sal_uInt16 m_nRightBorderDist;
152  sal_uInt16 m_nLeftBorderDist;
153 
155  sal_uInt16 m_nShadowWidth;
157 
158  sal_uInt8 m_nToxCount; // counts the nesting depth of the Tox
159  sal_uInt8 m_nRefCount; // counts the nesting depth of the Refs
160  sal_uInt8 m_nMetaCount; // count META/METAFIELD
161  sal_uInt8 m_nInputFieldCount; // count INPUTFIELD
162 
163  SwFontScript m_nActual; // actual font (Latin, CJK or CTL)
164 
165  // switch for the font-extensions
166  bool m_bPaintBlank :1; // blanks not with DrawRect
167  bool m_bFontChg :1;
168  bool m_bOrgChg :1; // nOrgHeight/Ascent are invalid
169  bool m_bGreyWave :1; // for the extended TextInput: gray waveline
170 
171 public:
172  SwFont( const SwAttrSet* pSet, const IDocumentSettingAccess* pIDocumentSettingAccess );
173  SwFont( const SwFont& rFont );
174 
175  void ChgFnt( SwViewShell const *pSh, OutputDevice& rOut )
176  { m_bPaintBlank = m_aSub[m_nActual].ChgFnt( pSh, rOut ); }
177 
178  ~SwFont();
179 
180  SwFont& operator=( const SwFont &rFont );
181 
182  SwFontScript GetActual() const { return m_nActual; }
183  inline void SetActual( SwFontScript nNew );
184  const SvxFont& GetActualFont() const { return m_aSub[m_nActual]; }
185 
186  // gets a font cache id via SwFntAccess
187  void AllocFontCacheId( SwViewShell const *pSh, SwFontScript nWhich );
188  // set background color
189  void SetBackColor( Color* pNewColor );
190  const Color* GetBackColor() const{ return m_pBackColor.get(); }
191  void SetHighlightColor( const Color& aNewColor );
192  const Color& GetHighlightColor() const { return m_aHighlightColor; }
193 
194  void CheckFontCacheId( SwViewShell const *pSh, SwFontScript nWhich )
195  { if( !m_aSub[ nWhich ].m_nFontCacheId ) AllocFontCacheId( pSh, nWhich ); }
196  void GetFontCacheId( const void* &rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich )
197  { rnFontCacheId = m_aSub[nWhich].m_nFontCacheId; rIdx = m_aSub[nWhich].m_nFontIndex; }
198  void SetFontCacheId( const void* nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich )
199  { m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId; m_aSub[nWhich].m_nFontIndex = nIdx; }
200  bool DifferentFontCacheId( const SwFont* pFnt, SwFontScript nWhich )
201  { return m_aSub[nWhich].m_nFontCacheId != pFnt->m_aSub[nWhich].m_nFontCacheId ||
202  !m_aSub[nWhich].m_nFontCacheId || !pFnt->m_aSub[nWhich].m_nFontCacheId; }
203 
204  const Size &GetSize( SwFontScript nWhich ) const
205  { return m_aSub[nWhich].m_aSize; }
206  bool IsFntChg() const { return m_bFontChg; }
207  void SetFntChg( const bool bNew ) { m_bFontChg = bNew; }
208 
209  // the encapsulated SV-Font-methods (set bFntChg to true)
210  inline void SetColor( const Color& rColor );
211  inline void SetFillColor( const Color& rColor );
212  inline void SetAlign( const FontAlign eAlign );
213  inline void SetUnderline( const FontLineStyle eUnderline );
214  void SetUnderColor( const Color &rColor ) { m_aUnderColor = rColor; }
215  inline void SetOverline( const FontLineStyle eOverline );
216  void SetOverColor( const Color &rColor ) { m_aOverColor = rColor; }
217  inline void SetStrikeout( const FontStrikeout eStrikeout );
218  inline void SetOutline( const bool bOutline );
219  void SetVertical(Degree10 nDir, const bool bVertLayout = false,
220  const bool bVertLayoutLRBT = false);
221  inline void SetShadow( const bool bShadow );
222  inline void SetAutoKern( FontKerning nAutoKern );
223  inline void SetTransparent( const bool bTrans );
224  inline void SetWordLineMode( const bool bWordLineMode );
225  inline void SetFixKerning( const short nNewKern );
226  inline void SetCaseMap( const SvxCaseMap eNew );
227  inline void SetEmphasisMark( const FontEmphasisMark eValue );
228 
229  // methods for sub-/superscript
230  inline void SetEscapement( const short nNewEsc );
231  inline void SetProportion( const sal_uInt8 nNewPropr );
232 
233  inline void SetPropWidth( const sal_uInt16 nNew );
234 
235  inline void SetFamily( const FontFamily eFamily, const SwFontScript nWhich );
236  inline void SetName( const OUString& rName, const SwFontScript nWhich );
237  inline void SetStyleName( const OUString& rStyleName, const SwFontScript nWhich );
238  inline void SetSize( const Size& rSize, const SwFontScript nWhich );
239  inline void SetWeight( const FontWeight eWeight, const SwFontScript nWhich );
240  inline void SetItalic( const FontItalic eItalic, const SwFontScript nWhich );
241  inline void SetLanguage( LanguageType eNewLang, const SwFontScript nWhich );
242  inline void SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScript nWhich );
243  inline void SetPitch( const FontPitch ePitch, const SwFontScript nWhich );
244  inline void SetRelief( const FontRelief eNew );
245 
246  // Get/Set-methods for the current setting
247  sal_uInt8 &GetTox() { return m_nToxCount; }
248  bool IsTox() const { return ( 0 != m_nToxCount ); }
249  sal_uInt8 &GetRef() { return m_nRefCount; }
250  bool IsRef() const { return ( 0 != m_nRefCount ); }
252  bool IsMeta() const { return (0 != m_nMetaCount); }
254  bool IsInputField() const { return (0 != m_nInputFieldCount); }
255  inline void SetGreyWave( const bool bNew );
256  bool IsGreyWave() const { return m_bGreyWave; }
257  bool IsPaintBlank() const { return m_bPaintBlank; }
258 
259  // setting of the base class font for SwTextCharFormat
260  void SetDiffFnt( const SfxItemSet* pSet,
261  const IDocumentSettingAccess* pIDocumentSettingAccess );
262 
263  const SvxFont &GetFnt( const SwFontScript nWhich ) const
264  { return m_aSub[nWhich]; };
265 
266  bool IsSymbol( SwViewShell const *pSh )
267  { return m_aSub[m_nActual].IsSymbol( pSh ); }
268  FontLineStyle GetUnderline() const { return m_aSub[m_nActual].GetUnderline(); }
269  const Color& GetUnderColor() const { return m_aUnderColor; }
270  FontLineStyle GetOverline() const { return m_aSub[m_nActual].GetOverline(); }
271  const Color& GetOverColor() const { return m_aOverColor; }
272  FontStrikeout GetStrikeout() const { return m_aSub[m_nActual].GetStrikeout(); }
273  const Color& GetColor() const { return m_aSub[m_nActual].GetColor(); }
274  bool IsWordLineMode() const { return m_aSub[m_nActual].IsWordLineMode(); }
275  short GetEscapement() const { return m_aSub[m_nActual].GetEscapement(); }
276  SvxCaseMap GetCaseMap() const { return m_aSub[m_nActual].GetCaseMap(); }
277  sal_uInt8 GetPropr() const { return m_aSub[m_nActual].GetPropr(); }
278  FontItalic GetItalic() const { return m_aSub[m_nActual].GetItalic(); }
279  LanguageType GetLanguage() const { return m_aSub[m_nActual].GetLanguage(); }
280  tools::Long GetHeight() const { return m_aSub[m_nActual].GetFontSize().Height(); }
281  FontWeight GetWeight() const { return m_aSub[m_nActual].GetWeight(); }
283  { return m_aSub[m_nActual].GetEmphasisMark(); }
284  Degree10 GetOrientation(const bool bVertLayout = false,
285  const bool bVertFormatLRBT = false) const;
286 
287  const OUString& GetName( const SwFontScript nWhich ) const
288  { return m_aSub[nWhich].GetFamilyName(); }
289  LanguageType GetLanguage( const SwFontScript nWhich ) const
290  { return m_aSub[nWhich].GetLanguage(); }
291  rtl_TextEncoding GetCharSet( const SwFontScript nWhich ) const
292  { return m_aSub[nWhich].GetCharSet(); }
293  tools::Long GetHeight( const SwFontScript nWhich ) const
294  { return m_aSub[nWhich].GetFontSize().Height(); }
295 
296  // makes the logical font be effective in the OutputDevice
297  void ChgPhysFnt( SwViewShell const *pSh, OutputDevice& rOut );
298 
299  TextFrameIndex GetCapitalBreak( SwViewShell const* pSh, const OutputDevice* pOut,
300  const SwScriptInfo* pScript, const OUString& rText,
301  tools::Long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen);
302 
304  { m_aSub[m_nActual].DoOnCapitals( rDo ); }
305 
307  { rInf.SetFont( this ); return m_aSub[m_nActual].GetTextSize_( rInf ); }
308 
309  TextFrameIndex GetTextBreak( SwDrawTextInfo const & rInf, tools::Long nTextWidth );
310 
312  { return m_aSub[m_nActual].GetModelPositionForViewPoint_( rInf ); }
313 
314  void DrawText_( SwDrawTextInfo &rInf )
315  { m_aSub[m_nActual].DrawText_( rInf, IsGreyWave() ); }
316 
318  { m_aSub[m_nActual].DrawStretchText_( rInf ); }
319 
320  short CheckKerning()
321  { return m_aSub[m_nActual].CheckKerning(); }
322 
323  sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut )
324  { return m_aSub[m_nActual].GetAscent( pSh, rOut ); }
325  sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut )
326  { return m_aSub[m_nActual].GetHeight( pSh, rOut ); }
327 
328  void Invalidate()
329  { m_bFontChg = m_bOrgChg = true; }
330 
331  void SetTopBorder( const editeng::SvxBorderLine* pTopBorder );
332  void SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder );
333  void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
334  void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
335 
336  const std::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; }
337  const std::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; }
338  const std::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
339  const std::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
340 
341  // Get absolute border correspond to the layout verticality and orientation.
342  const std::optional<editeng::SvxBorderLine>&
343  GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
344  const std::optional<editeng::SvxBorderLine>&
345  GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
346  const std::optional<editeng::SvxBorderLine>&
347  GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
348  const std::optional<editeng::SvxBorderLine>&
349  GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
350 
351  void SetTopBorderDist( const sal_uInt16 nTopDist );
352  void SetBottomBorderDist( const sal_uInt16 nBottomDist );
353  void SetRightBorderDist( const sal_uInt16 nRightDist );
354  void SetLeftBorderDist( const sal_uInt16 nLeftDist );
355 
356  sal_uInt16 GetTopBorderDist() const { return m_nTopBorderDist; }
357  sal_uInt16 GetBottomBorderDist() const { return m_nBottomBorderDist; }
358  sal_uInt16 GetRightBorderDist() const { return m_nRightBorderDist; }
359  sal_uInt16 GetLeftBorderDist() const { return m_nLeftBorderDist; }
360 
361  // Return with the whole space which border holed (border width, spacing and shadow width)
362  sal_uInt16 GetTopBorderSpace() const;
363  sal_uInt16 GetBottomBorderSpace() const;
364  sal_uInt16 GetRightBorderSpace() const;
365  sal_uInt16 GetLeftBorderSpace() const;
366 
368  bool HasBorder() const;
369 
370  void SetShadowColor( const Color& rColor );
371  void SetShadowWidth( const sal_uInt16 nWidth );
372  void SetShadowLocation( const SvxShadowLocation aLocation );
373 
374  const Color& GetShadowColor() const { return m_aShadowColor; }
375  sal_uInt16 GetShadowWidth() const { return m_nShadowWidth; }
377 
387  SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout,
388  const bool bVertLayoutLRBT) const;
389 
404  sal_uInt16 CalcShadowSpace(
405  const SvxShadowItemSide nShadow, const bool bVertLayout, const bool bVertLayoutLRBT,
406  const bool bSkipLeft, const bool bSkipRight ) const;
407 
408  void dumpAsXml( xmlTextWriterPtr writer ) const;
409 };
410 
411 inline void SwFont::SetColor( const Color& rColor )
412 {
413  m_bFontChg = true;
414  m_aSub[SwFontScript::Latin].SetColor( rColor );
415  m_aSub[SwFontScript::CJK].SetColor( rColor );
416  m_aSub[SwFontScript::CTL].SetColor( rColor );
417 }
418 
419 // encapsulated SV-Font-method
420 inline void SwSubFont::SetColor( const Color& rColor )
421 {
422  m_nFontCacheId = nullptr;
423  Font::SetColor( rColor );
424 }
425 
426 // encapsulated SV-Font-method
427 inline void SwSubFont::SetFillColor( const Color& rColor )
428 {
429  m_nFontCacheId = nullptr;
430  Font::SetFillColor( rColor );
431 }
432 
433 inline void SwFont::SetFillColor( const Color& rColor )
434 {
435  m_bFontChg = true;
436  m_aSub[SwFontScript::Latin].SetFillColor( rColor );
437  m_aSub[SwFontScript::CJK].SetFillColor( rColor );
438  m_aSub[SwFontScript::CTL].SetFillColor( rColor );
439 }
440 
441 // encapsulated SV-Font-method
442 inline void SwSubFont::SetFamily( const FontFamily eFamily )
443 {
444  m_nFontCacheId = nullptr;
445  Font::SetFamily( eFamily );
446 }
447 
448 inline void SwFont::SetFamily( const FontFamily eFamily, const SwFontScript nWhich )
449 {
450  m_bFontChg = true;
451  m_aSub[nWhich].SetFamily( eFamily );
452 }
453 
454 // encapsulated SV-Font-method
455 inline void SwSubFont::SetName( const OUString& rName )
456 {
457  m_nFontCacheId = nullptr;
458  Font::SetFamilyName( rName );
459 }
460 
461 inline void SwFont::SetName( const OUString& rName, const SwFontScript nWhich )
462 {
463  m_bFontChg = true;
464  m_aSub[nWhich].SetName( rName );
465 }
466 
467 // encapsulated SV-Font-method
468 inline void SwSubFont::SetStyleName( const OUString& rStyleName )
469 {
470  m_nFontCacheId = nullptr;
471  Font::SetStyleName( rStyleName );
472 }
473 
474 inline void SwFont::SetStyleName( const OUString& rStyle, const SwFontScript nWhich )
475 {
476  m_bFontChg = true;
477  m_aSub[nWhich].SetStyleName( rStyle );
478 }
479 
480 // encapsulated SV-Font-method
481 inline void SwSubFont::SetCharSet( const rtl_TextEncoding eCharSet )
482 {
483  m_nFontCacheId = nullptr;
484  Font::SetCharSet( eCharSet );
485 }
486 
487 inline void SwFont::SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScript nWhich )
488 {
489  m_bFontChg = true;
490  m_aSub[nWhich].SetCharSet( eCharSet );
491 }
492 
493 // encapsulated SV-Font-method
494 inline void SwSubFont::SetPitch( const FontPitch ePitch )
495 {
496  m_nFontCacheId = nullptr;
497  Font::SetPitch( ePitch );
498 }
499 
500 // encapsulated SV-Font-method
501 inline void SwFont::SetPitch( const FontPitch ePitch, const SwFontScript nWhich )
502 {
503  m_bFontChg = true;
504  m_aSub[nWhich].SetPitch( ePitch );
505 }
506 
507 // encapsulated SV-Font-method
508 inline void SwSubFont::SetAlign( const FontAlign eAlign )
509 {
510  m_nFontCacheId = nullptr;
511  Font::SetAlignment( eAlign );
512 }
513 
514 inline void SwFont::SetAlign( const FontAlign eAlign )
515 {
516  m_bFontChg = true;
517  m_aSub[SwFontScript::Latin].SetAlign( eAlign );
518  m_aSub[SwFontScript::CJK].SetAlign( eAlign );
519  m_aSub[SwFontScript::CTL].SetAlign( eAlign );
520 }
521 
522 // encapsulated SV-Font-method
523 inline void SwSubFont::SetWeight( const FontWeight eWeight )
524 {
525  m_nFontCacheId = nullptr;
526  Font::SetWeight( eWeight );
527 }
528 
529 inline void SwFont::SetWeight( const FontWeight eWeight, const SwFontScript nWhich )
530 {
531  m_bFontChg = true;
532  m_aSub[nWhich].SetWeight( eWeight );
533 }
534 
535 // encapsulated SV-Font-method
536 inline void SwSubFont::SetUnderline( const FontLineStyle eUnderline )
537 {
538  m_nFontCacheId = nullptr;
539  Font::SetUnderline( eUnderline );
540 }
541 
542 inline void SwFont::SetUnderline( const FontLineStyle eUnderline )
543 {
544  m_bFontChg = true;
545  m_aSub[SwFontScript::Latin].SetUnderline( eUnderline );
546  m_aSub[SwFontScript::CJK].SetUnderline( eUnderline );
547  m_aSub[SwFontScript::CTL].SetUnderline( eUnderline );
548 }
549 
550 // encapsulated SV-Font-method
551 inline void SwSubFont::SetOverline( const FontLineStyle eOverline )
552 {
553  m_nFontCacheId = nullptr;
554  Font::SetOverline( eOverline );
555 }
556 
557 inline void SwFont::SetOverline( const FontLineStyle eOverline )
558 {
559  m_bFontChg = true;
560  m_aSub[SwFontScript::Latin].SetOverline( eOverline );
561  m_aSub[SwFontScript::CJK].SetOverline( eOverline );
562  m_aSub[SwFontScript::CTL].SetOverline( eOverline );
563 }
564 
565 // encapsulated SV-Font-method
566 inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout )
567 {
568  m_nFontCacheId = nullptr;
569  Font::SetStrikeout( eStrikeout );
570 }
571 
572 inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout )
573 {
574  m_bFontChg = true;
575  m_aSub[SwFontScript::Latin].SetStrikeout( eStrikeout );
576  m_aSub[SwFontScript::CJK].SetStrikeout( eStrikeout );
577  m_aSub[SwFontScript::CTL].SetStrikeout( eStrikeout );
578 }
579 
580 // encapsulated SV-Font-method
581 inline void SwSubFont::SetItalic( const FontItalic eItalic )
582 {
583  m_nFontCacheId = nullptr;
584  Font::SetItalic( eItalic );
585 }
586 
587 inline void SwFont::SetItalic( const FontItalic eItalic, const SwFontScript nWhich )
588 {
589  m_bFontChg = true;
590  m_aSub[nWhich].SetItalic( eItalic );
591 }
592 
593 // encapsulated SV-Font-method
594 inline void SwSubFont::SetOutline( const bool bOutline )
595 {
596  m_nFontCacheId = nullptr;
597  Font::SetOutline( bOutline );
598 }
599 
600 inline void SwFont::SetOutline( const bool bOutline )
601 {
602  m_bFontChg = true;
603  m_aSub[SwFontScript::Latin].SetOutline( bOutline );
604  m_aSub[SwFontScript::CJK].SetOutline( bOutline );
605  m_aSub[SwFontScript::CTL].SetOutline( bOutline );
606 }
607 
608 // encapsulated SV-Font-method
609 inline void SwSubFont::SetShadow( const bool bShadow )
610 {
611  m_nFontCacheId = nullptr;
612  Font::SetShadow( bShadow );
613 }
614 
615 inline void SwFont::SetShadow( const bool bShadow )
616 {
617  m_bFontChg = true;
618  m_aSub[SwFontScript::Latin].SetShadow( bShadow );
619  m_aSub[SwFontScript::CJK].SetShadow( bShadow );
620  m_aSub[SwFontScript::CTL].SetShadow( bShadow );
621 }
622 
623 // encapsulated SV-Font-method
624 inline void SwSubFont::SetAutoKern( FontKerning nAutoKern )
625 {
626  m_nFontCacheId = nullptr;
627  Font::SetKerning( nAutoKern );
628 }
629 
630 inline void SwFont::SetAutoKern( FontKerning nAutoKern )
631 {
632  m_bFontChg = true;
633  m_aSub[SwFontScript::CJK].SetAutoKern( nAutoKern );
634  if( nAutoKern != FontKerning::NONE )
635  nAutoKern = FontKerning::FontSpecific;
636  m_aSub[SwFontScript::Latin].SetAutoKern( nAutoKern );
637  m_aSub[SwFontScript::CTL].SetAutoKern( nAutoKern );
638 }
639 
640 inline void SwFont::SetTransparent( const bool bTrans )
641 {
642  m_aSub[SwFontScript::Latin].SetTransparent( bTrans );
643  m_aSub[SwFontScript::CJK].SetTransparent( bTrans );
644  m_aSub[SwFontScript::CTL].SetTransparent( bTrans );
645 }
646 
647 inline void SwFont::SetFixKerning( const short nNewKern )
648 {
649  m_aSub[SwFontScript::Latin].SetFixKerning( nNewKern );
650  m_aSub[SwFontScript::CJK].SetFixKerning( nNewKern );
651  m_aSub[SwFontScript::CTL].SetFixKerning( nNewKern );
652 }
653 
654 inline void SwFont::SetCaseMap( const SvxCaseMap eNew )
655 {
656  m_aSub[SwFontScript::Latin].SetCaseMap( eNew );
657  m_aSub[SwFontScript::CJK].SetCaseMap( eNew );
658  m_aSub[SwFontScript::CTL].SetCaseMap( eNew );
659 }
660 
661 // encapsulated SV-Font-method
662 inline void SwSubFont::SetWordLineMode( const bool bWordLineMode )
663 {
664  m_nFontCacheId = nullptr;
665  Font::SetWordLineMode( bWordLineMode );
666 }
667 
668 inline void SwFont::SetWordLineMode( const bool bWordLineMode )
669 {
670  m_bFontChg = true;
671  m_aSub[SwFontScript::Latin].SetWordLineMode( bWordLineMode );
672  m_aSub[SwFontScript::CJK].SetWordLineMode( bWordLineMode );
673  m_aSub[SwFontScript::CTL].SetWordLineMode( bWordLineMode );
674 }
675 // encapsulated SV-Font-method
676 inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue )
677 {
678  m_nFontCacheId = nullptr;
679  Font::SetEmphasisMark( eValue );
680 }
681 
682 inline void SwFont::SetEmphasisMark( const FontEmphasisMark eValue )
683 {
684  m_bFontChg = true;
685  m_aSub[SwFontScript::Latin].SetEmphasisMark( eValue );
686  m_aSub[SwFontScript::CJK].SetEmphasisMark( eValue );
687  m_aSub[SwFontScript::CTL].SetEmphasisMark( eValue );
688 }
689 
690 inline void SwFont::SetPropWidth( const sal_uInt16 nNew )
691 {
692  if( nNew != m_aSub[SwFontScript::Latin].GetPropWidth() )
693  {
694  m_bFontChg = true;
695  m_aSub[SwFontScript::Latin].SetPropWidth( nNew );
696  m_aSub[SwFontScript::CJK].SetPropWidth( nNew );
697  m_aSub[SwFontScript::CTL].SetPropWidth( nNew );
698  }
699 }
700 
701 // encapsulated SV-Font-method
702 inline void SwSubFont::SetRelief( const FontRelief eNew )
703 {
704  m_nFontCacheId = nullptr;
705  Font::SetRelief( eNew );
706 }
707 
708 inline void SwFont::SetRelief( const FontRelief eNew )
709 {
710  if( eNew != m_aSub[SwFontScript::Latin].GetRelief() )
711  {
712  m_bFontChg = true;
713  m_aSub[SwFontScript::Latin].SetRelief( eNew );
714  m_aSub[SwFontScript::CJK].SetRelief( eNew );
715  m_aSub[SwFontScript::CTL].SetRelief( eNew );
716  }
717 }
718 
719 // overloaded font-method
720 inline void SwSubFont::SetSize( const Size& rSize )
721 {
722  m_aSize = rSize;
723  if ( GetPropr() == 100 )
724  Font::SetFontSize( m_aSize );
725  else
726  {
727  Font::SetFontSize( Size(
728  m_aSize.Width() * GetPropr() / 100,
729  m_aSize.Height() * GetPropr() / 100 ) );
730  }
731  m_nFontCacheId = nullptr;
732 }
733 
734 inline void SwFont::SetSize( const Size& rSize, const SwFontScript nWhich )
735 {
736  if( m_aSub[nWhich].m_aSize != rSize )
737  {
738  m_aSub[nWhich].SetSize( rSize );
739  m_bFontChg = true;
740  m_bOrgChg = true;
741  }
742 }
743 
744 inline void SwFont::SetActual( SwFontScript nNew )
745 {
746  if ( m_nActual != nNew )
747  {
748  m_bFontChg = true;
749  m_bOrgChg = true;
750  m_nActual = nNew;
751  }
752 }
753 
754 inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr )
755 {
756  m_nFontCacheId = nullptr;
757  Font::SetFontSize( Size( m_aSize.Width() * nNewPropr / 100,
758  m_aSize.Height() * nNewPropr / 100 ) );
759  SvxFont::SetPropr( nNewPropr );
760 }
761 
762 inline void SwFont::SetProportion( const sal_uInt8 nNewPropr )
763 {
764  if( nNewPropr != m_aSub[SwFontScript::Latin].GetPropr() )
765  {
766  m_bFontChg = true;
767  m_bOrgChg = true;
768 
769  m_aSub[SwFontScript::Latin].SetProportion( nNewPropr );
770  m_aSub[SwFontScript::CJK].SetProportion( nNewPropr );
771  m_aSub[SwFontScript::CTL].SetProportion( nNewPropr );
772  }
773 }
774 
775 inline void SwSubFont::SetEscapement( const short nNewEsc )
776 {
777  m_nFontCacheId = nullptr;
778  SvxFont::SetEscapement( nNewEsc );
779 }
780 
781 inline void SwFont::SetEscapement( const short nNewEsc )
782 {
783  if( nNewEsc != m_aSub[SwFontScript::Latin].GetEscapement() )
784  {
785  // these have to be set, otherwise nOrgHeight and nOrgAscent will not
786  // be calculated
787  m_bFontChg = true;
788  m_bOrgChg = true;
789 
790  m_aSub[SwFontScript::Latin].SetEscapement( nNewEsc );
791  m_aSub[SwFontScript::CJK].SetEscapement( nNewEsc );
792  m_aSub[SwFontScript::CTL].SetEscapement( nNewEsc );
793  }
794 }
795 
796 inline void SwSubFont::SetLanguage( LanguageType eNewLang )
797 {
798  m_nFontCacheId = nullptr;
799  if( eNewLang == LANGUAGE_SYSTEM )
800  eNewLang = GetAppLanguage();
801  SvxFont::SetLanguage( eNewLang );
802 }
803 
804 inline void SwFont::SetLanguage( const LanguageType eNewLang, const SwFontScript nWhich )
805 {
806  m_aSub[nWhich].SetLanguage( eNewLang );
807  if( SwFontScript::CJK == nWhich )
808  {
809  m_aSub[SwFontScript::Latin].SetCJKContextLanguage( eNewLang );
810  m_aSub[SwFontScript::CJK].SetCJKContextLanguage( eNewLang );
811  m_aSub[SwFontScript::CTL].SetCJKContextLanguage( eNewLang );
812  }
813 }
814 
815 inline void SwFont::SetGreyWave( const bool bNew )
816 {
817  m_bGreyWave = bNew;
818 }
819 
820 inline void SwSubFont::SetVertical( const Degree10 nDir, const bool bVertFormat )
821 {
822  m_nFontCacheId = nullptr;
823  Font::SetVertical( bVertFormat );
824  Font::SetOrientation( nDir );
825 }
826 
827 inline void SwFont::SetTopBorderDist( const sal_uInt16 nTopDist )
828 {
829  m_nTopBorderDist = nTopDist;
830  m_bFontChg = true;
831  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
832 }
833 
834 inline void SwFont::SetBottomBorderDist( const sal_uInt16 nBottomDist )
835 {
836  m_nBottomBorderDist = nBottomDist;
837  m_bFontChg = true;
838  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
839 }
840 
841 inline void SwFont::SetRightBorderDist( const sal_uInt16 nRightDist )
842 {
843  m_nRightBorderDist = nRightDist;
844  m_bFontChg = true;
845  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
846 }
847 
848 inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
849 {
850  m_nLeftBorderDist = nLeftDist;
851  m_bFontChg = true;
852  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
853 }
854 
855 inline sal_uInt16 SwFont::GetTopBorderSpace() const
856 {
857  sal_uInt16 nRet = 0;
858  if( m_aTopBorder )
859  {
860  nRet += m_aTopBorder->GetScaledWidth() + m_nTopBorderDist;
861  }
862  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
863  m_aShadowLocation == SvxShadowLocation::TopRight )
864  {
865  nRet += m_nShadowWidth;
866  }
867  return nRet;
868 }
869 
870 inline sal_uInt16 SwFont::GetBottomBorderSpace() const
871 {
872  sal_uInt16 nRet = 0;
873  if( m_aBottomBorder )
874  {
875  nRet += m_aBottomBorder->GetScaledWidth() + m_nBottomBorderDist;
876  }
877  if( m_aShadowLocation == SvxShadowLocation::BottomLeft ||
878  m_aShadowLocation == SvxShadowLocation::BottomRight )
879  {
880  nRet += m_nShadowWidth;
881  }
882  return nRet;
883 }
884 
885 inline sal_uInt16 SwFont::GetRightBorderSpace() const
886 {
887  sal_uInt16 nRet = 0;
888  if( m_aRightBorder )
889  {
890  nRet += m_aRightBorder->GetScaledWidth() + m_nRightBorderDist;
891  }
892  if( m_aShadowLocation == SvxShadowLocation::TopRight ||
893  m_aShadowLocation == SvxShadowLocation::BottomRight )
894  {
895  nRet += m_nShadowWidth;
896  }
897  return nRet;
898 }
899 
900 inline sal_uInt16 SwFont::GetLeftBorderSpace() const
901 {
902  sal_uInt16 nRet = 0;
903  if( m_aLeftBorder )
904  {
905  nRet += m_aLeftBorder->GetScaledWidth() + m_nLeftBorderDist;
906  }
907  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
908  m_aShadowLocation == SvxShadowLocation::BottomLeft )
909  {
910  nRet += m_nShadowWidth;
911  }
912  return nRet;
913 }
914 
915 inline bool SwFont::HasBorder() const
916 {
918 }
919 
920 inline void SwFont::SetShadowColor( const Color& rColor )
921 {
922  m_aShadowColor = rColor;
923  m_bFontChg = true;
924  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
925 }
926 
927 inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth )
928 {
929  m_nShadowWidth = nWidth;
930  m_bFontChg = true;
931  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
932 }
933 
934 inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation )
935 {
936  m_aShadowLocation = aLocation;
937  m_bFontChg = true;
938  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
939 }
940 
941 inline void SwFont::SetHighlightColor( const Color& aNewColor )
942 {
943  m_aHighlightColor = aNewColor;
944  m_bFontChg = true;
945  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
946 }
947 
948 // Used for the "continuous underline" feature.
950 {
953  std::unique_ptr<SwFont> m_pFont;
954 
955 public:
956  // sets the font which should paint the common baseline,
957  // index where continuous underline ends,
958  // and the starting point of the common baseline
959  SwUnderlineFont(SwFont& rFnt, TextFrameIndex nEnd, const Point& rPoint);
961 
963  {
964  OSL_ENSURE( m_pFont, "No underline font" );
965  return *m_pFont;
966  }
967  const Point& GetPos() const { return m_aPos; }
968  TextFrameIndex GetEnd() const { return m_nEnd; }
969  // the x coordinate of the starting point has to be set for each portion
970  void SetPos( const Point& rPoint ) { m_aPos = rPoint; }
971 };
972 
973 #ifdef DBG_UTIL
974 
976 {
977 public:
978  sal_uInt16 nGetTextSize;
979  sal_uInt16 nDrawText;
981  sal_uInt16 nDrawStretchText;
982  sal_uInt16 nChangeFont;
983 
985  { nGetTextSize = nDrawText = nGetStretchTextSize = nDrawStretchText = nChangeFont = 0; }
986 };
987 
988 // global variable, implemented in swfont.cxx
989 extern SvStatistics g_SvStat;
990 
991 #define SV_STAT(nWhich) ++(g_SvStat.nWhich);
992 
993 
994 #else
995 #define SV_STAT(nWhich)
996 #endif /* DBG_UTIL */
997 
998 #endif
999 
1000 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
Definition: swfont.hxx:848
rtl_TextEncoding GetCharSet(const SwFontScript nWhich) const
Definition: swfont.hxx:291
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
void SetPropr(const sal_uInt8 nNewPropr)
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:900
sal_uInt16 GetShadowWidth() const
Definition: swfont.hxx:375
const std::optional< editeng::SvxBorderLine > & GetBottomBorder() const
Definition: swfont.hxx:337
sal_uInt8 GetPropr() const
short CheckKerning()
Definition: swfont.hxx:320
void SetFamily(const FontFamily eFamily)
Definition: swfont.hxx:442
const sal_Unicode CH_NB_SPACE
Definition: swfont.hxx:48
~SwFont()
Definition: swfont.cxx:895
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:668
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.cxx:1018
SwSubFont()
Definition: swfont.hxx:117
bool m_bSmallCapsPercentage66
Definition: swfont.hxx:62
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:394
sal_uInt16 m_nOrgAscent
Definition: swfont.hxx:60
SvxCaseMap
void SetName(const OUString &rName)
Definition: swfont.hxx:455
const Color & GetUnderColor() const
Definition: swfont.hxx:269
bool IsInputField() const
Definition: swfont.hxx:254
sal_uInt8 GetPropr() const
Definition: swfont.hxx:277
std::optional< editeng::SvxBorderLine > m_aTopBorder
Definition: swfont.hxx:143
sal_uInt16 GetTopBorderDist() const
Definition: swfont.hxx:356
sal_uInt16 GetRightBorderSpace() const
Definition: swfont.hxx:885
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:427
long Long
constexpr OUStringChar CH_PAR
Definition: swfont.hxx:45
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:433
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:946
FontEmphasisMark
bool IsMeta() const
Definition: swfont.hxx:252
void SetGreyWave(const bool bNew)
Definition: swfont.hxx:815
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:536
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:306
void SetBackColor(Color *pNewColor)
Definition: swfont.cxx:65
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
Definition: swfont.hxx:200
const std::optional< editeng::SvxBorderLine > & GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:197
const SvxFont & GetActualFont() const
Definition: swfont.hxx:184
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:682
void SetSize(const Size &rSize)
Definition: swfont.hxx:720
void SetVertical(const Degree10 nDir, const bool bVertFormat)
Definition: swfont.hxx:820
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
Definition: swfont.cxx:1389
bool HasBorder() const
Check whether font has any border on any side.
Definition: swfont.hxx:915
const sal_Unicode CH_BULLET
Definition: swfont.hxx:46
bool IsSymbol(SwViewShell const *pSh)
Definition: swfont.hxx:266
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:204
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:272
bool m_bPaintBlank
Definition: swfont.hxx:166
void SetOutline(const bool bOutline)
Definition: swfont.hxx:600
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:690
void dumpAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:535
Color m_aShadowColor
Definition: swfont.hxx:154
sal_uInt8 & GetRef()
Definition: swfont.hxx:249
Degree10 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
Definition: swfont.cxx:433
bool m_bFontChg
Definition: swfont.hxx:167
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
Definition: swfont.hxx:834
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:501
sal_uInt16 m_nLeftBorderDist
Definition: swfont.hxx:152
void DrawText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:314
void DrawCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:318
void SetColor(const Color &rColor)
Definition: swfont.hxx:411
bool IsGreyWave() const
Definition: swfont.hxx:256
void SetShadow(const bool bShadow)
Definition: swfont.hxx:615
sal_uInt16 m_nShadowWidth
Definition: swfont.hxx:155
sal_uInt16 sal_Unicode
sal_uInt16 m_nRightBorderDist
Definition: swfont.hxx:151
bool IsRef() const
Definition: swfont.hxx:250
Color m_aOverColor
Definition: swfont.hxx:140
void SetPitch(const FontPitch ePitch)
Definition: swfont.hxx:494
const Color & GetOverColor() const
Definition: swfont.hxx:271
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
Definition: swfont.cxx:1500
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:323
sal_uInt16 GetRightBorderDist() const
Definition: swfont.hxx:358
void SetFntChg(const bool bNew)
Definition: swfont.hxx:207
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1274
SvxCaseMap GetCaseMap() const
Definition: swfont.hxx:276
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
Definition: swfont.hxx:134
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
Definition: swfont.cxx:738
sal_uInt16 m_nFontIndex
Definition: swfont.hxx:58
void SetShadowColor(const Color &rColor)
Definition: swfont.hxx:920
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:542
void SetShadowLocation(const SvxShadowLocation aLocation)
Definition: swfont.hxx:934
const std::optional< editeng::SvxBorderLine > & GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:149
FontEmphasisMark GetEmphasisMark() const
Definition: swfont.hxx:282
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:963
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.cxx:1025
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:572
void SetLanguage(LanguageType eNewLang)
Definition: swfont.hxx:796
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:514
sal_uInt16 m_nProportionalWidth
Definition: swfont.hxx:61
FontKerning
void SetItalic(const FontItalic eItalic)
Definition: swfont.hxx:581
SwFontScript GetActual() const
Definition: swfont.hxx:182
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
Definition: swfont.cxx:111
const std::optional< editeng::SvxBorderLine > & GetRightBorder() const
Definition: swfont.hxx:338
bool IsFntChg() const
Definition: swfont.hxx:206
std::optional< editeng::SvxBorderLine > m_aLeftBorder
Definition: swfont.hxx:146
Color m_aHighlightColor
Definition: swfont.hxx:138
struct _xmlTextWriter * xmlTextWriterPtr
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:551
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
Definition: swfont.hxx:474
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:640
bool IsTox() const
Definition: swfont.hxx:248
void SetCharSet(const rtl_TextEncoding eCharSet)
Definition: swfont.hxx:481
SvxShadowItemSide
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
Definition: swfont.hxx:804
SwFontScript m_nActual
Definition: swfont.hxx:163
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
Definition: swfont.cxx:98
std::optional< editeng::SvxBorderLine > m_aBottomBorder
Definition: swfont.hxx:144
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:662
sal_uInt8 m_nInputFieldCount
Definition: swfont.hxx:161
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:775
void SetUnderColor(const Color &rColor)
Definition: swfont.hxx:214
void SetRightBorderDist(const sal_uInt16 nRightDist)
Definition: swfont.hxx:841
SvStatistics g_SvStat
Definition: swfont.cxx:59
const sal_Unicode CH_FULL_BLANK
Definition: swfont.hxx:47
void SetShadowWidth(const sal_uInt16 nWidth)
Definition: swfont.hxx:927
const Point & GetPos() const
Definition: swfont.hxx:967
void DrawStretchCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:467
void SetCaseMap(const SvxCaseMap eNew)
Definition: swfont.hxx:654
#define LANGUAGE_SYSTEM
const sal_Unicode CH_TAB
Definition: swfont.hxx:44
void CheckFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
Definition: swfont.hxx:194
const std::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:125
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
Definition: swfont.cxx:1141
Size GetCapitalSize(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:138
void SetVertical(Degree10 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Definition: swfont.cxx:438
sal_uInt16 GetBottomBorderDist() const
Definition: swfont.hxx:357
const Color * GetBackColor() const
Definition: swfont.hxx:190
FontLineStyle GetOverline() const
Definition: swfont.hxx:270
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
TextFrameIndex GetCapitalBreak(SwViewShell const *pSh, const OutputDevice *pOut, const SwScriptInfo *pScript, const OUString &rText, tools::Long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen)
Definition: fntcap.cxx:220
bool m_bOrgChg
Definition: swfont.hxx:168
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:855
SwFont & GetFont()
Definition: swfont.hxx:962
TextFrameIndex GetEnd() const
Definition: swfont.hxx:968
sal_uInt16 GetPropWidth() const
Definition: swfont.hxx:119
tools::Long Width() const
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:708
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:754
float u
sal_uInt16 nChangeFont
Definition: swfont.hxx:982
void SetShadow(const bool bShadow)
Definition: swfont.hxx:609
sal_uInt8 m_nToxCount
Definition: swfont.hxx:158
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:781
Provides access to settings of a document.
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:317
const std::optional< editeng::SvxBorderLine > & GetLeftBorder() const
Definition: swfont.hxx:339
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:529
sal_uInt8 & GetMeta()
Definition: swfont.hxx:251
FontPitch
const Color & GetColor() const
Definition: swfont.hxx:273
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1356
void DoOnCapitals(SwDoCapitals &rDo)
Definition: swfont.hxx:303
void SetPos(const Point &rPoint)
Definition: swfont.hxx:970
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:624
void SetOverColor(const Color &rColor)
Definition: swfont.hxx:216
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:508
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:114
bool IsPaintBlank() const
Definition: swfont.hxx:257
sal_uInt16 m_nBottomBorderDist
Definition: swfont.hxx:150
void SetFixKerning(const short nNewKern)
Definition: swfont.hxx:647
sal_uInt16 nGetStretchTextSize
Definition: swfont.hxx:980
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...
Definition: swfont.cxx:303
FontLineStyle GetUnderline() const
Definition: swfont.hxx:268
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
Definition: swfont.cxx:85
sal_uInt16 GetLeftBorderDist() const
Definition: swfont.hxx:359
void SetOutline(const bool bOutline)
Definition: swfont.hxx:594
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1038
SwFont & operator=(const SwFont &rFont)
Definition: swfont.cxx:899
FontFamily
const OUString & GetName(const SwFontScript nWhich) const
Definition: swfont.hxx:287
std::unique_ptr< SwFont > m_pFont
Definition: swfont.hxx:953
void SetStyleName(const OUString &rStyleName)
Definition: swfont.hxx:468
FontWeight GetWeight() const
Definition: swfont.hxx:281
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:325
bool IsSymbol(SwViewShell const *pSh)
Definition: swfont.cxx:940
LanguageType GetLanguage() const
Definition: swfont.hxx:279
void DoOnCapitals(SwDoCapitals &rDo)
Definition: fntcap.cxx:485
FontWeight
std::unique_ptr< Color > m_pBackColor
Definition: swfont.hxx:137
const void * m_nFontCacheId
Definition: swfont.hxx:56
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:702
sal_uInt8 & GetInputField()
Definition: swfont.hxx:253
sal_uInt8 & GetTox()
Definition: swfont.hxx:247
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:734
void SetFontCacheId(const void *nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich)
Definition: swfont.hxx:198
unsigned char sal_uInt8
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:481
SvxShadowLocation GetShadowLocation() const
Definition: swfont.hxx:376
sal_uInt16 nDrawText
Definition: swfont.hxx:979
FontItalic GetItalic() const
Definition: swfont.hxx:278
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
Definition: swfont.cxx:72
sal_uInt8 m_nRefCount
Definition: swfont.hxx:159
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:744
short CheckKerning_()
Definition: swfont.cxx:1009
LanguageType GetAppLanguage()
Definition: init.cxx:728
std::optional< editeng::SvxBorderLine > m_aRightBorder
Definition: swfont.hxx:145
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
Definition: swfont.hxx:448
TextFrameIndex GetModelPositionForViewPoint_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:311
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
Definition: swfont.hxx:487
tools::Long Height() const
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:870
SwFontScript
Definition: swfont.hxx:122
void SetWeight(const FontWeight eWeight)
Definition: swfont.hxx:523
const Color & GetHighlightColor() const
Definition: swfont.hxx:192
void Invalidate()
Definition: swfont.hxx:328
const Color & GetShadowColor() const
Definition: swfont.hxx:374
sal_uInt16 nDrawStretchText
Definition: swfont.hxx:981
awt::Size m_aSize
void SetLanguage(SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:220
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:461
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, tools::Long nTextWidth)
Definition: fntcache.cxx:2382
const std::optional< editeng::SvxBorderLine > & GetTopBorder() const
Definition: swfont.hxx:336
TextFrameIndex m_nEnd
Definition: swfont.hxx:952
Degree10 UnMapDirection(Degree10 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
Definition: swfont.cxx:394
short GetFixKerning() const
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:630
void SetFont(SwFont *pNew)
Definition: drawfont.hxx:448
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
Definition: swfont.cxx:494
SvxShadowLocation m_aShadowLocation
Definition: swfont.hxx:156
LanguageType GetLanguage(const SwFontScript nWhich) const
Definition: swfont.hxx:289
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
Definition: swfont.hxx:587
Size m_aSize
Definition: swfont.hxx:57
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:993
sal_uInt16 m_nTopBorderDist
Definition: swfont.hxx:149
bool IsWordLineMode() const
Definition: swfont.hxx:274
const std::optional< editeng::SvxBorderLine > & GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:173
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:676
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:762
SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout, const bool bVertLayoutLRBT) const
Get the absolute shadow location dependent from orientation.
Definition: swfont.cxx:220
void SetHighlightColor(const Color &aNewColor)
Definition: swfont.hxx:941
FontLineStyle
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.hxx:175
Color m_aUnderColor
Definition: swfont.hxx:139
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:566
short GetEscapement() const
Definition: swfont.hxx:275
sal_uInt16 nGetTextSize
Definition: swfont.hxx:978
sal_uInt16 m_nOrgHeight
Definition: swfont.hxx:59
void SetEscapement(const short nNewEsc)
sal_uInt8 m_nMetaCount
Definition: swfont.hxx:160
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:557
tools::Long GetHeight() const
Definition: swfont.hxx:280
FontStrikeout
void SetTopBorderDist(const sal_uInt16 nTopDist)
Definition: swfont.hxx:827
FontRelief
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:263
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
Definition: swfont.cxx:934
FontItalic
tools::Long GetHeight(const SwFontScript nWhich) const
Definition: swfont.hxx:293
SvxShadowLocation
short CheckKerning()
Definition: swfont.hxx:112
void SetColor(const Color &rColor)
Definition: swfont.hxx:420
const sal_Unicode CH_SIX_PER_EM
Definition: swfont.hxx:49
bool m_bGreyWave
Definition: swfont.hxx:169
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)
Definition: swfont.hxx:196