LibreOffice Module vcl (master)  1
PhysicalFontFamily.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 
20 #ifndef INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
21 #define INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
22 
23 #include <vcl/dllapi.h>
24 #include <vcl/outdev.hxx>
25 
26 #include <set>
27 
28 #include <unotools/fontcfg.hxx>
29 
30 #include "PhysicalFontFace.hxx"
31 
32 class ImplDeviceFontList;
33 class PhysicalFontFace;
35 
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
47 };
48 namespace o3tl {
49  template<> struct typed_flags<FontTypeFaces> : is_typed_flags<FontTypeFaces, 0xff> {};
50 };
51 
53 {
54 public:
55  PhysicalFontFamily( const OUString& rSearchName );
57 
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( std::set<int>& rHeights ) const;
64 
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 );
71 
72  void AddFontFace( PhysicalFontFace* );
73 
74  PhysicalFontFace* FindBestFontFace( const FontSelectPattern& rFSD ) const;
75 
76  void UpdateDevFontList( ImplDeviceFontList& ) const;
77  void UpdateCloneFontList(PhysicalFontCollection&) const;
78 
79 static void CalcType( ImplFontAttrs& rType, FontWeight& rWeight, FontWidth& rWidth,
80  FontFamily eFamily, const utl::FontNameAttr* pFontAttr );
81 
82 private:
83  std::vector< rtl::Reference<PhysicalFontFace> > maFontFaces;
84 
85  OUString maFamilyName; // original font family name
86  OUString const maSearchName; // normalized font family name
87  OUString maMapNames; // fontname aliases
88  FontTypeFaces mnTypeFaces; // Typeface Flags
91  int mnMinQuality; // quality of the worst font face
92 
93  ImplFontAttrs mnMatchType; // MATCH - Type
94  OUString maMatchFamilyName; // MATCH - FamilyName
95  FontWeight meMatchWeight; // MATCH - Weight
96  FontWidth meMatchWidth; // MATCH - Width
97 };
98 
99 #endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
100 
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FontWeight GetMatchWeight() const
FontWidth
ImplFontAttrs GetMatchType() const
ImplFontAttrs
FontTypeFaces GetTypeFaces() const
std::vector< rtl::Reference< PhysicalFontFace > > maFontFaces
const OUString & GetSearchName() const
const OUString & GetMatchFamilyName() const
abstract base class for physical font faces
OUString const maSearchName
FontPitch
FontWidth GetMatchWidth() const
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
FontFamily
FontWeight
const OUString & GetAliasNames() const
const OUString & GetFamilyName() const