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