LibreOffice Module drawinglayer (master) 1
textlayoutdevice.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
23
25#include <vector>
27#include <vcl/svapp.hxx>
28
29// predefines
30class VirtualDevice;
31class GDIMetaFile;
32enum class DrawTextFlags;
33namespace vcl
34{
35class Font;
36}
37namespace tools
38{
39class Rectangle;
40}
42{
43class FontAttribute;
44}
46{
47struct Locale;
48}
49
50// access to one global impTimedRefDev incarnation in namespace drawinglayer::primitive
51
53{
62{
66
67public:
70 ~TextLayouterDevice() COVERITY_NOEXCEPT_FALSE;
71
73 void setFont(const vcl::Font& rFont);
74 void setFontAttribute(const attribute::FontAttribute& rFontAttribute, double fFontScaleX,
75 double fFontScaleY, const css::lang::Locale& rLocale);
76
77 double getTextHeight() const;
78 double getOverlineHeight() const;
79 double getOverlineOffset() const;
80 double getUnderlineHeight() const;
81 double getUnderlineOffset() const;
82 double getStrikeoutOffset() const;
83
84 double getTextWidth(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength) const;
85
86 void getTextOutlines(basegfx::B2DPolyPolygonVector&, const OUString& rText, sal_uInt32 nIndex,
87 sal_uInt32 nLength, const ::std::vector<double>& rDXArray,
88 const ::std::vector<sal_Bool>& rKashidaArray) const;
89
90 basegfx::B2DRange getTextBoundRect(const OUString& rText, sal_uInt32 nIndex,
91 sal_uInt32 nLength) const;
92
93 double getFontAscent() const;
94 double getFontDescent() const;
95
96 void addTextRectActions(const tools::Rectangle& rRectangle, const OUString& rText,
97 DrawTextFlags nStyle, GDIMetaFile& rGDIMetaFile) const;
98
99 ::std::vector<double> getTextArray(const OUString& rText, sal_uInt32 nIndex, sal_uInt32 nLength,
100 bool bCaret = false) const;
101};
102
103// helper methods for vcl font handling
104
112 const attribute::FontAttribute& rFontAttribute, double fFontScaleX, double fFontScaleY,
113 double fFontRotation, const css::lang::Locale& rLocale);
114
121 basegfx::B2DVector& o_rSize, const vcl::Font& rFont, bool bRTL, bool bBiDiStrong);
122
123} // end of namespace drawinglayer::primitive2d
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawTextFlags
SolarMutexGuard maSolarGuard
internally used VirtualDevice
#define DRAWINGLAYER_DLLPUBLIC
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute &rFontAttribute, double fFontScaleX, double fFontScaleY, double fFontRotation, const css::lang::Locale &rLocale)
Create a VCL-Font based on the definitions in FontAttribute and the given FontScaling.
attribute::FontAttribute getFontAttributeFromVclFont(basegfx::B2DVector &o_rSize, const vcl::Font &rFont, bool bRTL, bool bBiDiStrong)
Generate FontAttribute DataSet derived from the given VCL-Font.
FontAttribute
unsigned char sal_Bool