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#pragma once
21
22#include <sal/config.h>
23
24#include <rtl/ustring.hxx>
25
26#include <sallayout.hxx>
27#include <svsys.h>
28#include <win/salgdi.h>
30
31// win32 specific logical font instance
33{
35
36public:
37 ~WinFontInstance() override;
38
39 bool hasHScale() const;
40 float getHScale() const;
41
44
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; }
50
51 const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); }
53
55
56 IDWriteFontFace* GetDWFontFace() const;
57
58private:
60
61 virtual void ImplInitHbFont(hb_font_t*) override;
62
64 HFONT m_hFont;
66 sal_Int32 m_nTmDescent;
67 mutable sal::systools::COMReference<IDWriteFontFace> mxDWFontFace;
68};
69
71{
72protected:
73 explicit TextOutRenderer() = default;
76
77public:
78 static TextOutRenderer & get(bool bUseDWrite, bool bRenderingModeNatural);
79
80 virtual ~TextOutRenderer() = default;
81
82 virtual bool operator ()(GenericSalLayout const &rLayout,
83 SalGraphics &rGraphics,
84 HDC hDC,
85 bool bRenderingModeNatural) = 0;
86};
87
89{
92
93public:
94 explicit ExTextOutRenderer() = default;
95
96 bool operator ()(GenericSalLayout const &rLayout,
97 SalGraphics &rGraphics,
98 HDC hDC,
99 bool bRenderingModeNatural) override;
100};
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ExTextOutRenderer & operator=(const ExTextOutRenderer &)=delete
ExTextOutRenderer()=default
ExTextOutRenderer(const ExTextOutRenderer &)=delete
bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool bRenderingModeNatural) override
const vcl::font::PhysicalFontFace * GetFontFace() const
virtual bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool bRenderingModeNatural)=0
static TextOutRenderer & get(bool bUseDWrite, bool bRenderingModeNatural)
virtual ~TextOutRenderer()=default
TextOutRenderer & operator=(const TextOutRenderer &)=delete
TextOutRenderer(const TextOutRenderer &)=delete
TextOutRenderer()=default
rtl::Reference< LogicalFontInstance > CreateFontInstance(const vcl::font::FontSelectPattern &) const override
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon &, bool) const override
~WinFontInstance() override
HFONT GetHFONT() const
Definition: winlayout.hxx:45
float getHScale() const
sal::systools::COMReference< IDWriteFontFace > mxDWFontFace
Definition: winlayout.hxx:67
bool IsCJKVerticalFont() const
Definition: winlayout.hxx:48
bool m_bIsCJKVerticalFont
Definition: winlayout.hxx:65
void SetGraphics(WinSalGraphics *)
sal_Int32 m_nTmDescent
Definition: winlayout.hxx:66
const WinFontFace * GetFontFace() const
Definition: winlayout.hxx:51
bool hasHScale() const
sal_Int32 GetTmDescent() const
Definition: winlayout.hxx:49
WinFontFace * GetFontFace()
Definition: winlayout.hxx:52
WinSalGraphics * m_pGraphics
Definition: winlayout.hxx:63
IDWriteFontFace * GetDWFontFace() const
WinSalGraphics * GetGraphics() const
Definition: winlayout.hxx:43
virtual void ImplInitHbFont(hb_font_t *) override
WinFontInstance(const WinFontFace &, const vcl::font::FontSelectPattern &)
WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with diff...
Definition: win/salgdi.h:141
uint32_t sal_GlyphId
Definition: glyphid.hxx:24