10d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 30d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 40d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 50d63794cSAndrew Rist * distributed with this work for additional information 60d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 70d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 80d63794cSAndrew Rist * "License"); you may not use this file except in compliance 90d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 100d63794cSAndrew Rist * 110d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 120d63794cSAndrew Rist * 130d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 140d63794cSAndrew Rist * software distributed under the License is distributed on an 150d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 160d63794cSAndrew Rist * KIND, either express or implied. See the License for the 170d63794cSAndrew Rist * specific language governing permissions and limitations 180d63794cSAndrew Rist * under the License. 190d63794cSAndrew Rist * 200d63794cSAndrew Rist *************************************************************/ 210d63794cSAndrew Rist 220d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SV_FONT_HXX 25cdf0e10cSrcweir #define _SV_FONT_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <vcl/dllapi.h> 28cdf0e10cSrcweir #include <tools/gen.hxx> 29cdf0e10cSrcweir #include <tools/string.hxx> 30cdf0e10cSrcweir #include <i18npool/lang.h> 31cdf0e10cSrcweir #include <tools/color.hxx> 32cdf0e10cSrcweir #include <vcl/vclenum.hxx> 33cdf0e10cSrcweir #include <vcl/fntstyle.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir class SvStream; 36cdf0e10cSrcweir #define FontAlign TextAlign 37cdf0e10cSrcweir 38cdf0e10cSrcweir class Impl_Font; 39cdf0e10cSrcweir class ImplFontAttributes; 40cdf0e10cSrcweir 41cdf0e10cSrcweir // -------- 42cdf0e10cSrcweir // - Font - 43cdf0e10cSrcweir // -------- 44cdf0e10cSrcweir 45cdf0e10cSrcweir class VCL_DLLPUBLIC Font 46cdf0e10cSrcweir { 47cdf0e10cSrcweir private: 48cdf0e10cSrcweir Impl_Font* mpImplFont; 49cdf0e10cSrcweir void MakeUnique(); 50cdf0e10cSrcweir 51cdf0e10cSrcweir public: 52cdf0e10cSrcweir Font(); 53cdf0e10cSrcweir Font( const Font& ); 54cdf0e10cSrcweir Font( const String& rFamilyName, const Size& ); 55cdf0e10cSrcweir Font( const String& rFamilyName, const String& rStyleName, const Size& ); 56cdf0e10cSrcweir Font( FontFamily eFamily, const Size& ); 57cdf0e10cSrcweir ~Font(); 58cdf0e10cSrcweir 59*8681e0b5SHerbert Dürr // setting the color on the font is obsolete, the only remaining 60*8681e0b5SHerbert Dürr // valid use is for keeping backward compatibility with old MetaFiles 61cdf0e10cSrcweir void SetColor( const Color& ); 62cdf0e10cSrcweir const Color& GetColor() const; 63cdf0e10cSrcweir void SetFillColor( const Color& ); 64cdf0e10cSrcweir const Color& GetFillColor() const; 65cdf0e10cSrcweir void SetTransparent( sal_Bool bTransparent ); 66cdf0e10cSrcweir sal_Bool IsTransparent() const; 67*8681e0b5SHerbert Dürr 68cdf0e10cSrcweir void SetAlign( FontAlign ); 69cdf0e10cSrcweir FontAlign GetAlign() const; 70cdf0e10cSrcweir 71cdf0e10cSrcweir void SetName( const String& rFamilyName ); 72cdf0e10cSrcweir const String& GetName() const; 73cdf0e10cSrcweir void SetStyleName( const String& rStyleName ); 74cdf0e10cSrcweir const String& GetStyleName() const; 75cdf0e10cSrcweir void SetSize( const Size& ); 76cdf0e10cSrcweir const Size& GetSize() const; 77cdf0e10cSrcweir void SetHeight( long nHeight ); 78cdf0e10cSrcweir long GetHeight() const; 79cdf0e10cSrcweir void SetWidth( long nWidth ); 80cdf0e10cSrcweir long GetWidth() const; 81cdf0e10cSrcweir 82cdf0e10cSrcweir void SetFamily( FontFamily ); 83cdf0e10cSrcweir FontFamily GetFamily() const; 84cdf0e10cSrcweir void SetCharSet( rtl_TextEncoding ); 85cdf0e10cSrcweir rtl_TextEncoding GetCharSet() const; 86cdf0e10cSrcweir void SetLanguage( LanguageType ); 87cdf0e10cSrcweir LanguageType GetLanguage() const; 88cdf0e10cSrcweir void SetCJKContextLanguage( LanguageType ); 89cdf0e10cSrcweir LanguageType GetCJKContextLanguage() const; 90cdf0e10cSrcweir void SetPitch( FontPitch ePitch ); 91cdf0e10cSrcweir FontPitch GetPitch() const; 92cdf0e10cSrcweir 93cdf0e10cSrcweir void SetOrientation( short nLineOrientation ); 94cdf0e10cSrcweir short GetOrientation() const; 95cdf0e10cSrcweir void SetVertical( sal_Bool bVertical ); 96cdf0e10cSrcweir sal_Bool IsVertical() const; 97cdf0e10cSrcweir void SetKerning( FontKerning nKerning ); 98cdf0e10cSrcweir FontKerning GetKerning() const; 99cdf0e10cSrcweir sal_Bool IsKerning() const; 100cdf0e10cSrcweir 101cdf0e10cSrcweir void SetWeight( FontWeight ); 102cdf0e10cSrcweir FontWeight GetWeight() const; 103cdf0e10cSrcweir void SetWidthType( FontWidth ); 104cdf0e10cSrcweir FontWidth GetWidthType() const; 105cdf0e10cSrcweir void SetItalic( FontItalic ); 106cdf0e10cSrcweir FontItalic GetItalic() const; 107cdf0e10cSrcweir void SetOutline( sal_Bool bOutline ); 108cdf0e10cSrcweir sal_Bool IsOutline() const; 109cdf0e10cSrcweir void SetShadow( sal_Bool bShadow ); 110cdf0e10cSrcweir sal_Bool IsShadow() const; 111cdf0e10cSrcweir void SetRelief( FontRelief ); 112cdf0e10cSrcweir FontRelief GetRelief() const; 113cdf0e10cSrcweir void SetUnderline( FontUnderline ); 114cdf0e10cSrcweir FontUnderline GetUnderline() const; 115cdf0e10cSrcweir void SetOverline( FontUnderline ); 116cdf0e10cSrcweir FontUnderline GetOverline() const; 117cdf0e10cSrcweir void SetStrikeout( FontStrikeout ); 118cdf0e10cSrcweir FontStrikeout GetStrikeout() const; 119cdf0e10cSrcweir void SetEmphasisMark( FontEmphasisMark ); 120cdf0e10cSrcweir FontEmphasisMark GetEmphasisMark() const; 121cdf0e10cSrcweir void SetWordLineMode( sal_Bool bWordLine ); 122cdf0e10cSrcweir sal_Bool IsWordLineMode() const; 123cdf0e10cSrcweir 124cdf0e10cSrcweir void Merge( const Font& rFont ); 125cdf0e10cSrcweir void GetFontAttributes( ImplFontAttributes& rAttrs ) const; 126cdf0e10cSrcweir 127cdf0e10cSrcweir Font& operator=( const Font& ); 128cdf0e10cSrcweir sal_Bool operator==( const Font& ) const; operator !=(const Font & rFont) const129cdf0e10cSrcweir sal_Bool operator!=( const Font& rFont ) const 130cdf0e10cSrcweir { return !(Font::operator==( rFont )); } 131cdf0e10cSrcweir sal_Bool IsSameInstance( const Font& ) const; 132cdf0e10cSrcweir 133cdf0e10cSrcweir friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, Font& ); 134cdf0e10cSrcweir friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const Font& ); 135cdf0e10cSrcweir 136cdf0e10cSrcweir static Font identifyFont( const void* pBuffer, sal_uInt32 nLen ); 137cdf0e10cSrcweir }; 138cdf0e10cSrcweir 139cdf0e10cSrcweir #endif // _VCL_FONT_HXX 140