1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
25 #include <unotools/fontcfg.hxx>
27 #include "PhysicalFontFace.hxx"
29 class PhysicalFontFace
;
30 class PhysicalFontCollection
;
32 // flags for mnTypeFaces member
33 enum class FontTypeFaces
{
45 template<> struct typed_flags
<FontTypeFaces
> : is_typed_flags
<FontTypeFaces
, 0xff> {};
48 class PhysicalFontFamily
51 PhysicalFontFamily( const OUString
& rSearchName
);
52 ~PhysicalFontFamily();
54 const OUString
& GetFamilyName() const { return maFamilyName
; }
55 const OUString
& GetSearchName() const { return maSearchName
; }
56 const OUString
& GetAliasNames() const { return maMapNames
; }
57 int GetMinQuality() const { return mnMinQuality
; }
58 FontTypeFaces
GetTypeFaces() const { return mnTypeFaces
; }
59 void GetFontHeights( std::set
<int>& rHeights
) const;
61 const OUString
& GetMatchFamilyName() const { return maMatchFamilyName
; }
62 ImplFontAttrs
GetMatchType() const { return mnMatchType
; }
63 FontWeight
GetMatchWeight() const { return meMatchWeight
; }
64 FontWidth
GetMatchWidth() const { return meMatchWidth
; }
65 void InitMatchData( const utl::FontSubstConfiguration
&,
66 const OUString
& rSearchName
);
68 bool AddFontFace( PhysicalFontFace
* );
70 PhysicalFontFace
* FindBestFontFace( const FontSelectPattern
& rFSD
) const;
72 void UpdateDevFontList( ImplDeviceFontList
& ) const;
73 void UpdateCloneFontList(PhysicalFontCollection
&) const;
75 static void CalcType( ImplFontAttrs
& rType
, FontWeight
& rWeight
, FontWidth
& rWidth
,
76 FontFamily eFamily
, const utl::FontNameAttr
* pFontAttr
);
79 std::vector
< PhysicalFontFace
* > maFontFaces
;
81 OUString maFamilyName
; // original font family name
82 OUString maSearchName
; // normalized font family name
83 OUString maMapNames
; // fontname aliases
84 FontTypeFaces mnTypeFaces
; // Typeface Flags
87 int mnMinQuality
; // quality of the worst font face
89 ImplFontAttrs mnMatchType
; // MATCH - Type
90 OUString maMatchFamilyName
; // MATCH - FamilyName
91 FontWeight meMatchWeight
; // MATCH - Weight
92 FontWidth meMatchWidth
; // MATCH - Width
95 #endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */