bump product version to 7.2.5.1
[LibreOffice.git] / vcl / inc / PhysicalFontFamily.hxx
blobcd9f3f08e8d1fab91274394eb0b9f4292c057ba6
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_PHYSICALFONTFAMILY_HXX
21 #define INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
23 #include <vcl/dllapi.h>
24 #include <vcl/outdev.hxx>
26 #include <o3tl/sorted_vector.hxx>
28 #include <unotools/fontcfg.hxx>
30 #include "PhysicalFontFace.hxx"
32 class ImplDeviceFontList;
33 class PhysicalFontFace;
34 class PhysicalFontCollection;
36 // flags for mnTypeFaces member
37 enum class FontTypeFaces {
38 NONE = 0x00,
39 Scalable = 0x01,
40 Symbol = 0x02,
41 NoneSymbol = 0x04,
42 Light = 0x08,
43 Bold = 0x10,
44 Normal = 0x20,
45 NoneItalic = 0x40,
46 Italic = 0x80
48 namespace o3tl {
49 template<> struct typed_flags<FontTypeFaces> : is_typed_flags<FontTypeFaces, 0xff> {};
52 class VCL_PLUGIN_PUBLIC PhysicalFontFamily
54 public:
55 PhysicalFontFamily( const OUString& rSearchName );
56 ~PhysicalFontFamily();
58 const OUString& GetFamilyName() const { return maFamilyName; }
59 const OUString& GetSearchName() const { return maSearchName; }
60 const OUString& GetAliasNames() const { return maMapNames; }
61 int GetMinQuality() const { return mnMinQuality; }
62 FontTypeFaces GetTypeFaces() const { return mnTypeFaces; }
63 void GetFontHeights( o3tl::sorted_vector<int>& rHeights ) const;
65 const OUString& GetMatchFamilyName() const { return maMatchFamilyName; }
66 ImplFontAttrs GetMatchType() const { return mnMatchType ; }
67 FontWeight GetMatchWeight() const { return meMatchWeight ; }
68 FontWidth GetMatchWidth() const { return meMatchWidth ; }
69 void InitMatchData( const utl::FontSubstConfiguration&,
70 const OUString& rSearchName );
72 void AddFontFace( PhysicalFontFace* );
74 PhysicalFontFace* FindBestFontFace( const FontSelectPattern& rFSD ) const;
76 void UpdateDevFontList( ImplDeviceFontList& ) const;
77 void UpdateCloneFontList(PhysicalFontCollection&) const;
79 static void CalcType( ImplFontAttrs& rType, FontWeight& rWeight, FontWidth& rWidth,
80 FontFamily eFamily, const utl::FontNameAttr* pFontAttr );
82 private:
83 std::vector< rtl::Reference<PhysicalFontFace> > maFontFaces;
85 OUString maFamilyName; // original font family name
86 OUString maSearchName; // normalized font family name
87 OUString maMapNames; // fontname aliases
88 FontTypeFaces mnTypeFaces; // Typeface Flags
89 FontFamily meFamily;
90 FontPitch mePitch;
91 int mnMinQuality; // quality of the worst font face
93 ImplFontAttrs mnMatchType; // MATCH - Type
94 OUString maMatchFamilyName; // MATCH - FamilyName
95 FontWeight meMatchWeight; // MATCH - Weight
96 FontWidth meMatchWidth; // MATCH - Width
99 #endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */