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>
13 #include <canvas/canvastools.hxx>
14 
15 #include "ogl_canvasfont.hxx"
16 #include "ogl_textlayout.hxx"
17 
18 using namespace ::com::sun::star;
19 
20 namespace oglcanvas
21 {
22  CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
23  const uno::Sequence< beans::PropertyValue >& extraFontProperties,
24  const geometry::Matrix2D& fontMatrix ) :
26  maFontRequest( rFontRequest ),
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  ::osl::MutexGuard 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  ::osl::MutexGuard 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: */
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getExtraFontProperties() override
osl::Mutex m_aMutex
signed char sal_Int8
CanvasFont(const CanvasFont &)=delete
make noncopyable
mutable::osl::Mutex m_aMutex
virtual css::rendering::FontMetrics SAL_CALL getFontMetrics() override
virtual css::uno::Reference< css::rendering::XTextLayout > SAL_CALL createTextLayout(const css::rendering::StringContext &aText, sal_Int8 nDirection, sal_Int64 nRandomSeed) override
virtual css::rendering::FontRequest SAL_CALL getFontRequest() override
void extractExtraFontProperties(const uno::Sequence< beans::PropertyValue > &rExtraFontProperties, sal_uInt32 &rEmphasisMark)
virtual css::uno::Sequence< double > SAL_CALL getAvailableSizes() override
rtl::Reference< CanvasFont > ImplRef
css::rendering::FontRequest maFontRequest
::cppu::WeakComponentImplHelper< css::rendering::XCanvasFont > CanvasFontBaseT