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>
28
29#include <QtCore/QString>
30#include <QtGui/QFont>
31
32class FontAttributes;
33namespace vcl::font
34{
35class FontSelectPattern;
36}
37
39{
40public:
41 static QtFontFace* fromQFont(const QFont& rFont);
42 static QtFontFace* fromQFontDatabase(const QString& aFamily, const QString& aStyle);
43 static void fillAttributesFromQFont(const QFont& rFont, FontAttributes& rFA);
44
45 VCLPLUG_QT_PUBLIC static FontWeight toFontWeight(const int nWeight);
46 VCLPLUG_QT_PUBLIC static FontWidth toFontWidth(const int nStretch);
47 VCLPLUG_QT_PUBLIC static FontItalic toFontItalic(const QFont::Style eStyle);
48
49 sal_IntPtr GetFontId() const override;
50
51 QFont CreateFont() const;
52
55
56 hb_blob_t* GetHbTable(hb_tag_t nTag) const override;
57
58private:
59 typedef enum { Font, FontDB } FontIdType;
60
62 QtFontFace(const FontAttributes&, QString rFontID, const FontIdType);
63
64 const QString m_aFontId;
66};
67
68/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_IntPtr GetFontId() const override
rtl::Reference< LogicalFontInstance > CreateFontInstance(const vcl::font::FontSelectPattern &rFSD) const override
QtFontFace(const FontAttributes &, QString rFontID, const FontIdType)
hb_blob_t * GetHbTable(hb_tag_t nTag) const override
static QtFontFace * fromQFont(const QFont &rFont)
QtFontFace(const QtFontFace &)
QFont CreateFont() const
static VCLPLUG_QT_PUBLIC FontWidth toFontWidth(const int nStretch)
static VCLPLUG_QT_PUBLIC FontWeight toFontWeight(const int nWeight)
const FontIdType m_eFontIdType
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