LibreOffice Module vcl (master)  1
winlayout.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 #ifndef INCLUDED_VCL_INC_WIN_WINLAYOUT_HXX
21 #define INCLUDED_VCL_INC_WIN_WINLAYOUT_HXX
22 
23 #include <rtl/ustring.hxx>
24 
25 #include <sallayout.hxx>
26 #include <svsys.h>
27 #include <win/salgdi.h>
28 #include <o3tl/sorted_vector.hxx>
29 
30 // win32 specific logical font instance
32 {
34 
35 public:
36  ~WinFontInstance() override;
37 
38  bool hasHScale() const;
39  float getHScale() const;
40 
42  WinSalGraphics* GetGraphics() const { return m_pGraphics; }
43 
44  HFONT GetHFONT() const { return m_hFont; }
45  float GetScale() const { return m_fScale; }
46 
47  // Prevent deletion of the HFONT in the WinFontInstance destructor
48  // Used for the ScopedFont handling
49  void SetHFONT(HFONT hFont) { m_hFont = hFont; }
50 
51  const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); }
53 
54  bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override;
55 
56 private:
57  explicit WinFontInstance(const WinFontFace&, const FontSelectPattern&);
58 
59  hb_font_t* ImplInitHbFont() override;
60  bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const override;
61 
63  HFONT m_hFont;
64  float m_fScale;
65 };
66 
68 {
69 protected:
70  explicit TextOutRenderer() = default;
71  TextOutRenderer(const TextOutRenderer &) = delete;
72  TextOutRenderer & operator = (const TextOutRenderer &) = delete;
73 
74 public:
75  static TextOutRenderer & get(bool bUseDWrite);
76 
77  virtual ~TextOutRenderer() = default;
78 
79  virtual bool operator ()(GenericSalLayout const &rLayout,
80  SalGraphics &rGraphics,
81  HDC hDC) = 0;
82 };
83 
85 {
86  ExTextOutRenderer(const ExTextOutRenderer &) = delete;
88 
89 public:
90  explicit ExTextOutRenderer() = default;
91 
92  bool operator ()(GenericSalLayout const &rLayout,
93  SalGraphics &rGraphics,
94  HDC hDC) override;
95 };
96 
97 #endif // INCLUDED_VCL_INC_WIN_WINLAYOUT_HXX
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetHFONT(HFONT hFont)
Definition: winlayout.hxx:49
virtual ~TextOutRenderer()=default
WinSalGraphics * GetGraphics() const
Definition: winlayout.hxx:42
bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle &, bool) const override
bool hasHScale() const
TextOutRenderer & operator=(const TextOutRenderer &)=delete
sal_uInt16 sal_GlyphId
Definition: glyphitem.hxx:28
TextOutRenderer()=default
virtual bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC)=0
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon &, bool) const override
~WinFontInstance() override
virtual rtl::Reference< LogicalFontInstance > CreateFontInstance(const FontSelectPattern &) const override
bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC) override
void SetGraphics(WinSalGraphics *)
WinFontInstance(const WinFontFace &, const FontSelectPattern &)
float getHScale() const
const WinFontFace * GetFontFace() const
Definition: winlayout.hxx:51
ExTextOutRenderer()=default
ExTextOutRenderer & operator=(const ExTextOutRenderer &)=delete
WinFontFace * GetFontFace()
Definition: winlayout.hxx:52
WinSalGraphics * m_pGraphics
Definition: winlayout.hxx:62
const PhysicalFontFace * GetFontFace() const
HFONT GetHFONT() const
Definition: winlayout.hxx:44
hb_font_t * ImplInitHbFont() override
float GetScale() const
Definition: winlayout.hxx:45