Branch libreoffice-5-0-4
[LibreOffice.git] / vcl / headless / svptext.cxx
blob1651a3a49c5dae676b249a62694b10ffff5a06c0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/types.h>
21 #include <basegfx/range/b2ibox.hxx>
22 #include "headless/svpgdi.hxx"
24 sal_uInt16 SvpSalGraphics::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel )
26 return m_xTextRenderImpl->SetFont(pIFSD, nFallbackLevel);
29 void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
31 m_xTextRenderImpl->GetFontMetric(pMetric, nFallbackLevel);
34 const FontCharMapPtr SvpSalGraphics::GetFontCharMap() const
36 return m_xTextRenderImpl->GetFontCharMap();
39 bool SvpSalGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
41 return m_xTextRenderImpl->GetFontCapabilities(rFontCapabilities);
44 void SvpSalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection )
46 m_xTextRenderImpl->GetDevFontList(pFontCollection);
49 void SvpSalGraphics::ClearDevFontCache()
51 m_xTextRenderImpl->ClearDevFontCache();
54 bool SvpSalGraphics::AddTempDevFont( PhysicalFontCollection* pFontCollection,
55 const OUString& rFileURL, const OUString& rFontName)
57 return m_xTextRenderImpl->AddTempDevFont(pFontCollection, rFileURL, rFontName);
60 bool SvpSalGraphics::CreateFontSubset(
61 const OUString& rToFile,
62 const PhysicalFontFace* pFont,
63 const sal_GlyphId* pGlyphIds,
64 const sal_uInt8* pEncoding,
65 sal_Int32* pWidths,
66 int nGlyphCount,
67 FontSubsetInfo& rInfo)
69 return m_xTextRenderImpl->CreateFontSubset(rToFile, pFont, pGlyphIds, pEncoding, pWidths, nGlyphCount, rInfo);
72 const Ucs2SIntMap* SvpSalGraphics::GetFontEncodingVector( const PhysicalFontFace* pFont, const Ucs2OStrMap** pNonEncoded, std::set<sal_Unicode> const** ppPriority)
74 return m_xTextRenderImpl->GetFontEncodingVector(pFont, pNonEncoded, ppPriority);
77 const void* SvpSalGraphics::GetEmbedFontData(
78 const PhysicalFontFace* pFont,
79 const sal_Ucs* pUnicodes,
80 sal_Int32* pWidths,
81 size_t nLen,
82 FontSubsetInfo& rInfo,
83 long* pDataLen)
85 return m_xTextRenderImpl->GetEmbedFontData(pFont, pUnicodes, pWidths, nLen, rInfo, pDataLen);
88 void SvpSalGraphics::FreeEmbedFontData( const void* pData, long nLen )
90 m_xTextRenderImpl->FreeEmbedFontData(pData, nLen);
93 void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
94 bool bVertical,
95 Int32Vector& rWidths,
96 Ucs2UIntMap& rUnicodeEnc )
98 m_xTextRenderImpl->GetGlyphWidths(pFont, bVertical, rWidths, rUnicodeEnc);
101 bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
103 return m_xTextRenderImpl->GetGlyphBoundRect(aGlyphId, rRect);
106 bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
108 return m_xTextRenderImpl->GetGlyphOutline(aGlyphId, rPolyPoly);
111 SalLayout* SvpSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
113 return m_xTextRenderImpl->GetTextLayout(rArgs, nFallbackLevel);
116 void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout )
118 m_xTextRenderImpl->DrawServerFontLayout(rSalLayout );
121 void SvpSalGraphics::SetTextColor( SalColor nSalColor )
123 m_xTextRenderImpl->SetTextColor(nSalColor);
126 SystemFontData SvpSalGraphics::GetSysFontData( int nFallbacklevel ) const
128 return m_xTextRenderImpl->GetSysFontData(nFallbacklevel);
131 void SvpSalGraphics::BlendTextColor(const basebmp::Color &rTextColor, const basebmp::BitmapDeviceSharedPtr &rAlphaMask,
132 const basegfx::B2IPoint &rDstPoint)
134 // blend text color into target using the glyph's mask
135 const basegfx::B2IBox aSrcRect(basegfx::B2ITuple(0,0), rAlphaMask->getSize());
136 const basegfx::B2IBox aClipRect(rDstPoint, rAlphaMask->getSize());
138 SvpSalGraphics::ClipUndoHandle aUndo(this);
139 if (isClippedSetup(aClipRect, aUndo))
140 return;
142 m_aDevice->drawMaskedColor(rTextColor, rAlphaMask, aSrcRect, rDstPoint, m_aClipMap);
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */