1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 .
22 #include <sal/config.h>
24 #include <vclpluginapi.h>
25 #include <font/PhysicalFontFace.hxx>
27 #include <tools/ref.hxx>
29 #include <QtCore/QString>
30 #include <QtGui/QFont>
35 class FontSelectPattern
;
38 class QtFontFace final
: public vcl::font::PhysicalFontFace
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
);
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
);
49 sal_IntPtr
GetFontId() const override
;
51 QFont
CreateFont() const;
53 rtl::Reference
<LogicalFontInstance
>
54 CreateFontInstance(const vcl::font::FontSelectPattern
& rFSD
) const override
;
56 hb_blob_t
* GetHbTable(hb_tag_t nTag
) const override
;
59 typedef enum { Font
, FontDB
} FontIdType
;
61 QtFontFace(const QtFontFace
&);
62 QtFontFace(const FontAttributes
&, QString rFontID
, const FontIdType
);
64 const QString m_aFontId
;
65 const FontIdType m_eFontIdType
;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */