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 ) :
27 maFontRequest(std::move( aFontRequest )),
28 mnEmphasisMark(0),
29 maFontMatrix( fontMatrix )
30 {
31 ::canvas::tools::extractExtraFontProperties(extraFontProperties, mnEmphasisMark);
32 }
33
34 uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
35 sal_Int8 nDirection,
36 sal_Int64 nRandomSeed )
37 {
38 ::osl::MutexGuard aGuard( m_aMutex );
39
40 return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
41 }
42
43 uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( )
44 {
45 // TODO
46 return uno::Sequence< double >();
47 }
48
49 uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( )
50 {
51 // TODO
52 return uno::Sequence< beans::PropertyValue >();
53 }
54
55 rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( )
56 {
57 ::osl::MutexGuard aGuard( m_aMutex );
58
59 return maFontRequest;
60 }
61
62 rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( )
63 {
64 // TODO
65 return rendering::FontMetrics();
66 }
67
68}
69
70/* 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)
::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT
signed char sal_Int8