Update ooo320-m1
[ooovba.git] / vcl / source / glyphs / graphite_serverfont.cxx
blobbe424c94b9d25dafd6f3b8e3b3d71cc863ae6221
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: $
10 * $Revision: $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_vcl.hxx"
34 // We need this to enable namespace support in libgrengine headers.
35 #define GR_NAMESPACE
37 // Header files
40 // Platform
41 #include <vcl/sallayout.hxx>
42 // Module
43 #include "gcach_ftyp.hxx"
44 #include <vcl/graphite_features.hxx>
45 #include "graphite_textsrc.hxx"
46 #include <vcl/graphite_serverfont.hxx>
48 #ifndef WNT
51 // An implementation of the GraphiteLayout interface to enable Graphite enabled fonts to be used.
54 GraphiteServerFontLayout::GraphiteServerFontLayout(GraphiteFontAdaptor * pFont) throw()
55 : ServerFontLayout(pFont->font()), mpFont(pFont),
56 maImpl(*mpFont, mpFont->features(), pFont)
58 // Nothing needed here
61 GraphiteServerFontLayout::~GraphiteServerFontLayout() throw()
63 delete mpFont;
64 mpFont = NULL;
67 const sal_Unicode* GraphiteServerFontLayout::getTextPtr() const
69 return maImpl.textSrc()->getLayoutArgs().mpStr +
70 maImpl.textSrc()->getLayoutArgs().mnMinCharPos;
73 sal_GlyphId GraphiteLayoutImpl::getKashidaGlyph(int & width)
75 int nKashidaIndex = mpFont->font().GetGlyphIndex( 0x0640 );
76 if( nKashidaIndex != 0 )
78 const GlyphMetric& rGM = mpFont->font().GetGlyphMetric( nKashidaIndex );
79 width = rGM.GetCharWidth();
81 else
83 width = 0;
85 return nKashidaIndex;
88 #endif