calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / vcl / inc / fontattributes.hxx
blob7ae4b4527bf1362576166856c2a175c3ba1d6f2c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
21 #define INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
23 #include <vcl/dllapi.h>
24 #include <rtl/ustring.hxx>
25 #include <sal/log.hxx>
26 #include <tools/fontenum.hxx>
29 /* The following class is extraordinarily similar to ImplFont. */
31 class VCL_DLLPUBLIC FontAttributes
33 public:
34 explicit FontAttributes();
36 // device independent font functions
37 const OUString& GetFamilyName() const { return maFamilyName; }
38 FontFamily GetFamilyType() const { return meFamily; }
39 const OUString& GetStyleName() const { return maStyleName; }
41 FontWeight GetWeight() const { return meWeight; }
42 FontItalic GetItalic() const { return meItalic; }
43 FontPitch GetPitch() const { return mePitch; }
44 FontWidth GetWidthType() const { return meWidthType; }
46 bool IsMicrosoftSymbolEncoded() const { return mbMicrosoftSymbolEncoded; }
48 void SetFamilyName(const OUString& sFamilyName) { maFamilyName = sFamilyName; }
49 void SetStyleName( const OUString& sStyleName) { maStyleName = sStyleName; }
50 void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; }
52 void SetPitch(const FontPitch ePitch ) { mePitch = ePitch; }
53 void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; }
54 void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; }
55 void SetWidthType(const FontWidth eWidthType) { meWidthType = eWidthType; }
57 void SetMicrosoftSymbolEncoded(const bool );
59 bool CompareDeviceIndependentFontAttributes(const FontAttributes& rOther) const;
61 // Device dependent functions
62 int GetQuality() const { return mnQuality; }
63 const OUString& GetMapNames() const { return maMapNames; }
66 void SetQuality( int nQuality ) { mnQuality = nQuality; }
67 void IncreaseQualityBy( int nQualityAmount ) { mnQuality += nQualityAmount; }
68 void AddMapName( std::u16string_view );
70 private:
71 // device independent variables
72 OUString maFamilyName; // Font Family Name
73 OUString maStyleName; // Font Style Name
74 FontWeight meWeight; // Weight Type
75 FontFamily meFamily; // Family Type
76 FontPitch mePitch; // Pitch Type
77 FontWidth meWidthType; // Width Type
78 FontItalic meItalic; // Slant Type
79 bool mbMicrosoftSymbolEncoded; // Is font microsoft symbol encoded?
81 // device dependent variables
82 OUString maMapNames; // List of family name aliases separated with ';'
83 int mnQuality; // Quality (used when similar fonts compete)
87 inline void FontAttributes::SetMicrosoftSymbolEncoded(const bool bMicrosoftSymbolEncoded)
89 mbMicrosoftSymbolEncoded = bMicrosoftSymbolEncoded;
92 inline void FontAttributes::AddMapName( std::u16string_view aMapName )
94 if( maMapNames.getLength() > 0 )
96 maMapNames += ";";
99 if (aMapName.size() == 0)
101 SAL_WARN("vcl.fonts", "New map name is empty");
102 return;
105 maMapNames += aMapName;
108 #endif // INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */