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