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