Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / inc / PhysicalFontFamily.hxx
bloba2fbf1baa0a182ad0b9c7bf6f6e2056396e7e2d0
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 <set>
25 #include <unotools/fontcfg.hxx>
27 #include "PhysicalFontFace.hxx"
29 class PhysicalFontFace;
30 class PhysicalFontCollection;
32 // flags for mnTypeFaces member
33 #define FONT_FAMILY_SCALABLE (1<<0)
34 #define FONT_FAMILY_SYMBOL (1<<1)
35 #define FONT_FAMILY_NONESYMBOL (1<<2)
36 #define FONT_FAMILY_LIGHT (1<<4)
37 #define FONT_FAMILY_BOLD (1<<5)
38 #define FONT_FAMILY_NORMAL (1<<6)
39 #define FONT_FAMILY_NONEITALIC (1<<8)
40 #define FONT_FAMILY_ITALIC (1<<9)
42 class PhysicalFontFamily
44 public:
45 PhysicalFontFamily( const OUString& rSearchName );
46 ~PhysicalFontFamily();
48 const OUString& GetFamilyName() const { return maName; }
49 const OUString& GetSearchName() const { return maSearchName; }
50 const OUString& GetAliasNames() const { return maMapNames; }
51 const OUString& GetMatchFamilyName() const { return maMatchFamilyName; }
52 ImplFontAttrs GetMatchType() const { return mnMatchType ; }
53 FontWeight GetMatchWeight() const { return meMatchWeight ; }
54 FontWidth GetMatchWidth() const { return meMatchWidth ; }
55 bool IsScalable() const { return mpFirst->IsScalable(); }
56 int GetMinQuality() const { return mnMinQuality; }
57 int GetTypeFaces() const { return mnTypeFaces; }
58 bool AddFontFace( PhysicalFontFace* );
59 void InitMatchData( const utl::FontSubstConfiguration&,
60 const OUString& rSearchName );
61 PhysicalFontFace* FindBestFontFace( const FontSelectPattern& rFSD ) const;
63 void GetFontHeights( std::set<int>& rHeights ) const;
64 void UpdateDevFontList( ImplGetDevFontList& ) const;
65 void UpdateCloneFontList( PhysicalFontCollection&,
66 bool bScalable, bool bEmbeddable ) const;
68 static void CalcType( ImplFontAttrs& rType, FontWeight& rWeight, FontWidth& rWidth,
69 FontFamily eFamily, const utl::FontNameAttr* pFontAttr );
71 private:
72 PhysicalFontFace* mpFirst; // linked list of physical font faces
73 OUString maName; // Fontname (original font family name)
74 OUString maSearchName; // normalized font family name
75 OUString maMapNames; // fontname aliases
76 int mnTypeFaces; // Typeface Flags
77 ImplFontAttrs mnMatchType; // MATCH - Type
78 OUString maMatchFamilyName; // MATCH - FamilyName
79 FontWeight meMatchWeight; // MATCH - Weight
80 FontWidth meMatchWidth; // MATCH - Width
81 FontFamily meFamily;
82 FontPitch mePitch;
83 int mnMinQuality; // quality of the worst font face
86 #endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */