Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / fontselect.hxx
blobdec59905455b5e037da7b4d779f9bf383323db53
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_FONTSELECT_HXX
21 #define INCLUDED_VCL_INC_FONTSELECT_HXX
23 #include <i18nlangtag/lang.h>
25 #include "fontattributes.hxx"
27 #include <unordered_map>
29 namespace vcl { class Font; }
31 class PhysicalFontFace;
32 class LogicalFontInstance;
33 class Size;
35 class FontSelectPatternAttributes : public FontAttributes
37 public:
38 FontSelectPatternAttributes( const vcl::Font&, const OUString& rSearchName,
39 const Size&, float fExactHeight );
40 #ifdef _WIN32
41 FontSelectPatternAttributes( const PhysicalFontFace&, const Size&,
42 float fExactHeight, int nOrientation, bool bVertical );
43 #endif
45 size_t hashCode() const;
46 bool operator==(const FontSelectPatternAttributes& rOther) const;
47 bool operator!=(const FontSelectPatternAttributes& rOther) const
49 return !(*this == rOther);
52 static const char FEAT_PREFIX;
53 static const char FEAT_SEPARATOR;
55 public:
56 OUString maTargetName; // name of the font name token that is chosen
57 OUString maSearchName; // name of the font that matches best
58 int mnWidth; // width of font in pixel units
59 int mnHeight; // height of font in pixel units
60 float mfExactHeight; // requested height (in pixels with subpixel details)
61 int mnOrientation; // text orientation in 3600 system
62 LanguageType meLanguage; // text language
63 bool mbVertical; // vertical mode of requested font
64 bool mbNonAntialiased; // true if antialiasing is disabled
66 bool mbEmbolden; // Force emboldening
67 ItalicMatrix maItalicMatrix; // Force matrix for slant
71 class FontSelectPattern : public FontSelectPatternAttributes
73 public:
74 FontSelectPattern( const vcl::Font&, const OUString& rSearchName,
75 const Size&, float fExactHeight );
76 #ifdef _WIN32
77 // ifdeffed to prevent it going into unusedcode.easy
78 FontSelectPattern( const PhysicalFontFace&, const Size&,
79 float fExactHeight, int nOrientation, bool bVertical );
80 #endif
82 public: // TODO: change to private
83 const PhysicalFontFace* mpFontData; // a matching PhysicalFontFace object
84 LogicalFontInstance* mpFontInstance; // pointer to the resulting FontCache entry
86 void copyAttributes(const FontSelectPatternAttributes &rAttributes);
89 #endif // INCLUDED_VCL_INC_FONTSELECT_HXX
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */