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: svxfont.hxx,v $
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 ************************************************************************/
30 #ifndef _SVX_SVXFONT_HXX
31 #define _SVX_SVXFONT_HXX
33 #include <limits.h> // USHRT_MAX
34 #ifndef _SVX_SVXENUM_HXX
35 #include <bf_svx/svxenum.hxx>
38 #ifndef INCLUDED_I18NPOOL_LANG_H
39 #include <i18npool/lang.h>
41 #ifndef _SV_FONT_HXX //autogen
42 #include <vcl/font.hxx>
50 class SvxFont
: public Font
52 LanguageType eLang
; // Language
53 SvxCaseMap eCaseMap
; // Textauszeichnung
54 short nEsc
; // Grad der Hoch-/Tiefstellung
55 BYTE nPropr
; // Grad der Verkleinerung der Fonthoehe
56 short nKern
; // Kerning in Pt
60 SvxFont( const Font
&rFont
);
61 SvxFont( const SvxFont
&rFont
);
63 // Methoden fuer die Hoch-/Tiefstellung
64 inline short GetEscapement() const { return nEsc
; }
65 inline void SetEscapement( const short nNewEsc
) { nEsc
= nNewEsc
; }
67 inline BYTE
GetPropr() const { return nPropr
; }
68 inline void SetPropr( const BYTE nNewPropr
) { nPropr
= nNewPropr
; }
69 inline void SetProprRel( const BYTE nNewPropr
)
70 { SetPropr( (BYTE
)( (long)nNewPropr
* (long)nPropr
/ 100L ) ); }
73 inline short GetFixKerning() const { return nKern
; }
74 inline void SetFixKerning( const short nNewKern
) { nKern
= nNewKern
; }
76 inline SvxCaseMap
GetCaseMap() const { return eCaseMap
; }
77 inline void SetCaseMap( const SvxCaseMap eNew
) { eCaseMap
= eNew
; }
79 inline LanguageType
GetLanguage() const { return eLang
; }
80 inline void SetLanguage( const LanguageType eNewLan
) { eLang
= eNewLan
; }
83 inline BOOL
IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED
!= eCaseMap
; }
84 inline BOOL
IsCapital() const { return SVX_CASEMAP_KAPITAELCHEN
== eCaseMap
; }
85 inline BOOL
IsKern() const { return 0 != nKern
; }
86 inline BOOL
IsEsc() const { return 0 != nEsc
; }
88 // Versalien, Gemeine etc. beruecksichtigen
89 String
CalcCaseMap( const String
&rTxt
) const;
91 // Der folgende Bereich wird nicht von jedem benoetigt, er kann deshalb
92 // ausgeklammert werden.
93 #ifndef REDUCEDSVXFONT
94 // Kapitaelchenbearbeitung
96 void SetPhysFont( OutputDevice
*pOut
) const;
100 Size
GetPhysTxtSize( const OutputDevice
*pOut
, const String
&rTxt
);
104 void QuickDrawText( OutputDevice
*pOut
, const Point
&rPos
, const String
&rTxt
,
105 const USHORT nIdx
= 0, const USHORT nLen
= STRING_LEN
, const sal_Int32
* pDXArray
= NULL
) const;
107 Size
QuickGetTextSize( const OutputDevice
*pOut
, const String
&rTxt
,
108 const USHORT nIdx
, const USHORT nLen
, sal_Int32
* pDXArray
= NULL
) const;
111 #endif // !REDUCEDSVXFONT
112 SvxFont
& operator=( const SvxFont
& rFont
);
113 SvxFont
& operator=( const Font
& rFont
);
116 }//end of namespace binfilter
117 #endif // #ifndef _SVX_SVXFONT_HXX