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 <boost/optional.hpp>
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 const sal_Unicode CH_PAR = 0xB6; // 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 sal_uInt16 UnMapDirection( sal_uInt16 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 sal_uInt16 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
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_bBlink :1; // blinking font
167  bool m_bPaintBlank :1; // blanks not with DrawRect
168  bool m_bFontChg :1;
169  bool m_bOrgChg :1; // nOrgHeight/Ascent are invalid
170  bool m_bGreyWave :1; // for the extended TextInput: gray waveline
171 
172 public:
173  SwFont( const SwAttrSet* pSet, const IDocumentSettingAccess* pIDocumentSettingAccess );
174  SwFont( const SwFont& rFont );
175 
176  void ChgFnt( SwViewShell const *pSh, OutputDevice& rOut )
177  { m_bPaintBlank = m_aSub[m_nActual].ChgFnt( pSh, rOut ); }
178 
179  ~SwFont();
180 
181  SwFont& operator=( const SwFont &rFont );
182 
183  SwFontScript GetActual() const { return m_nActual; }
184  inline void SetActual( SwFontScript nNew );
185  const SvxFont& GetActualFont() const { return m_aSub[m_nActual]; }
186 
187  // gets a font cache id via SwFntAccess
188  void AllocFontCacheId( SwViewShell const *pSh, SwFontScript nWhich );
189  // set background color
190  void SetBackColor( Color* pNewColor );
191  const Color* GetBackColor() const{ return m_pBackColor.get(); }
192  void SetHighlightColor( const Color& aNewColor );
193  const Color& GetHighlightColor() const { return m_aHighlightColor; }
194 
195  void CheckFontCacheId( SwViewShell const *pSh, SwFontScript nWhich )
196  { if( !m_aSub[ nWhich ].m_nFontCacheId ) AllocFontCacheId( pSh, nWhich ); }
197  void GetFontCacheId( const void* &rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich )
198  { rnFontCacheId = m_aSub[nWhich].m_nFontCacheId; rIdx = m_aSub[nWhich].m_nFontIndex; }
199  void SetFontCacheId( const void* nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich )
200  { m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId; m_aSub[nWhich].m_nFontIndex = nIdx; }
201  bool DifferentFontCacheId( const SwFont* pFnt, SwFontScript nWhich )
202  { return m_aSub[nWhich].m_nFontCacheId != pFnt->m_aSub[nWhich].m_nFontCacheId ||
203  !m_aSub[nWhich].m_nFontCacheId || !pFnt->m_aSub[nWhich].m_nFontCacheId; }
204 
205  const Size &GetSize( SwFontScript nWhich ) const
206  { return m_aSub[nWhich].m_aSize; }
207  bool IsFntChg() const { return m_bFontChg; }
208  void SetFntChg( const bool bNew ) { m_bFontChg = bNew; }
209 
210  // the encapsulated SV-Font-methods (set bFntChg to true)
211  inline void SetColor( const Color& rColor );
212  inline void SetFillColor( const Color& rColor );
213  inline void SetAlign( const FontAlign eAlign );
214  inline void SetUnderline( const FontLineStyle eUnderline );
215  void SetUnderColor( const Color &rColor ) { m_aUnderColor = rColor; }
216  inline void SetOverline( const FontLineStyle eOverline );
217  void SetOverColor( const Color &rColor ) { m_aOverColor = rColor; }
218  inline void SetStrikeout( const FontStrikeout eStrikeout );
219  inline void SetOutline( const bool bOutline );
220  void SetVertical(sal_uInt16 nDir, const bool bVertLayout = false,
221  const bool bVertLayoutLRBT = false);
222  inline void SetShadow( const bool bShadow );
223  inline void SetAutoKern( FontKerning nAutoKern );
224  inline void SetTransparent( const bool bTrans );
225  inline void SetWordLineMode( const bool bWordLineMode );
226  inline void SetFixKerning( const short nNewKern );
227  inline void SetCaseMap( const SvxCaseMap eNew );
228  inline void SetEmphasisMark( const FontEmphasisMark eValue );
229 
230  // methods for sub-/superscript
231  inline void SetEscapement( const short nNewEsc );
232  inline void SetProportion( const sal_uInt8 nNewPropr );
233 
234  inline void SetPropWidth( const sal_uInt16 nNew );
235 
236  inline void SetFamily( const FontFamily eFamily, const SwFontScript nWhich );
237  inline void SetName( const OUString& rName, const SwFontScript nWhich );
238  inline void SetStyleName( const OUString& rStyleName, const SwFontScript nWhich );
239  inline void SetSize( const Size& rSize, const SwFontScript nWhich );
240  inline void SetWeight( const FontWeight eWeight, const SwFontScript nWhich );
241  inline void SetItalic( const FontItalic eItalic, const SwFontScript nWhich );
242  inline void SetLanguage( LanguageType eNewLang, const SwFontScript nWhich );
243  inline void SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScript nWhich );
244  inline void SetPitch( const FontPitch ePitch, const SwFontScript nWhich );
245  inline void SetRelief( const FontRelief eNew );
246 
247  // Get/Set-methods for the current setting
248  inline void SetBlink( const bool bBlink );
249  bool IsBlink() const { return m_bBlink; }
250  sal_uInt8 &GetTox() { return m_nToxCount; }
251  bool IsTox() const { return ( 0 != m_nToxCount ); }
252  sal_uInt8 &GetRef() { return m_nRefCount; }
253  bool IsRef() const { return ( 0 != m_nRefCount ); }
255  bool IsMeta() const { return (0 != m_nMetaCount); }
257  bool IsInputField() const { return (0 != m_nInputFieldCount); }
258  inline void SetGreyWave( const bool bNew );
259  bool IsGreyWave() const { return m_bGreyWave; }
260  bool IsPaintBlank() const { return m_bPaintBlank; }
261 
262  // setting of the base class font for SwTextCharFormat
263  void SetDiffFnt( const SfxItemSet* pSet,
264  const IDocumentSettingAccess* pIDocumentSettingAccess );
265 
266  const SvxFont &GetFnt( const SwFontScript nWhich ) const
267  { return m_aSub[nWhich]; };
268 
269  bool IsSymbol( SwViewShell const *pSh )
270  { return m_aSub[m_nActual].IsSymbol( pSh ); }
271  FontLineStyle GetUnderline() const { return m_aSub[m_nActual].GetUnderline(); }
272  const Color& GetUnderColor() const { return m_aUnderColor; }
273  FontLineStyle GetOverline() const { return m_aSub[m_nActual].GetOverline(); }
274  const Color& GetOverColor() const { return m_aOverColor; }
275  FontStrikeout GetStrikeout() const { return m_aSub[m_nActual].GetStrikeout(); }
276  const Color& GetColor() const { return m_aSub[m_nActual].GetColor(); }
277  bool IsWordLineMode() const { return m_aSub[m_nActual].IsWordLineMode(); }
278  short GetEscapement() const { return m_aSub[m_nActual].GetEscapement(); }
279  SvxCaseMap GetCaseMap() const { return m_aSub[m_nActual].GetCaseMap(); }
280  sal_uInt8 GetPropr() const { return m_aSub[m_nActual].GetPropr(); }
281  FontItalic GetItalic() const { return m_aSub[m_nActual].GetItalic(); }
282  LanguageType GetLanguage() const { return m_aSub[m_nActual].GetLanguage(); }
283  long GetHeight() const { return m_aSub[m_nActual].GetFontSize().Height(); }
284  FontWeight GetWeight() const { return m_aSub[m_nActual].GetWeight(); }
286  { return m_aSub[m_nActual].GetEmphasisMark(); }
287  sal_uInt16 GetOrientation(const bool bVertLayout = false,
288  const bool bVertFormatLRBT = false) const;
289 
290  const OUString& GetName( const SwFontScript nWhich ) const
291  { return m_aSub[nWhich].GetFamilyName(); }
292  LanguageType GetLanguage( const SwFontScript nWhich ) const
293  { return m_aSub[nWhich].GetLanguage(); }
294  rtl_TextEncoding GetCharSet( const SwFontScript nWhich ) const
295  { return m_aSub[nWhich].GetCharSet(); }
296  long GetHeight( const SwFontScript nWhich ) const
297  { return m_aSub[nWhich].GetFontSize().Height(); }
298 
299  // makes the logical font be effective in the OutputDevice
300  void ChgPhysFnt( SwViewShell const *pSh, OutputDevice& rOut );
301 
302  TextFrameIndex GetCapitalBreak( SwViewShell const* pSh, const OutputDevice* pOut,
303  const SwScriptInfo* pScript, const OUString& rText,
304  long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen);
305 
307  { m_aSub[m_nActual].DoOnCapitals( rDo ); }
308 
310  { rInf.SetFont( this ); return m_aSub[m_nActual].GetTextSize_( rInf ); }
311 
312  TextFrameIndex GetTextBreak( SwDrawTextInfo const & rInf, long nTextWidth );
313 
315  { return m_aSub[m_nActual].GetCursorOfst_( rInf ); }
316 
317  void DrawText_( SwDrawTextInfo &rInf )
318  { m_aSub[m_nActual].DrawText_( rInf, IsGreyWave() ); }
319 
321  { m_aSub[m_nActual].DrawStretchText_( rInf ); }
322 
323  short CheckKerning()
324  { return m_aSub[m_nActual].CheckKerning(); }
325 
326  sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut )
327  { return m_aSub[m_nActual].GetAscent( pSh, rOut ); }
328  sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut )
329  { return m_aSub[m_nActual].GetHeight( pSh, rOut ); }
330 
331  void Invalidate()
332  { m_bFontChg = m_bOrgChg = true; }
333 
334  void SetTopBorder( const editeng::SvxBorderLine* pTopBorder );
335  void SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder );
336  void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
337  void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
338 
343 
344  // Get absolute border correspond to the layout verticality and orientation.
346  GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
348  GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
350  GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
352  GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
353 
354  void SetTopBorderDist( const sal_uInt16 nTopDist );
355  void SetBottomBorderDist( const sal_uInt16 nBottomDist );
356  void SetRightBorderDist( const sal_uInt16 nRightDist );
357  void SetLeftBorderDist( const sal_uInt16 nLeftDist );
358 
359  sal_uInt16 GetTopBorderDist() const { return m_nTopBorderDist; }
360  sal_uInt16 GetBottomBorderDist() const { return m_nBottomBorderDist; }
361  sal_uInt16 GetRightBorderDist() const { return m_nRightBorderDist; }
362  sal_uInt16 GetLeftBorderDist() const { return m_nLeftBorderDist; }
363 
364  // Return with the whole space which border holed (border width, spacing and shadow width)
365  sal_uInt16 GetTopBorderSpace() const;
366  sal_uInt16 GetBottomBorderSpace() const;
367  sal_uInt16 GetRightBorderSpace() const;
368  sal_uInt16 GetLeftBorderSpace() const;
369 
371  bool HasBorder() const;
372 
373  void SetShadowColor( const Color& rColor );
374  void SetShadowWidth( const sal_uInt16 nWidth );
375  void SetShadowLocation( const SvxShadowLocation aLocation );
376 
377  const Color& GetShadowColor() const { return m_aShadowColor; }
378  sal_uInt16 GetShadowWidth() const { return m_nShadowWidth; }
380 
390  SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout,
391  const bool bVertLayoutLRBT) const;
392 
407  sal_uInt16 CalcShadowSpace(
408  const SvxShadowItemSide nShadow, const bool bVertLayout, const bool bVertLayoutLRBT,
409  const bool bSkipLeft, const bool bSkipRight ) const;
410 
411  void dumpAsXml( xmlTextWriterPtr writer ) const;
412 };
413 
414 inline void SwFont::SetColor( const Color& rColor )
415 {
416  m_bFontChg = true;
417  m_aSub[SwFontScript::Latin].SetColor( rColor );
418  m_aSub[SwFontScript::CJK].SetColor( rColor );
419  m_aSub[SwFontScript::CTL].SetColor( rColor );
420 }
421 
422 // encapsulated SV-Font-method
423 inline void SwSubFont::SetColor( const Color& rColor )
424 {
425  m_nFontCacheId = nullptr;
426  Font::SetColor( rColor );
427 }
428 
429 // encapsulated SV-Font-method
430 inline void SwSubFont::SetFillColor( const Color& rColor )
431 {
432  m_nFontCacheId = nullptr;
433  Font::SetFillColor( rColor );
434 }
435 
436 inline void SwFont::SetFillColor( const Color& rColor )
437 {
438  m_bFontChg = true;
439  m_aSub[SwFontScript::Latin].SetFillColor( rColor );
440  m_aSub[SwFontScript::CJK].SetFillColor( rColor );
441  m_aSub[SwFontScript::CTL].SetFillColor( rColor );
442 }
443 
444 // encapsulated SV-Font-method
445 inline void SwSubFont::SetFamily( const FontFamily eFamily )
446 {
447  m_nFontCacheId = nullptr;
448  Font::SetFamily( eFamily );
449 }
450 
451 inline void SwFont::SetFamily( const FontFamily eFamily, const SwFontScript nWhich )
452 {
453  m_bFontChg = true;
454  m_aSub[nWhich].SetFamily( eFamily );
455 }
456 
457 // encapsulated SV-Font-method
458 inline void SwSubFont::SetName( const OUString& rName )
459 {
460  m_nFontCacheId = nullptr;
461  Font::SetFamilyName( rName );
462 }
463 
464 inline void SwFont::SetName( const OUString& rName, const SwFontScript nWhich )
465 {
466  m_bFontChg = true;
467  m_aSub[nWhich].SetName( rName );
468 }
469 
470 // encapsulated SV-Font-method
471 inline void SwSubFont::SetStyleName( const OUString& rStyleName )
472 {
473  m_nFontCacheId = nullptr;
474  Font::SetStyleName( rStyleName );
475 }
476 
477 inline void SwFont::SetStyleName( const OUString& rStyle, const SwFontScript nWhich )
478 {
479  m_bFontChg = true;
480  m_aSub[nWhich].SetStyleName( rStyle );
481 }
482 
483 // encapsulated SV-Font-method
484 inline void SwSubFont::SetCharSet( const rtl_TextEncoding eCharSet )
485 {
486  m_nFontCacheId = nullptr;
487  Font::SetCharSet( eCharSet );
488 }
489 
490 inline void SwFont::SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScript nWhich )
491 {
492  m_bFontChg = true;
493  m_aSub[nWhich].SetCharSet( eCharSet );
494 }
495 
496 // encapsulated SV-Font-method
497 inline void SwSubFont::SetPitch( const FontPitch ePitch )
498 {
499  m_nFontCacheId = nullptr;
500  Font::SetPitch( ePitch );
501 }
502 
503 // encapsulated SV-Font-method
504 inline void SwFont::SetPitch( const FontPitch ePitch, const SwFontScript nWhich )
505 {
506  m_bFontChg = true;
507  m_aSub[nWhich].SetPitch( ePitch );
508 }
509 
510 // encapsulated SV-Font-method
511 inline void SwSubFont::SetAlign( const FontAlign eAlign )
512 {
513  m_nFontCacheId = nullptr;
514  Font::SetAlignment( eAlign );
515 }
516 
517 inline void SwFont::SetAlign( const FontAlign eAlign )
518 {
519  m_bFontChg = true;
520  m_aSub[SwFontScript::Latin].SetAlign( eAlign );
521  m_aSub[SwFontScript::CJK].SetAlign( eAlign );
522  m_aSub[SwFontScript::CTL].SetAlign( eAlign );
523 }
524 
525 // encapsulated SV-Font-method
526 inline void SwSubFont::SetWeight( const FontWeight eWeight )
527 {
528  m_nFontCacheId = nullptr;
529  Font::SetWeight( eWeight );
530 }
531 
532 inline void SwFont::SetWeight( const FontWeight eWeight, const SwFontScript nWhich )
533 {
534  m_bFontChg = true;
535  m_aSub[nWhich].SetWeight( eWeight );
536 }
537 
538 // encapsulated SV-Font-method
539 inline void SwSubFont::SetUnderline( const FontLineStyle eUnderline )
540 {
541  m_nFontCacheId = nullptr;
542  Font::SetUnderline( eUnderline );
543 }
544 
545 inline void SwFont::SetUnderline( const FontLineStyle eUnderline )
546 {
547  m_bFontChg = true;
548  m_aSub[SwFontScript::Latin].SetUnderline( eUnderline );
549  m_aSub[SwFontScript::CJK].SetUnderline( eUnderline );
550  m_aSub[SwFontScript::CTL].SetUnderline( eUnderline );
551 }
552 
553 // encapsulated SV-Font-method
554 inline void SwSubFont::SetOverline( const FontLineStyle eOverline )
555 {
556  m_nFontCacheId = nullptr;
557  Font::SetOverline( eOverline );
558 }
559 
560 inline void SwFont::SetOverline( const FontLineStyle eOverline )
561 {
562  m_bFontChg = true;
563  m_aSub[SwFontScript::Latin].SetOverline( eOverline );
564  m_aSub[SwFontScript::CJK].SetOverline( eOverline );
565  m_aSub[SwFontScript::CTL].SetOverline( eOverline );
566 }
567 
568 // encapsulated SV-Font-method
569 inline void SwSubFont::SetStrikeout( const FontStrikeout eStrikeout )
570 {
571  m_nFontCacheId = nullptr;
572  Font::SetStrikeout( eStrikeout );
573 }
574 
575 inline void SwFont::SetStrikeout( const FontStrikeout eStrikeout )
576 {
577  m_bFontChg = true;
578  m_aSub[SwFontScript::Latin].SetStrikeout( eStrikeout );
579  m_aSub[SwFontScript::CJK].SetStrikeout( eStrikeout );
580  m_aSub[SwFontScript::CTL].SetStrikeout( eStrikeout );
581 }
582 
583 // encapsulated SV-Font-method
584 inline void SwSubFont::SetItalic( const FontItalic eItalic )
585 {
586  m_nFontCacheId = nullptr;
587  Font::SetItalic( eItalic );
588 }
589 
590 inline void SwFont::SetItalic( const FontItalic eItalic, const SwFontScript nWhich )
591 {
592  m_bFontChg = true;
593  m_aSub[nWhich].SetItalic( eItalic );
594 }
595 
596 // encapsulated SV-Font-method
597 inline void SwSubFont::SetOutline( const bool bOutline )
598 {
599  m_nFontCacheId = nullptr;
600  Font::SetOutline( bOutline );
601 }
602 
603 inline void SwFont::SetOutline( const bool bOutline )
604 {
605  m_bFontChg = true;
606  m_aSub[SwFontScript::Latin].SetOutline( bOutline );
607  m_aSub[SwFontScript::CJK].SetOutline( bOutline );
608  m_aSub[SwFontScript::CTL].SetOutline( bOutline );
609 }
610 
611 // encapsulated SV-Font-method
612 inline void SwSubFont::SetShadow( const bool bShadow )
613 {
614  m_nFontCacheId = nullptr;
615  Font::SetShadow( bShadow );
616 }
617 
618 inline void SwFont::SetShadow( const bool bShadow )
619 {
620  m_bFontChg = true;
621  m_aSub[SwFontScript::Latin].SetShadow( bShadow );
622  m_aSub[SwFontScript::CJK].SetShadow( bShadow );
623  m_aSub[SwFontScript::CTL].SetShadow( bShadow );
624 }
625 
626 // encapsulated SV-Font-method
627 inline void SwSubFont::SetAutoKern( FontKerning nAutoKern )
628 {
629  m_nFontCacheId = nullptr;
630  Font::SetKerning( nAutoKern );
631 }
632 
633 inline void SwFont::SetAutoKern( FontKerning nAutoKern )
634 {
635  m_bFontChg = true;
636  m_aSub[SwFontScript::CJK].SetAutoKern( nAutoKern );
637  if( nAutoKern != FontKerning::NONE )
638  nAutoKern = FontKerning::FontSpecific;
639  m_aSub[SwFontScript::Latin].SetAutoKern( nAutoKern );
640  m_aSub[SwFontScript::CTL].SetAutoKern( nAutoKern );
641 }
642 
643 inline void SwFont::SetTransparent( const bool bTrans )
644 {
645  m_aSub[SwFontScript::Latin].SetTransparent( bTrans );
646  m_aSub[SwFontScript::CJK].SetTransparent( bTrans );
647  m_aSub[SwFontScript::CTL].SetTransparent( bTrans );
648 }
649 
650 inline void SwFont::SetFixKerning( const short nNewKern )
651 {
652  m_aSub[SwFontScript::Latin].SetFixKerning( nNewKern );
653  m_aSub[SwFontScript::CJK].SetFixKerning( nNewKern );
654  m_aSub[SwFontScript::CTL].SetFixKerning( nNewKern );
655 }
656 
657 inline void SwFont::SetCaseMap( const SvxCaseMap eNew )
658 {
659  m_aSub[SwFontScript::Latin].SetCaseMap( eNew );
660  m_aSub[SwFontScript::CJK].SetCaseMap( eNew );
661  m_aSub[SwFontScript::CTL].SetCaseMap( eNew );
662 }
663 
664 // encapsulated SV-Font-method
665 inline void SwSubFont::SetWordLineMode( const bool bWordLineMode )
666 {
667  m_nFontCacheId = nullptr;
668  Font::SetWordLineMode( bWordLineMode );
669 }
670 
671 inline void SwFont::SetWordLineMode( const bool bWordLineMode )
672 {
673  m_bFontChg = true;
674  m_aSub[SwFontScript::Latin].SetWordLineMode( bWordLineMode );
675  m_aSub[SwFontScript::CJK].SetWordLineMode( bWordLineMode );
676  m_aSub[SwFontScript::CTL].SetWordLineMode( bWordLineMode );
677 }
678 // encapsulated SV-Font-method
679 inline void SwSubFont::SetEmphasisMark( const FontEmphasisMark eValue )
680 {
681  m_nFontCacheId = nullptr;
682  Font::SetEmphasisMark( eValue );
683 }
684 
685 inline void SwFont::SetEmphasisMark( const FontEmphasisMark eValue )
686 {
687  m_bFontChg = true;
688  m_aSub[SwFontScript::Latin].SetEmphasisMark( eValue );
689  m_aSub[SwFontScript::CJK].SetEmphasisMark( eValue );
690  m_aSub[SwFontScript::CTL].SetEmphasisMark( eValue );
691 }
692 
693 inline void SwFont::SetPropWidth( const sal_uInt16 nNew )
694 {
695  if( nNew != m_aSub[SwFontScript::Latin].GetPropWidth() )
696  {
697  m_bFontChg = true;
698  m_aSub[SwFontScript::Latin].SetPropWidth( nNew );
699  m_aSub[SwFontScript::CJK].SetPropWidth( nNew );
700  m_aSub[SwFontScript::CTL].SetPropWidth( nNew );
701  }
702 }
703 
704 // encapsulated SV-Font-method
705 inline void SwSubFont::SetRelief( const FontRelief eNew )
706 {
707  m_nFontCacheId = nullptr;
708  Font::SetRelief( eNew );
709 }
710 
711 inline void SwFont::SetRelief( const FontRelief eNew )
712 {
713  if( eNew != m_aSub[SwFontScript::Latin].GetRelief() )
714  {
715  m_bFontChg = true;
716  m_aSub[SwFontScript::Latin].SetRelief( eNew );
717  m_aSub[SwFontScript::CJK].SetRelief( eNew );
718  m_aSub[SwFontScript::CTL].SetRelief( eNew );
719  }
720 }
721 
722 // overloaded font-method
723 inline void SwSubFont::SetSize( const Size& rSize )
724 {
725  m_aSize = rSize;
726  if ( GetPropr() == 100 )
727  Font::SetFontSize( m_aSize );
728  else
729  {
730  Font::SetFontSize( Size(
731  m_aSize.Width() * GetPropr() / 100,
732  m_aSize.Height() * GetPropr() / 100 ) );
733  }
734  m_nFontCacheId = nullptr;
735 }
736 
737 inline void SwFont::SetSize( const Size& rSize, const SwFontScript nWhich )
738 {
739  if( m_aSub[nWhich].m_aSize != rSize )
740  {
741  m_aSub[nWhich].SetSize( rSize );
742  m_bFontChg = true;
743  m_bOrgChg = true;
744  }
745 }
746 
747 inline void SwFont::SetActual( SwFontScript nNew )
748 {
749  if ( m_nActual != nNew )
750  {
751  m_bFontChg = true;
752  m_bOrgChg = true;
753  m_nActual = nNew;
754  }
755 }
756 
757 inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr )
758 {
759  m_nFontCacheId = nullptr;
760  Font::SetFontSize( Size( m_aSize.Width() * nNewPropr / 100,
761  m_aSize.Height() * nNewPropr / 100 ) );
762  SvxFont::SetPropr( nNewPropr );
763 }
764 
765 inline void SwFont::SetProportion( const sal_uInt8 nNewPropr )
766 {
767  if( nNewPropr != m_aSub[SwFontScript::Latin].GetPropr() )
768  {
769  m_bFontChg = true;
770  m_bOrgChg = true;
771 
772  m_aSub[SwFontScript::Latin].SetProportion( nNewPropr );
773  m_aSub[SwFontScript::CJK].SetProportion( nNewPropr );
774  m_aSub[SwFontScript::CTL].SetProportion( nNewPropr );
775  }
776 }
777 
778 inline void SwSubFont::SetEscapement( const short nNewEsc )
779 {
780  m_nFontCacheId = nullptr;
781  SvxFont::SetEscapement( nNewEsc );
782 }
783 
784 inline void SwFont::SetEscapement( const short nNewEsc )
785 {
786  if( nNewEsc != m_aSub[SwFontScript::Latin].GetEscapement() )
787  {
788  // these have to be set, otherwise nOrgHeight and nOrgAscent will not
789  // be calculated
790  m_bFontChg = true;
791  m_bOrgChg = true;
792 
793  m_aSub[SwFontScript::Latin].SetEscapement( nNewEsc );
794  m_aSub[SwFontScript::CJK].SetEscapement( nNewEsc );
795  m_aSub[SwFontScript::CTL].SetEscapement( nNewEsc );
796  }
797 }
798 
799 inline void SwSubFont::SetLanguage( LanguageType eNewLang )
800 {
801  m_nFontCacheId = nullptr;
802  if( eNewLang == LANGUAGE_SYSTEM )
803  eNewLang = GetAppLanguage();
804  SvxFont::SetLanguage( eNewLang );
805 }
806 
807 inline void SwFont::SetLanguage( const LanguageType eNewLang, const SwFontScript nWhich )
808 {
809  m_aSub[nWhich].SetLanguage( eNewLang );
810  if( SwFontScript::CJK == nWhich )
811  {
812  m_aSub[SwFontScript::Latin].SetCJKContextLanguage( eNewLang );
813  m_aSub[SwFontScript::CJK].SetCJKContextLanguage( eNewLang );
814  m_aSub[SwFontScript::CTL].SetCJKContextLanguage( eNewLang );
815  }
816 }
817 
818 inline void SwFont::SetBlink( const bool bNew )
819 {
820  m_bBlink = bNew;
821 }
822 
823 inline void SwFont::SetGreyWave( const bool bNew )
824 {
825  m_bGreyWave = bNew;
826 }
827 
828 inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const bool bVertFormat )
829 {
830  m_nFontCacheId = nullptr;
831  Font::SetVertical( bVertFormat );
832  Font::SetOrientation( nDir );
833 }
834 
835 inline void SwFont::SetTopBorderDist( const sal_uInt16 nTopDist )
836 {
837  m_nTopBorderDist = nTopDist;
838  m_bFontChg = true;
839  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
840 }
841 
842 inline void SwFont::SetBottomBorderDist( const sal_uInt16 nBottomDist )
843 {
844  m_nBottomBorderDist = nBottomDist;
845  m_bFontChg = true;
846  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
847 }
848 
849 inline void SwFont::SetRightBorderDist( const sal_uInt16 nRightDist )
850 {
851  m_nRightBorderDist = nRightDist;
852  m_bFontChg = true;
853  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
854 }
855 
856 inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
857 {
858  m_nLeftBorderDist = nLeftDist;
859  m_bFontChg = true;
860  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
861 }
862 
863 inline sal_uInt16 SwFont::GetTopBorderSpace() const
864 {
865  sal_uInt16 nRet = 0;
866  if( m_aTopBorder )
867  {
868  nRet += m_aTopBorder.get().GetScaledWidth() + m_nTopBorderDist;
869  }
870  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
871  m_aShadowLocation == SvxShadowLocation::TopRight )
872  {
873  nRet += m_nShadowWidth;
874  }
875  return nRet;
876 }
877 
878 inline sal_uInt16 SwFont::GetBottomBorderSpace() const
879 {
880  sal_uInt16 nRet = 0;
881  if( m_aBottomBorder )
882  {
883  nRet += m_aBottomBorder.get().GetScaledWidth() + m_nBottomBorderDist;
884  }
885  if( m_aShadowLocation == SvxShadowLocation::BottomLeft ||
886  m_aShadowLocation == SvxShadowLocation::BottomRight )
887  {
888  nRet += m_nShadowWidth;
889  }
890  return nRet;
891 }
892 
893 inline sal_uInt16 SwFont::GetRightBorderSpace() const
894 {
895  sal_uInt16 nRet = 0;
896  if( m_aRightBorder )
897  {
898  nRet += m_aRightBorder.get().GetScaledWidth() + m_nRightBorderDist;
899  }
900  if( m_aShadowLocation == SvxShadowLocation::TopRight ||
901  m_aShadowLocation == SvxShadowLocation::BottomRight )
902  {
903  nRet += m_nShadowWidth;
904  }
905  return nRet;
906 }
907 
908 inline sal_uInt16 SwFont::GetLeftBorderSpace() const
909 {
910  sal_uInt16 nRet = 0;
911  if( m_aLeftBorder )
912  {
913  nRet += m_aLeftBorder.get().GetScaledWidth() + m_nLeftBorderDist;
914  }
915  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
916  m_aShadowLocation == SvxShadowLocation::BottomLeft )
917  {
918  nRet += m_nShadowWidth;
919  }
920  return nRet;
921 }
922 
923 inline bool SwFont::HasBorder() const
924 {
926 }
927 
928 inline void SwFont::SetShadowColor( const Color& rColor )
929 {
930  m_aShadowColor = rColor;
931  m_bFontChg = true;
932  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
933 }
934 
935 inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth )
936 {
937  m_nShadowWidth = nWidth;
938  m_bFontChg = true;
939  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
940 }
941 
942 inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation )
943 {
944  m_aShadowLocation = aLocation;
945  m_bFontChg = true;
946  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
947 }
948 
949 inline void SwFont::SetHighlightColor( const Color& aNewColor )
950 {
951  m_aHighlightColor = aNewColor;
952  m_bFontChg = true;
953  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
954 }
955 
956 // Used for the "continuous underline" feature.
958 {
961  std::unique_ptr<SwFont> m_pFont;
962 
963 public:
964  // sets the font which should paint the common baseline,
965  // index where continuous underline ends,
966  // and the starting point of the common baseline
967  SwUnderlineFont(SwFont& rFnt, TextFrameIndex nEnd, const Point& rPoint);
969 
971  {
972  OSL_ENSURE( m_pFont, "No underline font" );
973  return *m_pFont;
974  }
975  const Point& GetPos() const { return m_aPos; }
976  TextFrameIndex GetEnd() const { return m_nEnd; }
977  // the x coordinate of the starting point has to be set for each portion
978  void SetPos( const Point& rPoint ) { m_aPos = rPoint; }
979 };
980 
981 #ifdef DBG_UTIL
982 
984 {
985 public:
986  sal_uInt16 nGetTextSize;
987  sal_uInt16 nDrawText;
989  sal_uInt16 nDrawStretchText;
990  sal_uInt16 nChangeFont;
991 
993  { nGetTextSize = nDrawText = nGetStretchTextSize = nDrawStretchText = nChangeFont = 0; }
994 };
995 
996 // global variable, implemented in swfont.cxx
997 extern SvStatistics g_SvStat;
998 
999 #define SV_STAT(nWhich) ++(g_SvStat.nWhich);
1000 
1001 
1002 #else
1003 #define SV_STAT(nWhich)
1004 #endif /* DBG_UTIL */
1005 
1006 #endif
1007 
1008 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
Definition: swfont.hxx:856
long Width() const
rtl_TextEncoding GetCharSet(const SwFontScript nWhich) const
Definition: swfont.hxx:294
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
boost::optional< editeng::SvxBorderLine > m_aTopBorder
Definition: swfont.hxx:143
void SetPropr(const sal_uInt8 nNewPropr)
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:908
sal_uInt16 GetShadowWidth() const
Definition: swfont.hxx:378
sal_uInt8 GetPropr() const
short CheckKerning()
Definition: swfont.hxx:323
void SetFamily(const FontFamily eFamily)
Definition: swfont.hxx:445
boost::optional< editeng::SvxBorderLine > m_aRightBorder
Definition: swfont.hxx:145
const sal_Unicode CH_NB_SPACE
Definition: swfont.hxx:48
~SwFont()
Definition: swfont.cxx:903
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:671
TextFrameIndex GetCursorOfst_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1365
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.cxx:1027
SwSubFont()
Definition: swfont.hxx:117
bool m_bSmallCapsPercentage66
Definition: swfont.hxx:62
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:377
sal_uInt16 m_nOrgAscent
Definition: swfont.hxx:60
SvxCaseMap
void SetName(const OUString &rName)
Definition: swfont.hxx:458
long Height() const
const Color & GetUnderColor() const
Definition: swfont.hxx:272
bool IsInputField() const
Definition: swfont.hxx:257
sal_uInt8 GetPropr() const
Definition: swfont.hxx:280
sal_uInt16 GetTopBorderDist() const
Definition: swfont.hxx:359
sal_uInt16 GetRightBorderSpace() const
Definition: swfont.hxx:893
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:430
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:436
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:955
FontEmphasisMark
bool IsMeta() const
Definition: swfont.hxx:255
void SetGreyWave(const bool bNew)
Definition: swfont.hxx:823
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:539
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:309
void SetBackColor(Color *pNewColor)
Definition: swfont.cxx:68
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
Definition: swfont.hxx:201
const SvxFont & GetActualFont() const
Definition: swfont.hxx:185
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:685
void SetSize(const Size &rSize)
Definition: swfont.hxx:723
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
Definition: swfont.cxx:1398
bool HasBorder() const
Check whether font has any border on any side.
Definition: swfont.hxx:923
const sal_Unicode CH_BULLET
Definition: swfont.hxx:46
bool IsSymbol(SwViewShell const *pSh)
Definition: swfont.hxx:269
const Size & GetSize(SwFontScript nWhich) const
Definition: swfont.hxx:205
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:275
TextFrameIndex const m_nEnd
Definition: swfont.hxx:960
bool m_bPaintBlank
Definition: swfont.hxx:167
void SetOutline(const bool bOutline)
Definition: swfont.hxx:603
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:693
void dumpAsXml(xmlTextWriterPtr writer) const
Definition: xmldump.cxx:533
Color m_aShadowColor
Definition: swfont.hxx:154
sal_uInt16 GetOrientation(const bool bVertLayout=false, const bool bVertFormatLRBT=false) const
Definition: swfont.cxx:436
const boost::optional< editeng::SvxBorderLine > & GetRightBorder() const
Definition: swfont.hxx:341
sal_uInt8 & GetRef()
Definition: swfont.hxx:252
bool m_bFontChg
Definition: swfont.hxx:168
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
Definition: swfont.hxx:842
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:504
sal_uInt16 m_nLeftBorderDist
Definition: swfont.hxx:152
void DrawText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:317
void DrawCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:305
void SetColor(const Color &rColor)
Definition: swfont.hxx:414
bool IsGreyWave() const
Definition: swfont.hxx:259
void SetShadow(const bool bShadow)
Definition: swfont.hxx:618
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:253
Color m_aOverColor
Definition: swfont.hxx:140
void SetPitch(const FontPitch ePitch)
Definition: swfont.hxx:497
const Color & GetOverColor() const
Definition: swfont.hxx:274
SwUnderlineFont(SwFont &rFnt, TextFrameIndex nEnd, const Point &rPoint)
Definition: swfont.cxx:1509
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:326
sal_uInt16 GetRightBorderDist() const
Definition: swfont.hxx:361
void SetFntChg(const bool bNew)
Definition: swfont.hxx:208
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1283
SvxCaseMap GetCaseMap() const
Definition: swfont.hxx:279
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
Definition: swfont.hxx:134
SwFont(const SwAttrSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
Definition: swfont.cxx:745
sal_uInt16 m_nFontIndex
Definition: swfont.hxx:58
void SetShadowColor(const Color &rColor)
Definition: swfont.hxx:928
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:545
void SetShadowLocation(const SvxShadowLocation aLocation)
Definition: swfont.hxx:942
FontEmphasisMark GetEmphasisMark() const
Definition: swfont.hxx:285
void ChgPhysFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:972
sal_uInt16 UnMapDirection(sal_uInt16 nDir, const bool bVertFormat, const bool bVertFormatLRBT)
Definition: swfont.cxx:397
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.cxx:1034
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:575
void SetLanguage(LanguageType eNewLang)
Definition: swfont.hxx:799
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:517
sal_uInt16 m_nProportionalWidth
Definition: swfont.hxx:61
FontKerning
void SetItalic(const FontItalic eItalic)
Definition: swfont.hxx:584
SwFontScript GetActual() const
Definition: swfont.hxx:183
void SetLeftBorder(const editeng::SvxBorderLine *pLeftBorder)
Definition: swfont.cxx:114
bool IsFntChg() const
Definition: swfont.hxx:207
Color m_aHighlightColor
Definition: swfont.hxx:138
struct _xmlTextWriter * xmlTextWriterPtr
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:554
void SetStyleName(const OUString &rStyleName, const SwFontScript nWhich)
Definition: swfont.hxx:477
void SetTransparent(const bool bTrans)
Definition: swfont.hxx:643
bool IsTox() const
Definition: swfont.hxx:251
void SetCharSet(const rtl_TextEncoding eCharSet)
Definition: swfont.hxx:484
SvxShadowItemSide
void SetLanguage(LanguageType eNewLang, const SwFontScript nWhich)
Definition: swfont.hxx:807
SwFontScript m_nActual
Definition: swfont.hxx:163
void SetRightBorder(const editeng::SvxBorderLine *pRightBorder)
Definition: swfont.cxx:101
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:665
sal_uInt8 m_nInputFieldCount
Definition: swfont.hxx:161
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:778
void SetUnderColor(const Color &rColor)
Definition: swfont.hxx:215
void SetRightBorderDist(const sal_uInt16 nRightDist)
Definition: swfont.hxx:849
SvStatistics g_SvStat
Definition: swfont.cxx:62
const sal_Unicode CH_FULL_BLANK
Definition: swfont.hxx:47
void SetShadowWidth(const sal_uInt16 nWidth)
Definition: swfont.hxx:935
const Point & GetPos() const
Definition: swfont.hxx:975
void DrawStretchCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:446
void SetCaseMap(const SvxCaseMap eNew)
Definition: swfont.hxx:657
#define LANGUAGE_SYSTEM
const sal_Unicode CH_TAB
Definition: swfont.hxx:44
void CheckFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
Definition: swfont.hxx:195
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
Definition: swfont.cxx:1150
Size GetCapitalSize(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:133
sal_uInt16 GetBottomBorderDist() const
Definition: swfont.hxx:360
const Color * GetBackColor() const
Definition: swfont.hxx:191
FontLineStyle GetOverline() const
Definition: swfont.hxx:273
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
long GetHeight() const
Definition: swfont.hxx:283
bool m_bOrgChg
Definition: swfont.hxx:169
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:863
SwFont & GetFont()
Definition: swfont.hxx:970
TextFrameIndex GetEnd() const
Definition: swfont.hxx:976
sal_uInt16 GetPropWidth() const
Definition: swfont.hxx:119
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:711
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:757
sal_uInt16 nChangeFont
Definition: swfont.hxx:990
const boost::optional< editeng::SvxBorderLine > & GetLeftBorder() const
Definition: swfont.hxx:342
void SetShadow(const bool bShadow)
Definition: swfont.hxx:612
sal_uInt8 m_nToxCount
Definition: swfont.hxx:158
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:784
Provides access to settings of a document.
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:320
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:532
sal_uInt8 & GetMeta()
Definition: swfont.hxx:254
FontPitch
const boost::optional< editeng::SvxBorderLine > & GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:152
const boost::optional< editeng::SvxBorderLine > & GetBottomBorder() const
Definition: swfont.hxx:340
const Color & GetColor() const
Definition: swfont.hxx:276
void DoOnCapitals(SwDoCapitals &rDo)
Definition: swfont.hxx:306
void SetPos(const Point &rPoint)
Definition: swfont.hxx:978
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:627
void SetOverColor(const Color &rColor)
Definition: swfont.hxx:217
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:511
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:114
bool IsPaintBlank() const
Definition: swfont.hxx:260
sal_uInt16 m_nBottomBorderDist
Definition: swfont.hxx:150
void SetFixKerning(const short nNewKern)
Definition: swfont.hxx:650
sal_uInt16 nGetStretchTextSize
Definition: swfont.hxx:988
TextFrameIndex GetTextBreak(SwDrawTextInfo const &rInf, long nTextWidth)
Definition: fntcache.cxx:2382
const boost::optional< editeng::SvxBorderLine > & GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:128
bool IsBlink() const
Definition: swfont.hxx:249
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:306
FontLineStyle GetUnderline() const
Definition: swfont.hxx:271
void SetBottomBorder(const editeng::SvxBorderLine *pBottomBorder)
Definition: swfont.cxx:88
sal_uInt16 GetLeftBorderDist() const
Definition: swfont.hxx:362
void SetOutline(const bool bOutline)
Definition: swfont.hxx:597
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1047
SwFont & operator=(const SwFont &rFont)
Definition: swfont.cxx:907
FontFamily
const OUString & GetName(const SwFontScript nWhich) const
Definition: swfont.hxx:290
std::unique_ptr< SwFont > m_pFont
Definition: swfont.hxx:961
void SetStyleName(const OUString &rStyleName)
Definition: swfont.hxx:471
FontWeight GetWeight() const
Definition: swfont.hxx:284
sal_uInt16 GetHeight(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.hxx:328
bool IsSymbol(SwViewShell const *pSh)
Definition: swfont.cxx:949
LanguageType GetLanguage() const
Definition: swfont.hxx:282
void DoOnCapitals(SwDoCapitals &rDo)
Definition: fntcap.cxx:464
FontWeight
std::unique_ptr< Color > m_pBackColor
Definition: swfont.hxx:137
const void * m_nFontCacheId
Definition: swfont.hxx:56
boost::optional< editeng::SvxBorderLine > m_aLeftBorder
Definition: swfont.hxx:146
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:705
TextFrameIndex GetCursorOfst_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:314
sal_uInt8 & GetInputField()
Definition: swfont.hxx:256
boost::optional< editeng::SvxBorderLine > m_aBottomBorder
Definition: swfont.hxx:144
bool m_bBlink
Definition: swfont.hxx:166
sal_uInt8 & GetTox()
Definition: swfont.hxx:250
void SetSize(const Size &rSize, const SwFontScript nWhich)
Definition: swfont.hxx:737
void SetFontCacheId(const void *nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich)
Definition: swfont.hxx:199
unsigned char sal_uInt8
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:483
SvxShadowLocation GetShadowLocation() const
Definition: swfont.hxx:379
sal_uInt16 nDrawText
Definition: swfont.hxx:987
FontItalic GetItalic() const
Definition: swfont.hxx:281
void SetTopBorder(const editeng::SvxBorderLine *pTopBorder)
Definition: swfont.cxx:75
sal_uInt8 m_nRefCount
Definition: swfont.hxx:159
void SetVertical(const sal_uInt16 nDir, const bool bVertFormat)
Definition: swfont.hxx:828
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:747
void SetBlink(const bool bBlink)
Definition: swfont.hxx:818
short CheckKerning_()
Definition: swfont.cxx:1018
LanguageType GetAppLanguage()
Definition: init.cxx:729
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
Definition: swfont.hxx:451
const boost::optional< editeng::SvxBorderLine > & GetTopBorder() const
Definition: swfont.hxx:339
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
Definition: swfont.hxx:490
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:878
SwFontScript
Definition: swfont.hxx:122
void SetWeight(const FontWeight eWeight)
Definition: swfont.hxx:526
const Color & GetHighlightColor() const
Definition: swfont.hxx:193
void Invalidate()
Definition: swfont.hxx:331
const Color & GetShadowColor() const
Definition: swfont.hxx:377
sal_uInt16 nDrawStretchText
Definition: swfont.hxx:989
void SetLanguage(SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:223
void SetName(const OUString &rName, const SwFontScript nWhich)
Definition: swfont.hxx:464
long GetHeight(const SwFontScript nWhich) const
Definition: swfont.hxx:296
const boost::optional< editeng::SvxBorderLine > & GetAbsLeftBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:176
short GetFixKerning() const
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:633
void SetFont(SwFont *pNew)
Definition: drawfont.hxx:448
void SetDiffFnt(const SfxItemSet *pSet, const IDocumentSettingAccess *pIDocumentSettingAccess)
Definition: swfont.cxx:496
SvxShadowLocation m_aShadowLocation
Definition: swfont.hxx:156
const sal_Unicode CH_PAR
Definition: swfont.hxx:45
LanguageType GetLanguage(const SwFontScript nWhich) const
Definition: swfont.hxx:292
void SetItalic(const FontItalic eItalic, const SwFontScript nWhich)
Definition: swfont.hxx:590
Size m_aSize
Definition: swfont.hxx:57
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:1002
sal_uInt16 m_nTopBorderDist
Definition: swfont.hxx:149
bool IsWordLineMode() const
Definition: swfont.hxx:277
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:679
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:765
SvxShadowLocation GetAbsShadowLocation(const bool bVertLayout, const bool bVertLayoutLRBT) const
Get the absolute shadow location dependent from orientation.
Definition: swfont.cxx:223
void SetVertical(sal_uInt16 nDir, const bool bVertLayout=false, const bool bVertLayoutLRBT=false)
Definition: swfont.cxx:441
void SetHighlightColor(const Color &aNewColor)
Definition: swfont.hxx:949
FontLineStyle
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.hxx:176
Color m_aUnderColor
Definition: swfont.hxx:139
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:569
short GetEscapement() const
Definition: swfont.hxx:278
sal_uInt16 nGetTextSize
Definition: swfont.hxx:986
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:560
FontStrikeout
TextFrameIndex GetCapitalBreak(SwViewShell const *pSh, const OutputDevice *pOut, const SwScriptInfo *pScript, const OUString &rText, long nTextWidth, TextFrameIndex nIdx, TextFrameIndex nLen)
Definition: fntcap.cxx:211
void SetTopBorderDist(const sal_uInt16 nTopDist)
Definition: swfont.hxx:835
FontRelief
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:266
void AllocFontCacheId(SwViewShell const *pSh, SwFontScript nWhich)
Definition: swfont.cxx:943
const boost::optional< editeng::SvxBorderLine > & GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const
Definition: swfont.cxx:200
FontItalic
SvxShadowLocation
short CheckKerning()
Definition: swfont.hxx:112
void SetColor(const Color &rColor)
Definition: swfont.hxx:423
const sal_Unicode CH_SIX_PER_EM
Definition: swfont.hxx:49
bool m_bGreyWave
Definition: swfont.hxx:170
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)
Definition: swfont.hxx:197