LibreOffice Module vcl (master) 1
qt5/QtFontFace.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 <sal/config.h>
23
24#include <vclpluginapi.h>
26
27#include <tools/ref.hxx>
29#include <vcl/fontcharmap.hxx>
30
31#include <QtCore/QString>
32#include <QtGui/QFont>
33
34class FontAttributes;
35namespace vcl::font
36{
37class FontSelectPattern;
38}
39
41{
42public:
43 static QtFontFace* fromQFont(const QFont& rFont);
44 static QtFontFace* fromQFontDatabase(const QString& aFamily, const QString& aStyle);
45 static void fillAttributesFromQFont(const QFont& rFont, FontAttributes& rFA);
46
47 VCLPLUG_QT_PUBLIC static FontWeight toFontWeight(const int nWeight);
48 VCLPLUG_QT_PUBLIC static FontWidth toFontWidth(const int nStretch);
49 VCLPLUG_QT_PUBLIC static FontItalic toFontItalic(const QFont::Style eStyle);
50
51 sal_IntPtr GetFontId() const override;
52
53 QFont CreateFont() const;
54 int GetFontTable(const char pTagName[5], unsigned char*) const;
55
58 bool HasChar(sal_uInt32 cChar) const;
59
62
63private:
64 typedef enum { Font, FontDB } FontIdType;
65
67 QtFontFace(const FontAttributes&, QString rFontID, const FontIdType);
68
69 const QString m_aFontId;
74};
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl::FontCapabilities m_aFontCapabilities
sal_IntPtr GetFontId() const override
rtl::Reference< LogicalFontInstance > CreateFontInstance(const vcl::font::FontSelectPattern &rFSD) const override
bool GetFontCapabilities(vcl::FontCapabilities &) const override
QtFontFace(const FontAttributes &, QString rFontID, const FontIdType)
static QtFontFace * fromQFont(const QFont &rFont)
QtFontFace(const QtFontFace &)
FontCharMapRef m_xCharMap
QFont CreateFont() const
bool HasChar(sal_uInt32 cChar) const
static VCLPLUG_QT_PUBLIC FontWidth toFontWidth(const int nStretch)
FontCharMapRef GetFontCharMap() const override
int GetFontTable(const char pTagName[5], unsigned char *) const
static VCLPLUG_QT_PUBLIC FontWeight toFontWeight(const int nWeight)
const FontIdType m_eFontIdType
bool m_bFontCapabilitiesRead
static void fillAttributesFromQFont(const QFont &rFont, FontAttributes &rFA)
static QtFontFace * fromQFontDatabase(const QString &aFamily, const QString &aStyle)
const QString m_aFontId
static VCLPLUG_QT_PUBLIC FontItalic toFontItalic(const QFont::Style eStyle)
abstract base class for physical font faces
FontItalic
FontWidth
FontWeight
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
#define VCLPLUG_QT_PUBLIC
Definition: vclpluginapi.h:53