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 
48 sal_uInt16 UnMapDirection( sal_uInt16 nDir, const bool bVertFormat, const bool bVertFormatLRBT );
49 
50 class SwSubFont : public SvxFont
51 {
52  friend class SwFont;
53  const void* m_nFontCacheId; // "MagicNumber" within the font cache
54  Size m_aSize; // foreigners only see this size
55  sal_uInt16 m_nFontIndex; // index in the font cache
56  sal_uInt16 m_nOrgHeight; // height including escapement/proportion
57  sal_uInt16 m_nOrgAscent; // ascent including escapement/proportion
58  sal_uInt16 m_nProportionalWidth; // proportional width
60 
61  sal_uInt16 CalcEscAscent( const sal_uInt16 nOldAscent ) const;
62  sal_uInt16 CalcEscHeight( const sal_uInt16 nOldHeight,
63  const sal_uInt16 nOldAscent ) const;
64  void CalcEsc( SwDrawTextInfo const & rInf, Point& rPos );
65 
66  short CheckKerning_( );
67 
68  bool ChgFnt( SwViewShell const *pSh, OutputDevice& rOut );
69  bool IsSymbol( SwViewShell const *pSh );
70  sal_uInt16 GetAscent( SwViewShell const *pSh, const OutputDevice& rOut );
71  sal_uInt16 GetHeight( SwViewShell const *pSh, const OutputDevice& rOut );
74  void DrawText_( SwDrawTextInfo &rInf, const bool bGrey );
75  void DrawCapital( SwDrawTextInfo &rInf );
76  void DrawStretchCapital( SwDrawTextInfo &rInf );
77  void DoOnCapitals( SwDoCapitals &rDo );
78  void DrawStretchText_( SwDrawTextInfo &rInf );
81 
82  inline void SetColor( const Color& rColor );
83  inline void SetFillColor( const Color& rColor );
84  inline void SetCharSet( const rtl_TextEncoding eCharSet );
85  inline void SetPitch( const FontPitch ePitch );
86  inline void SetAlign( const FontAlign eAlign );
87  inline void SetUnderline( const FontLineStyle eUnderline );
88  inline void SetOverline( const FontLineStyle eOverline );
89  inline void SetStrikeout( const FontStrikeout eStrikeout );
90  inline void SetItalic( const FontItalic eItalic );
91  inline void SetOutline( const bool bOutline );
92  inline void SetVertical( const sal_uInt16 nDir, const bool bVertFormat );
93  inline void SetShadow( const bool bShadow );
94  inline void SetAutoKern( FontKerning nAutoKern );
95  inline void SetWordLineMode( const bool bWordLineMode );
96  inline void SetEmphasisMark( const FontEmphasisMark eValue );
97  inline void SetRelief( const FontRelief eNew );
98 
99  // methods for sub-/superscript
100  inline void SetEscapement( const short nNewEsc );
101  inline void SetProportion( const sal_uInt8 nNewPropr );
102 
103  inline void SetFamily( const FontFamily eFamily );
104  inline void SetName( const OUString& rName );
105  inline void SetStyleName( const OUString& rStyleName );
106  inline void SetSize( const Size& rSize );
107  inline void SetWeight( const FontWeight eWeight );
108  inline void SetLanguage( LanguageType eNewLang );
109  short CheckKerning()
110  { return GetFixKerning() >= 0 ? GetFixKerning() : CheckKerning_( ); }
111  void SetPropWidth( const sal_uInt16 nNew )
112  { m_nFontCacheId = nullptr; m_nProportionalWidth = nNew; }
113 public:
114  SwSubFont() : m_aSize(0,0)
115  { m_nFontCacheId = nullptr; m_nFontIndex = m_nOrgHeight = m_nOrgAscent = 0; m_nProportionalWidth =100; m_bSmallCapsPercentage66 = false; }
116  sal_uInt16 GetPropWidth() const { return m_nProportionalWidth; }
117 };
118 
119 enum class SwFontScript
120 {
121  Latin, CJK, CTL, LAST = CTL
122 };
123 
124 // mostly used as a "unknown script" marker
125 #define SW_SCRIPTS (SwFontScript(int(SwFontScript::LAST)+1))
126 
128 {
129  // CJK == Chinese, Japanese, Korean
130  // CTL == Complex text layout ( Hebrew, Arabic )
131  o3tl::enumarray<SwFontScript, SwSubFont> m_aSub; // Latin-, CJK- and CTL-font
132 
133  std::unique_ptr<Color>
134  m_pBackColor; // background color (i.e. at character styles)
135  Color m_aHighlightColor; // highlight color
136  Color m_aUnderColor; // color of the underlining
137  Color m_aOverColor; // color of the overlining
138 
139  // character borders
144 
145  // border distance
146  sal_uInt16 m_nTopBorderDist;
148  sal_uInt16 m_nRightBorderDist;
149  sal_uInt16 m_nLeftBorderDist;
150 
152  sal_uInt16 m_nShadowWidth;
154 
155  sal_uInt8 m_nToxCount; // counts the nesting depth of the Tox
156  sal_uInt8 m_nRefCount; // counts the nesting depth of the Refs
157  sal_uInt8 m_nMetaCount; // count META/METAFIELD
158  sal_uInt8 m_nInputFieldCount; // count INPUTFIELD
159 
160  SwFontScript m_nActual; // actual font (Latin, CJK or CTL)
161 
162  // switch for the font-extensions
163  bool m_bBlink :1; // blinking font
164  bool m_bPaintBlank :1; // blanks not with DrawRect
165  bool m_bFontChg :1;
166  bool m_bOrgChg :1; // nOrgHeight/Ascent are invalid
167  bool m_bGreyWave :1; // for the extended TextInput: gray waveline
168 
169 public:
170  SwFont( const SwAttrSet* pSet, const IDocumentSettingAccess* pIDocumentSettingAccess );
171  SwFont( const SwFont& rFont );
172 
173  void ChgFnt( SwViewShell const *pSh, OutputDevice& rOut )
174  { m_bPaintBlank = m_aSub[m_nActual].ChgFnt( pSh, rOut ); }
175 
176  ~SwFont();
177 
178  SwFont& operator=( const SwFont &rFont );
179 
180  SwFontScript GetActual() const { return m_nActual; }
181  inline void SetActual( SwFontScript nNew );
182  const SvxFont& GetActualFont() const { return m_aSub[m_nActual]; }
183 
184  // gets a font cache id via SwFntAccess
185  void AllocFontCacheId( SwViewShell const *pSh, SwFontScript nWhich );
186  // set background color
187  void SetBackColor( Color* pNewColor );
188  const Color* GetBackColor() const{ return m_pBackColor.get(); }
189  void SetHighlightColor( const Color& aNewColor );
190  const Color& GetHighlightColor() const { return m_aHighlightColor; }
191 
192  void CheckFontCacheId( SwViewShell const *pSh, SwFontScript nWhich )
193  { if( !m_aSub[ nWhich ].m_nFontCacheId ) AllocFontCacheId( pSh, nWhich ); }
194  void GetFontCacheId( const void* &rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich )
195  { rnFontCacheId = m_aSub[nWhich].m_nFontCacheId; rIdx = m_aSub[nWhich].m_nFontIndex; }
196  void SetFontCacheId( const void* nNewFontCacheId, const sal_uInt16 nIdx, SwFontScript nWhich )
197  { m_aSub[nWhich].m_nFontCacheId = nNewFontCacheId; m_aSub[nWhich].m_nFontIndex = nIdx; }
198  bool DifferentFontCacheId( const SwFont* pFnt, SwFontScript nWhich )
199  { return m_aSub[nWhich].m_nFontCacheId != pFnt->m_aSub[nWhich].m_nFontCacheId ||
200  !m_aSub[nWhich].m_nFontCacheId || !pFnt->m_aSub[nWhich].m_nFontCacheId; }
201 
202  const Size &GetSize( SwFontScript nWhich ) const
203  { return m_aSub[nWhich].m_aSize; }
204  bool IsFntChg() const { return m_bFontChg; }
205  void SetFntChg( const bool bNew ) { m_bFontChg = bNew; }
206 
207  // the encapsulated SV-Font-methods (set bFntChg to true)
208  inline void SetColor( const Color& rColor );
209  inline void SetFillColor( const Color& rColor );
210  inline void SetAlign( const FontAlign eAlign );
211  inline void SetUnderline( const FontLineStyle eUnderline );
212  void SetUnderColor( const Color &rColor ) { m_aUnderColor = rColor; }
213  inline void SetOverline( const FontLineStyle eOverline );
214  void SetOverColor( const Color &rColor ) { m_aOverColor = rColor; }
215  inline void SetStrikeout( const FontStrikeout eStrikeout );
216  inline void SetOutline( const bool bOutline );
217  void SetVertical(sal_uInt16 nDir, const bool bVertLayout = false,
218  const bool bVertLayoutLRBT = false);
219  inline void SetShadow( const bool bShadow );
220  inline void SetAutoKern( FontKerning nAutoKern );
221  inline void SetTransparent( const bool bTrans );
222  inline void SetWordLineMode( const bool bWordLineMode );
223  inline void SetFixKerning( const short nNewKern );
224  inline void SetCaseMap( const SvxCaseMap eNew );
225  inline void SetEmphasisMark( const FontEmphasisMark eValue );
226 
227  // methods for sub-/superscript
228  inline void SetEscapement( const short nNewEsc );
229  inline void SetProportion( const sal_uInt8 nNewPropr );
230 
231  inline void SetPropWidth( const sal_uInt16 nNew );
232 
233  inline void SetFamily( const FontFamily eFamily, const SwFontScript nWhich );
234  inline void SetName( const OUString& rName, const SwFontScript nWhich );
235  inline void SetStyleName( const OUString& rStyleName, const SwFontScript nWhich );
236  inline void SetSize( const Size& rSize, const SwFontScript nWhich );
237  inline void SetWeight( const FontWeight eWeight, const SwFontScript nWhich );
238  inline void SetItalic( const FontItalic eItalic, const SwFontScript nWhich );
239  inline void SetLanguage( LanguageType eNewLang, const SwFontScript nWhich );
240  inline void SetCharSet( const rtl_TextEncoding eCharSet, const SwFontScript nWhich );
241  inline void SetPitch( const FontPitch ePitch, const SwFontScript nWhich );
242  inline void SetRelief( const FontRelief eNew );
243 
244  // Get/Set-methods for the current setting
245  inline void SetBlink( const bool bBlink );
246  bool IsBlink() const { return m_bBlink; }
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 ); }
251  sal_uInt8 &GetMeta() { return m_nMetaCount; }
252  bool IsMeta() const { return (0 != m_nMetaCount); }
253  sal_uInt8 &GetInputField() { return m_nInputFieldCount; }
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  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  sal_uInt16 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  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  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, long nTextWidth );
310 
312  { return m_aSub[m_nActual].GetCursorOfst_( 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 boost::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; }
337  const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; }
338  const boost::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
339  const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
340 
341  // Get absolute border correspond to the layout verticality and orientation.
343  GetAbsTopBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
345  GetAbsBottomBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
347  GetAbsRightBorder(const bool bVertLayout, const bool bVertLayoutLRBT) const;
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; }
376  SvxShadowLocation GetShadowLocation() const { return m_aShadowLocation; }
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::SetBlink( const bool bNew )
816 {
817  m_bBlink = bNew;
818 }
819 
820 inline void SwFont::SetGreyWave( const bool bNew )
821 {
822  m_bGreyWave = bNew;
823 }
824 
825 inline void SwSubFont::SetVertical( const sal_uInt16 nDir, const bool bVertFormat )
826 {
827  m_nFontCacheId = nullptr;
828  Font::SetVertical( bVertFormat );
829  Font::SetOrientation( nDir );
830 }
831 
832 inline void SwFont::SetTopBorderDist( const sal_uInt16 nTopDist )
833 {
834  m_nTopBorderDist = nTopDist;
835  m_bFontChg = true;
836  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
837 }
838 
839 inline void SwFont::SetBottomBorderDist( const sal_uInt16 nBottomDist )
840 {
841  m_nBottomBorderDist = nBottomDist;
842  m_bFontChg = true;
843  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
844 }
845 
846 inline void SwFont::SetRightBorderDist( const sal_uInt16 nRightDist )
847 {
848  m_nRightBorderDist = nRightDist;
849  m_bFontChg = true;
850  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
851 }
852 
853 inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist )
854 {
855  m_nLeftBorderDist = nLeftDist;
856  m_bFontChg = true;
857  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
858 }
859 
860 inline sal_uInt16 SwFont::GetTopBorderSpace() const
861 {
862  sal_uInt16 nRet = 0;
863  if( m_aTopBorder )
864  {
865  nRet += m_aTopBorder.get().GetScaledWidth() + m_nTopBorderDist;
866  }
867  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
868  m_aShadowLocation == SvxShadowLocation::TopRight )
869  {
870  nRet += m_nShadowWidth;
871  }
872  return nRet;
873 }
874 
875 inline sal_uInt16 SwFont::GetBottomBorderSpace() const
876 {
877  sal_uInt16 nRet = 0;
878  if( m_aBottomBorder )
879  {
880  nRet += m_aBottomBorder.get().GetScaledWidth() + m_nBottomBorderDist;
881  }
882  if( m_aShadowLocation == SvxShadowLocation::BottomLeft ||
883  m_aShadowLocation == SvxShadowLocation::BottomRight )
884  {
885  nRet += m_nShadowWidth;
886  }
887  return nRet;
888 }
889 
890 inline sal_uInt16 SwFont::GetRightBorderSpace() const
891 {
892  sal_uInt16 nRet = 0;
893  if( m_aRightBorder )
894  {
895  nRet += m_aRightBorder.get().GetScaledWidth() + m_nRightBorderDist;
896  }
897  if( m_aShadowLocation == SvxShadowLocation::TopRight ||
898  m_aShadowLocation == SvxShadowLocation::BottomRight )
899  {
900  nRet += m_nShadowWidth;
901  }
902  return nRet;
903 }
904 
905 inline sal_uInt16 SwFont::GetLeftBorderSpace() const
906 {
907  sal_uInt16 nRet = 0;
908  if( m_aLeftBorder )
909  {
910  nRet += m_aLeftBorder.get().GetScaledWidth() + m_nLeftBorderDist;
911  }
912  if( m_aShadowLocation == SvxShadowLocation::TopLeft ||
913  m_aShadowLocation == SvxShadowLocation::BottomLeft )
914  {
915  nRet += m_nShadowWidth;
916  }
917  return nRet;
918 }
919 
920 inline bool SwFont::HasBorder() const
921 {
923 }
924 
925 inline void SwFont::SetShadowColor( const Color& rColor )
926 {
927  m_aShadowColor = rColor;
928  m_bFontChg = true;
929  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
930 }
931 
932 inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth )
933 {
934  m_nShadowWidth = nWidth;
935  m_bFontChg = true;
936  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
937 }
938 
939 inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation )
940 {
941  m_aShadowLocation = aLocation;
942  m_bFontChg = true;
943  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
944 }
945 
946 inline void SwFont::SetHighlightColor( const Color& aNewColor )
947 {
948  m_aHighlightColor = aNewColor;
949  m_bFontChg = true;
950  m_aSub[SwFontScript::Latin].m_nFontCacheId = m_aSub[SwFontScript::CJK].m_nFontCacheId = m_aSub[SwFontScript::CTL].m_nFontCacheId = nullptr;
951 }
952 
953 // Used for the "continuous underline" feature.
955 {
958  std::unique_ptr<SwFont> m_pFont;
959 
960 public:
961  // sets the font which should paint the common baseline,
962  // index where continuous underline ends,
963  // and the starting point of the common baseline
964  SwUnderlineFont(SwFont& rFnt, TextFrameIndex nEnd, const Point& rPoint);
966 
968  {
969  OSL_ENSURE( m_pFont, "No underline font" );
970  return *m_pFont;
971  }
972  const Point& GetPos() const { return m_aPos; }
973  TextFrameIndex GetEnd() const { return m_nEnd; }
974  // the x coordinate of the starting point has to be set for each portion
975  void SetPos( const Point& rPoint ) { m_aPos = rPoint; }
976 };
977 
978 #ifdef DBG_UTIL
979 
981 {
982 public:
983  sal_uInt16 nGetTextSize;
984  sal_uInt16 nDrawText;
986  sal_uInt16 nDrawStretchText;
987  sal_uInt16 nChangeFont;
988 
990  { nGetTextSize = nDrawText = nGetStretchTextSize = nDrawStretchText = nChangeFont = 0; }
991 };
992 
993 // global variable, implemented in swfont.cxx
994 extern SvStatistics g_SvStat;
995 
996 #define SV_STAT(nWhich) ++(g_SvStat.nWhich);
997 
998 
999 #else
1000 #define SV_STAT(nWhich)
1001 #endif /* DBG_UTIL */
1002 
1003 #endif
1004 
1005 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetLeftBorderDist(const sal_uInt16 nLeftDist)
Definition: swfont.hxx:853
long Width() const
rtl_TextEncoding GetCharSet(const SwFontScript nWhich) const
Definition: swfont.hxx:291
const sal_Unicode CH_BREAK
Definition: swfont.hxx:43
boost::optional< editeng::SvxBorderLine > m_aTopBorder
Definition: swfont.hxx:140
void SetPropr(const sal_uInt8 nNewPropr)
sal_uInt16 GetLeftBorderSpace() const
Definition: swfont.hxx:905
sal_uInt16 GetShadowWidth() const
Definition: swfont.hxx:375
sal_uInt8 GetPropr() const
short CheckKerning()
Definition: swfont.hxx:320
void SetFamily(const FontFamily eFamily)
Definition: swfont.hxx:442
boost::optional< editeng::SvxBorderLine > m_aRightBorder
Definition: swfont.hxx:142
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:668
TextFrameIndex GetCursorOfst_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1363
sal_uInt16 GetAscent(SwViewShell const *pSh, const OutputDevice &rOut)
Definition: swfont.cxx:1027
SwSubFont()
Definition: swfont.hxx:114
bool m_bSmallCapsPercentage66
Definition: swfont.hxx:59
TextFrameIndex GetCapitalCursorOfst(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:377
sal_uInt16 m_nOrgAscent
Definition: swfont.hxx:57
SvxCaseMap
void SetName(const OUString &rName)
Definition: swfont.hxx:455
long Height() const
const Color & GetUnderColor() const
Definition: swfont.hxx:269
bool IsInputField() const
Definition: swfont.hxx:254
sal_uInt8 GetPropr() const
Definition: swfont.hxx:277
sal_uInt16 GetTopBorderDist() const
Definition: swfont.hxx:356
sal_uInt16 GetRightBorderSpace() const
Definition: swfont.hxx:890
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:427
void SetFillColor(const Color &rColor)
Definition: swfont.hxx:433
bool ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.cxx:955
FontEmphasisMark
bool IsMeta() const
Definition: swfont.hxx:252
void SetGreyWave(const bool bNew)
Definition: swfont.hxx:820
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:536
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:306
bool DifferentFontCacheId(const SwFont *pFnt, SwFontScript nWhich)
Definition: swfont.hxx:198
const SvxFont & GetActualFont() const
Definition: swfont.hxx:182
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:682
void SetSize(const Size &rSize)
Definition: swfont.hxx:720
void CalcEsc(SwDrawTextInfo const &rInf, Point &rPos)
Definition: swfont.cxx:1396
bool HasBorder() const
Check whether font has any border on any side.
Definition: swfont.hxx:920
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:202
FontStrikeout GetStrikeout() const
Definition: swfont.hxx:272
TextFrameIndex const m_nEnd
Definition: swfont.hxx:957
void SetOutline(const bool bOutline)
Definition: swfont.hxx:600
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:690
Color m_aShadowColor
Definition: swfont.hxx:151
const boost::optional< editeng::SvxBorderLine > & GetRightBorder() const
Definition: swfont.hxx:338
sal_uInt8 & GetRef()
Definition: swfont.hxx:249
bool m_bFontChg
Definition: swfont.hxx:165
void SetBottomBorderDist(const sal_uInt16 nBottomDist)
Definition: swfont.hxx:839
void SetPitch(const FontPitch ePitch, const SwFontScript nWhich)
Definition: swfont.hxx:501
sal_uInt16 m_nLeftBorderDist
Definition: swfont.hxx:149
void DrawText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:314
void DrawCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:305
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:152
sal_uInt16 sal_Unicode
sal_uInt16 m_nRightBorderDist
Definition: swfont.hxx:148
bool IsRef() const
Definition: swfont.hxx:250
Color m_aOverColor
Definition: swfont.hxx:137
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:1507
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:205
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1281
SvxCaseMap GetCaseMap() const
Definition: swfont.hxx:276
o3tl::enumarray< SwFontScript, SwSubFont > m_aSub
Definition: swfont.hxx:131
sal_uInt16 m_nFontIndex
Definition: swfont.hxx:55
void SetShadowColor(const Color &rColor)
Definition: swfont.hxx:925
void SetUnderline(const FontLineStyle eUnderline)
Definition: swfont.hxx:542
void SetShadowLocation(const SvxShadowLocation aLocation)
Definition: swfont.hxx:939
FontEmphasisMark GetEmphasisMark() const
Definition: swfont.hxx:282
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: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:58
FontKerning
void SetItalic(const FontItalic eItalic)
Definition: swfont.hxx:581
SwFontScript GetActual() const
Definition: swfont.hxx:180
bool IsFntChg() const
Definition: swfont.hxx:204
Color m_aHighlightColor
Definition: swfont.hxx:135
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:160
void SetWordLineMode(const bool bWordLineMode)
Definition: swfont.hxx:662
sal_uInt8 m_nInputFieldCount
Definition: swfont.hxx:158
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:775
void SetUnderColor(const Color &rColor)
Definition: swfont.hxx:212
void SetRightBorderDist(const sal_uInt16 nRightDist)
Definition: swfont.hxx:846
SvStatistics g_SvStat
Definition: swfont.cxx:62
void SetShadowWidth(const sal_uInt16 nWidth)
Definition: swfont.hxx:932
const Point & GetPos() const
Definition: swfont.hxx:972
void DrawStretchCapital(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:446
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:192
void DrawText_(SwDrawTextInfo &rInf, const bool bGrey)
Definition: swfont.cxx:1148
Size GetCapitalSize(SwDrawTextInfo &rInf)
Definition: fntcap.cxx:133
sal_uInt16 GetBottomBorderDist() const
Definition: swfont.hxx:357
const Color * GetBackColor() const
Definition: swfont.hxx:188
FontLineStyle GetOverline() const
Definition: swfont.hxx:270
const sal_Unicode CH_BLANK
Definition: swfont.hxx:42
long GetHeight() const
Definition: swfont.hxx:280
bool m_bOrgChg
Definition: swfont.hxx:166
sal_uInt16 GetTopBorderSpace() const
Definition: swfont.hxx:860
SwFont & GetFont()
Definition: swfont.hxx:967
TextFrameIndex GetEnd() const
Definition: swfont.hxx:973
sal_uInt16 GetPropWidth() const
Definition: swfont.hxx:116
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:708
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:754
sal_uInt16 nChangeFont
Definition: swfont.hxx:987
const boost::optional< editeng::SvxBorderLine > & GetLeftBorder() const
Definition: swfont.hxx:339
void SetShadow(const bool bShadow)
Definition: swfont.hxx:609
sal_uInt8 m_nToxCount
Definition: swfont.hxx:155
void SetEscapement(const short nNewEsc)
Definition: swfont.hxx:781
Provides access to settings of a document.
void DrawStretchText_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:317
void SetWeight(const FontWeight eWeight, const SwFontScript nWhich)
Definition: swfont.hxx:529
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
sal_uInt8 & GetMeta()
Definition: swfont.hxx:251
FontPitch
const boost::optional< editeng::SvxBorderLine > & GetBottomBorder() const
Definition: swfont.hxx:337
const Color & GetColor() const
Definition: swfont.hxx:273
void DoOnCapitals(SwDoCapitals &rDo)
Definition: swfont.hxx:303
void SetPos(const Point &rPoint)
Definition: swfont.hxx:975
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:624
void SetOverColor(const Color &rColor)
Definition: swfont.hxx:214
void SetAlign(const FontAlign eAlign)
Definition: swfont.hxx:508
void SetPropWidth(const sal_uInt16 nNew)
Definition: swfont.hxx:111
bool IsPaintBlank() const
Definition: swfont.hxx:257
sal_uInt16 m_nBottomBorderDist
Definition: swfont.hxx:147
void SetFixKerning(const short nNewKern)
Definition: swfont.hxx:647
sal_uInt16 nGetStretchTextSize
Definition: swfont.hxx:985
bool IsBlink() const
Definition: swfont.hxx:246
FontLineStyle GetUnderline() const
Definition: swfont.hxx:268
sal_uInt16 GetLeftBorderDist() const
Definition: swfont.hxx:359
void SetOutline(const bool bOutline)
Definition: swfont.hxx:594
Size GetTextSize_(SwDrawTextInfo &rInf)
Definition: swfont.cxx:1047
FontFamily
const OUString & GetName(const SwFontScript nWhich) const
Definition: swfont.hxx:287
std::unique_ptr< SwFont > m_pFont
Definition: swfont.hxx:958
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:949
LanguageType GetLanguage() const
Definition: swfont.hxx:279
void DoOnCapitals(SwDoCapitals &rDo)
Definition: fntcap.cxx:464
FontWeight
std::unique_ptr< Color > m_pBackColor
Definition: swfont.hxx:134
const void * m_nFontCacheId
Definition: swfont.hxx:53
boost::optional< editeng::SvxBorderLine > m_aLeftBorder
Definition: swfont.hxx:143
void SetRelief(const FontRelief eNew)
Definition: swfont.hxx:702
TextFrameIndex GetCursorOfst_(SwDrawTextInfo &rInf)
Definition: swfont.hxx:311
sal_uInt8 & GetInputField()
Definition: swfont.hxx:253
boost::optional< editeng::SvxBorderLine > m_aBottomBorder
Definition: swfont.hxx:141
bool m_bBlink
Definition: swfont.hxx:163
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:196
unsigned char sal_uInt8
sal_uInt16 CalcEscAscent(const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:483
SvxShadowLocation GetShadowLocation() const
Definition: swfont.hxx:376
sal_uInt16 nDrawText
Definition: swfont.hxx:984
FontItalic GetItalic() const
Definition: swfont.hxx:278
sal_uInt8 m_nRefCount
Definition: swfont.hxx:156
void SetVertical(const sal_uInt16 nDir, const bool bVertFormat)
Definition: swfont.hxx:825
void SetActual(SwFontScript nNew)
Definition: swfont.hxx:744
void SetBlink(const bool bBlink)
Definition: swfont.hxx:815
short CheckKerning_()
Definition: swfont.cxx:1018
LanguageType GetAppLanguage()
Definition: init.cxx:760
void SetFamily(const FontFamily eFamily, const SwFontScript nWhich)
Definition: swfont.hxx:448
const boost::optional< editeng::SvxBorderLine > & GetTopBorder() const
Definition: swfont.hxx:336
void SetCharSet(const rtl_TextEncoding eCharSet, const SwFontScript nWhich)
Definition: swfont.hxx:487
sal_uInt16 GetBottomBorderSpace() const
Definition: swfont.hxx:875
SwFontScript
Definition: swfont.hxx:119
void SetWeight(const FontWeight eWeight)
Definition: swfont.hxx:523
const Color & GetHighlightColor() const
Definition: swfont.hxx:190
void Invalidate()
Definition: swfont.hxx:328
const Color & GetShadowColor() const
Definition: swfont.hxx:374
sal_uInt16 nDrawStretchText
Definition: swfont.hxx:986
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:461
long GetHeight(const SwFontScript nWhich) const
Definition: swfont.hxx:293
short GetFixKerning() const
void SetAutoKern(FontKerning nAutoKern)
Definition: swfont.hxx:630
void SetFont(SwFont *pNew)
Definition: drawfont.hxx:448
SvxShadowLocation m_aShadowLocation
Definition: swfont.hxx:153
const sal_Unicode CH_PAR
Definition: swfont.hxx:45
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:54
sal_uInt16 CalcEscHeight(const sal_uInt16 nOldHeight, const sal_uInt16 nOldAscent) const
Definition: swfont.cxx:1002
sal_uInt16 m_nTopBorderDist
Definition: swfont.hxx:146
bool IsWordLineMode() const
Definition: swfont.hxx:274
void SetEmphasisMark(const FontEmphasisMark eValue)
Definition: swfont.hxx:676
void SetProportion(const sal_uInt8 nNewPropr)
Definition: swfont.hxx:762
void SetHighlightColor(const Color &aNewColor)
Definition: swfont.hxx:946
FontLineStyle
void ChgFnt(SwViewShell const *pSh, OutputDevice &rOut)
Definition: swfont.hxx:173
Color m_aUnderColor
Definition: swfont.hxx:136
void SetStrikeout(const FontStrikeout eStrikeout)
Definition: swfont.hxx:566
short GetEscapement() const
Definition: swfont.hxx:275
sal_uInt16 nGetTextSize
Definition: swfont.hxx:983
sal_uInt16 m_nOrgHeight
Definition: swfont.hxx:56
void SetEscapement(const short nNewEsc)
sal_uInt8 m_nMetaCount
Definition: swfont.hxx:157
void SetOverline(const FontLineStyle eOverline)
Definition: swfont.hxx:557
FontStrikeout
void SetTopBorderDist(const sal_uInt16 nTopDist)
Definition: swfont.hxx:832
FontRelief
const SvxFont & GetFnt(const SwFontScript nWhich) const
Definition: swfont.hxx:263
FontItalic
SvxShadowLocation
short CheckKerning()
Definition: swfont.hxx:109
void SetColor(const Color &rColor)
Definition: swfont.hxx:420
bool m_bGreyWave
Definition: swfont.hxx:167
void GetFontCacheId(const void *&rnFontCacheId, sal_uInt16 &rIdx, SwFontScript nWhich)
Definition: swfont.hxx:194