/src/libreoffice/vcl/inc/fontattributes.hxx
Line | Count | Source |
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 | | |
20 | | #pragma once |
21 | | |
22 | | #include <vcl/dllapi.h> |
23 | | #include <rtl/ustring.hxx> |
24 | | #include <tools/fontenum.hxx> |
25 | | |
26 | | |
27 | | /* The following class is extraordinarily similar to ImplFont. */ |
28 | | |
29 | | class VCL_DLLPUBLIC FontAttributes |
30 | | { |
31 | | public: |
32 | | explicit FontAttributes(); |
33 | | |
34 | | // device independent font functions |
35 | 33.2M | const OUString& GetFamilyName() const { return maFamilyName; } |
36 | 31.7M | FontFamily GetFamilyType() const { return meFamily; } |
37 | 58.4M | const OUString& GetStyleName() const { return maStyleName; } |
38 | | |
39 | 121M | FontWeight GetWeight() const { return meWeight; } |
40 | 114M | FontItalic GetItalic() const { return meItalic; } |
41 | 94.4M | FontPitch GetPitch() const { return mePitch; } |
42 | 47.6M | FontWidth GetWidthType() const { return meWidthType; } |
43 | | |
44 | 59.4M | bool IsMicrosoftSymbolEncoded() const { return mbMicrosoftSymbolEncoded; } |
45 | | |
46 | 15.6M | void SetFamilyName(const OUString& sFamilyName) { maFamilyName = sFamilyName; } |
47 | 13.8M | void SetStyleName( const OUString& sStyleName) { maStyleName = sStyleName; } |
48 | 13.8M | void SetFamilyType(const FontFamily eFontFamily) { meFamily = eFontFamily; } |
49 | | |
50 | 13.8M | void SetPitch(const FontPitch ePitch ) { mePitch = ePitch; } |
51 | 13.6M | void SetItalic(const FontItalic eItalic ) { meItalic = eItalic; } |
52 | 13.6M | void SetWeight(const FontWeight eWeight ) { meWeight = eWeight; } |
53 | 13.6M | void SetWidthType(const FontWidth eWidthType) { meWidthType = eWidthType; } |
54 | | |
55 | | void SetMicrosoftSymbolEncoded(const bool ); |
56 | | |
57 | | bool CompareDeviceIndependentFontAttributes(const FontAttributes& rOther) const; |
58 | | |
59 | | // Device dependent functions |
60 | 31.7M | int GetQuality() const { return mnQuality; } |
61 | | |
62 | | |
63 | 1.29k | void SetQuality( int nQuality ) { mnQuality = nQuality; } |
64 | 1.03k | void IncreaseQualityBy( int nQualityAmount ) { mnQuality += nQualityAmount; } |
65 | | |
66 | | private: |
67 | | // device independent variables |
68 | | OUString maFamilyName; // Font Family Name |
69 | | OUString maStyleName; // Font Style Name |
70 | | FontWeight meWeight; // Weight Type |
71 | | FontFamily meFamily; // Family Type |
72 | | FontPitch mePitch; // Pitch Type |
73 | | FontWidth meWidthType; // Width Type |
74 | | FontItalic meItalic; // Slant Type |
75 | | bool mbMicrosoftSymbolEncoded; // Is font microsoft symbol encoded? |
76 | | |
77 | | // device dependent variables |
78 | | int mnQuality; // Quality (used when similar fonts compete) |
79 | | |
80 | | }; |
81 | | |
82 | | inline void FontAttributes::SetMicrosoftSymbolEncoded(const bool bMicrosoftSymbolEncoded) |
83 | 13.6M | { |
84 | 13.6M | mbMicrosoftSymbolEncoded = bMicrosoftSymbolEncoded; |
85 | 13.6M | } |
86 | | |
87 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |