LibreOffice Module canvas (master) 1
ogl_canvasfont.cxx
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
10#include <sal/config.h>
11
12#include <com/sun/star/rendering/FontMetrics.hpp>
14#include <utility>
15
16#include "ogl_canvasfont.hxx"
17#include "ogl_textlayout.hxx"
18
19using namespace ::com::sun::star;
20
21namespace oglcanvas
22{
23 CanvasFont::CanvasFont( rendering::FontRequest aFontRequest,
24 const uno::Sequence< beans::PropertyValue >& extraFontProperties,
25 const geometry::Matrix2D& fontMatrix ) :
26 maFontRequest(std::move( aFontRequest )),
27 mnEmphasisMark(0),
28 maFontMatrix( fontMatrix )
29 {
30 ::canvas::tools::extractExtraFontProperties(extraFontProperties, mnEmphasisMark);
31 }
32
33 uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
34 sal_Int8 nDirection,
35 sal_Int64 nRandomSeed )
36 {
37 std::unique_lock aGuard( m_aMutex );
38
39 return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
40 }
41
42 uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( )
43 {
44 // TODO
45 return uno::Sequence< double >();
46 }
47
48 uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( )
49 {
50 // TODO
51 return uno::Sequence< beans::PropertyValue >();
52 }
53
54 rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( )
55 {
56 std::unique_lock aGuard( m_aMutex );
57
58 return maFontRequest;
59 }
60
61 rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( )
62 {
63 // TODO
64 return rendering::FontMetrics();
65 }
66
67}
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CanvasFont(const CanvasFont &)=delete
make noncopyable
std::mutex m_aMutex
void extractExtraFontProperties(const uno::Sequence< beans::PropertyValue > &rExtraFontProperties, sal_uInt32 &rEmphasisMark)
signed char sal_Int8