LibreOffice Module vcl (master)  1
fontselect.hxx
Go to the documentation of this file.
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_FONTSELECT_HXX
21 #define INCLUDED_VCL_INC_FONTSELECT_HXX
22 
23 #include <i18nlangtag/lang.h>
24 #include <tools/degree.hxx>
25 #include <vcl/vclenum.hxx>
26 
27 #include "fontattributes.hxx"
28 
29 #include <ostream>
30 
31 namespace vcl { class Font; }
32 
34 class PhysicalFontFace;
35 class Size;
36 
38 {
39 public:
40  FontSelectPattern(const vcl::Font&, const OUString& rSearchName,
41  const Size&, float fExactHeight, bool bNonAntialias = false);
42 #ifdef _WIN32
43  FontSelectPattern( const PhysicalFontFace&, const Size&,
44  float fExactHeight, int nOrientation, bool bVertical );
45 #endif
46 
47  size_t hashCode() const;
48  bool operator==(const FontSelectPattern& rOther) const;
49  bool operator!=(const FontSelectPattern& rOther) const
50  {
51  return !(*this == rOther);
52  }
53 
54  static const char FEAT_PREFIX;
55  static const char FEAT_SEPARATOR;
56 
57 public:
58  OUString maTargetName; // name of the font name token that is chosen
59  OUString maSearchName; // name of the font that matches best
60  int mnWidth; // width of font in pixel units
61  int mnHeight; // height of font in pixel units
62  float mfExactHeight; // requested height (in pixels with subpixel details)
63  Degree10 mnOrientation; // text orientation in 1/10 degree (0-3600)
64  LanguageType meLanguage; // text language
65  bool mbVertical; // vertical mode of requested font
66  bool mbNonAntialiased; // true if antialiasing is disabled
67 
68  bool mbEmbolden; // Force emboldening
69  ItalicMatrix maItalicMatrix; // Force matrix for slant
70 };
71 
72 template< typename charT, typename traits >
73 inline std::basic_ostream<charT, traits> & operator <<(
74  std::basic_ostream<charT, traits> & stream, const FontSelectPattern & rFSP)
75 {
76  stream << (rFSP.maTargetName.isEmpty() ? "<default>" : rFSP.maTargetName)
77  << " (" << rFSP.maSearchName << ") w: " << rFSP.mnWidth << " h: "
78  << rFSP.mnHeight << " alias: " << rFSP.mbNonAntialiased;
79  return stream;
80 }
81 
82 #endif // INCLUDED_VCL_INC_FONTSELECT_HXX
83 
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
ItalicMatrix maItalicMatrix
Definition: fontselect.hxx:69
bool operator==(const ItalicMatrix &a, const ItalicMatrix &b)
Definition: vclenum.hxx:206
abstract base class for physical font faces
bool operator!=(const FontSelectPattern &rOther) const
Definition: fontselect.hxx:49
Degree10 mnOrientation
Definition: fontselect.hxx:63
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &stream, const FontSelectPattern &rFSP)
Definition: fontselect.hxx:73
static const char FEAT_SEPARATOR
Definition: fontselect.hxx:55
static const char FEAT_PREFIX
Definition: fontselect.hxx:54
LanguageType meLanguage
Definition: fontselect.hxx:64
OUString maSearchName
Definition: fontselect.hxx:59
OUString maTargetName
Definition: fontselect.hxx:58