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