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_FONTSELECT_HXX
21 #define INCLUDED_VCL_INC_FONTSELECT_HXX
23 #include <i18nlangtag/lang.h>
24 #include <vcl/vclenum.hxx>
26 #include "fontattributes.hxx"
30 namespace vcl
{ class Font
; }
32 class LogicalFontInstance
;
33 class PhysicalFontFace
;
36 class VCL_DLLPUBLIC FontSelectPattern
: public FontAttributes
39 FontSelectPattern(const vcl::Font
&, const OUString
& rSearchName
,
40 const Size
&, float fExactHeight
, bool bNonAntialias
= false);
42 FontSelectPattern( const PhysicalFontFace
&, const Size
&,
43 float fExactHeight
, int nOrientation
, bool bVertical
);
46 size_t hashCode() const;
47 bool operator==(const FontSelectPattern
& rOther
) const;
48 bool operator!=(const FontSelectPattern
& rOther
) const
50 return !(*this == rOther
);
53 static const char FEAT_PREFIX
;
54 static const char FEAT_SEPARATOR
;
57 OUString maTargetName
; // name of the font name token that is chosen
58 OUString maSearchName
; // name of the font that matches best
59 int mnWidth
; // width of font in pixel units
60 int mnHeight
; // height of font in pixel units
61 float mfExactHeight
; // requested height (in pixels with subpixel details)
62 int mnOrientation
; // text orientation in 1/10 degree (0-3600)
63 LanguageType meLanguage
; // text language
64 bool mbVertical
; // vertical mode of requested font
65 bool mbNonAntialiased
; // true if antialiasing is disabled
67 bool mbEmbolden
; // Force emboldening
68 ItalicMatrix maItalicMatrix
; // Force matrix for slant
71 template< typename charT
, typename traits
>
72 inline std::basic_ostream
<charT
, traits
> & operator <<(
73 std::basic_ostream
<charT
, traits
> & stream
, const FontSelectPattern
& rFSP
)
75 stream
<< (rFSP
.maTargetName
.isEmpty() ? "<default>" : rFSP
.maTargetName
)
76 << " (" << rFSP
.maSearchName
<< ") w: " << rFSP
.mnWidth
<< " h: "
77 << rFSP
.mnHeight
<< " alias: " << rFSP
.mbNonAntialiased
;
81 #endif // INCLUDED_VCL_INC_FONTSELECT_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */