Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / vcl / inc / fontinstance.hxx
blob0158e972a990eebac754820e1789e116c1b578e4
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_FONTINSTANCE_HXX
21 #define INCLUDED_VCL_INC_FONTINSTANCE_HXX
23 #include "fontselect.hxx"
24 #include "impfontmetricdata.hxx"
26 #include <unordered_map>
28 class ImplFontCache;
29 class ConvertChar;
31 // TODO: allow sharing of metrics for related fonts
33 class VCL_PLUGIN_PUBLIC LogicalFontInstance
35 public:
36 explicit LogicalFontInstance( const FontSelectPattern& );
37 virtual ~LogicalFontInstance();
39 public: // TODO: make data members private
40 ImplFontCache * mpFontCache;
41 FontSelectPattern maFontSelData; // FontSelectionData
42 ImplFontMetricDataRef mxFontMetric; // Font attributes
43 const ConvertChar* mpConversion; // used e.g. for StarBats->StarSymbol
45 long mnLineHeight;
46 sal_uInt32 mnRefCount;
47 short mnOwnOrientation; // text angle if lower layers don't rotate text themselves
48 short mnOrientation; // text angle in 3600 system
49 bool mbInit; // true if maFontMetric member is valid
51 void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
52 bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const;
53 void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
55 private:
56 // cache of Unicode characters and replacement font names
57 // TODO: a fallback map can be shared with many other ImplFontEntries
58 // TODO: at least the ones which just differ in orientation, stretching or height
59 typedef ::std::unordered_map< ::std::pair<sal_UCS4,FontWeight>, OUString > UnicodeFallbackList;
60 UnicodeFallbackList* mpUnicodeFallbackList;
63 #endif // INCLUDED_VCL_INC_FONTINSTANCE_HXX
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */