1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <rtl/ustring.hxx>
26 #include <sallayout.hxx>
28 #include <win/salgdi.h>
29 #include <o3tl/sorted_vector.hxx>
31 // win32 specific logical font instance
32 class WinFontInstance
: public LogicalFontInstance
34 friend rtl::Reference
<LogicalFontInstance
> WinFontFace::CreateFontInstance(const vcl::font::FontSelectPattern
&) const;
37 ~WinFontInstance() override
;
39 bool hasHScale() const;
40 float getHScale() const;
42 void SetGraphics(WinSalGraphics
*);
43 WinSalGraphics
* GetGraphics() const { return m_pGraphics
; }
45 HFONT
GetHFONT() const { return m_hFont
; }
46 // Return true if the font is for vertical writing.
47 // I.e. the font name of the LOGFONT is prefixed with '@'.
48 bool IsCJKVerticalFont() const { return m_bIsCJKVerticalFont
; }
49 sal_Int32
GetTmDescent() const { return m_nTmDescent
; }
51 const WinFontFace
* GetFontFace() const { return static_cast<const WinFontFace
*>(LogicalFontInstance::GetFontFace()); }
52 WinFontFace
* GetFontFace() { return static_cast<WinFontFace
*>(LogicalFontInstance::GetFontFace()); }
54 bool GetGlyphOutline(sal_GlyphId
, basegfx::B2DPolyPolygon
&, bool) const override
;
56 IDWriteFontFace
* GetDWFontFace() const;
59 explicit WinFontInstance(const WinFontFace
&, const vcl::font::FontSelectPattern
&);
61 virtual void ImplInitHbFont(hb_font_t
*) override
;
63 WinSalGraphics
*m_pGraphics
;
65 bool m_bIsCJKVerticalFont
;
66 sal_Int32 m_nTmDescent
;
67 mutable sal::systools::COMReference
<IDWriteFontFace
> mxDWFontFace
;
73 explicit TextOutRenderer() = default;
74 TextOutRenderer(const TextOutRenderer
&) = delete;
75 TextOutRenderer
& operator = (const TextOutRenderer
&) = delete;
78 static TextOutRenderer
& get(bool bUseDWrite
, bool bRenderingModeNatural
);
80 virtual ~TextOutRenderer() = default;
82 virtual bool operator ()(GenericSalLayout
const &rLayout
,
83 SalGraphics
&rGraphics
,
85 bool bRenderingModeNatural
) = 0;
88 class ExTextOutRenderer
: public TextOutRenderer
90 ExTextOutRenderer(const ExTextOutRenderer
&) = delete;
91 ExTextOutRenderer
& operator = (const ExTextOutRenderer
&) = delete;
94 explicit ExTextOutRenderer() = default;
96 bool operator ()(GenericSalLayout
const &rLayout
,
97 SalGraphics
&rGraphics
,
99 bool bRenderingModeNatural
) override
;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */