diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-07-13 08:41:08 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-07-13 08:41:08 +0000 |
commit | 57b9a8ced15ce5fb4e88043f55d8e79aeeefe378 (patch) | |
tree | ec9a59af4bb26375b437ef3941f611cae57bb7bb /vcl/win/inc | |
parent | 5ac0212986c9f99f8f4e265d28af19532aba104f (diff) |
INTEGRATION: CWS fontlists02 (1.11.92); FILE MERGED
2004/06/23 10:58:14 hdu 1.11.92.6: #i26679# delay GSUB parsing, add multilevel fontentry/fontface to win graphics
2004/06/18 11:17:49 hdu 1.11.92.5: #i26679# manage Win font face specific info with specialized class
2004/06/10 12:07:41 hdu 1.11.92.4: RESYNC: (1.11-1.12); FILE MERGED
2004/06/02 16:19:20 hdu 1.11.92.3: #i26679# extend ImplFontData/ImplFontEntry with Win32 specific classes; get rid of mxTextLayoutCache
2004/05/12 14:02:57 hdu 1.11.92.2: #i26679# renamed FontStruct to FontAttributes
2004/03/25 16:39:03 hdu 1.11.92.1: Font Management Refactoring, first step:
Keep the externally visible original algorithms intact
Split up the ImplFontCache::Get(..) monster method
Make implicit relationships between font management classes explicit
Allow derivation from ImplFontData+ImplFontEntry for font technology specific caching
Get rid of linear searches in mainstream code, use efficient STL containers
Get rid of some obsolete data types BOOL->bool, USHORT->int, etc.
Improve infrastructure for unicode surrogate processing
Diffstat (limited to 'vcl/win/inc')
-rw-r--r-- | vcl/win/inc/salgdi.h | 96 |
1 files changed, 67 insertions, 29 deletions
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index 461c2a19a10e..15a68f769012 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -2,9 +2,9 @@ * * $RCSfile: salgdi.h,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: hr $ $Date: 2004-05-10 16:01:37 $ + * last change: $Author: rt $ $Date: 2004-07-13 09:41:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,10 +71,18 @@ #ifndef _SV_SALGDI_HXX #include <salgdi.hxx> #endif +#ifndef _SV_OUTFONT_HXX +#include <outfont.hxx> +#endif +#ifndef _SV_IMPFONT_HXX +#include <impfont.hxx> +#endif #include "boost/scoped_ptr.hpp" +#include <hash_set> -struct ImplFontSelectData; +class ImplFontSelectData; +class ImplWinFontEntry; // ----------- // - Defines - @@ -83,20 +91,56 @@ struct ImplFontSelectData; #define RGB_TO_PALRGB(nRGB) ((nRGB)|0x02000000) #define PALRGB_TO_RGB(nPalRGB) ((nPalRGB)&0x00ffffff) -// win32 platform specifics, maybe move pmk file +// win32 platform specific options. Move them to the PMK file? #define USE_UNISCRIBE #define GCP_KERN_HACK +#define GNG_VERT_HACK -// Instances of classes derived from SalLayout might collectively want to cache -// font data; see the mxTextLayoutCache member of SalGraphicsData. Since -// different derived classes will typically cache different data, this abstract -// class offers only the minimal interface needed from the outside: -class ImplTextLayoutCache +// win32 specific physically available font face +class ImplWinFontData : public ImplFontData { public: - virtual inline ~ImplTextLayoutCache() {}; + ImplWinFontData( const ImplDevFontAttributes&, + WIN_BYTE eWinCharSet, int nHeight = 0 ); + ~ImplWinFontData(); + + virtual ImplFontData* Clone() const; + virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; + void UpdateFromHDC( HDC ); + + bool HasChar( sal_Unicode c ) const { return mpUnicodeMap->HasChar(c); } + WIN_BYTE GetCharSet() const { return meWinCharSet; } + bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; } + bool SupportsKorean() const { return mbHasKoreanRange; } + bool SupportsCJK() const { return mbHasCJKSupport; } + ImplFontCharMap* GetImplFontCharMap(); + +private: + bool mbDisableGlyphApi; + bool mbHasKoreanRange; + bool mbHasCJKSupport; + + ImplFontCharMap* mpUnicodeMap; + + // TODO: get rid of the members below needed to work with the Win9x non-unicode API + BYTE* mpFontCharSets; // all Charsets for the current font (used on W98 for kerning) + BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + WIN_BYTE meWinCharSet; + +private: + void ReadCmapTable( HDC ); + void ReadOs2Table( HDC ); + +#ifdef GNG_VERT_HACK + void ReadGsubTable( HDC ) const; - virtual void flush( int nMinLevel ) = 0; + typedef std::hash_set<int> IntHashSet; + mutable IntHashSet maGsubTable; + mutable bool mbGsubRead; +public: + bool HasGSUBstitutions( HDC ) const; + bool IsGSUBstituted( sal_Unicode ) const; +#endif // GNG_VERT_HACK }; // ------------------- @@ -108,7 +152,9 @@ class WinSalGraphics : public SalGraphics public: HDC mhDC; // HDC HWND mhWnd; // Window-Handle, when Window-Graphics - HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks + HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks + ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face + ImplWinFontEntry* mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance HPEN mhPen; // Pen HBRUSH mhBrush; // Brush HRGN mhRegion; // Region Handle @@ -126,9 +172,9 @@ public: LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x) BYTE* mpFontCharSets; // All Charsets for the current font BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + BOOL mbFontKernInit; // FALSE: FontKerns must be queried KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font ULONG mnFontKernPairCount;// Number of Kerning Pairs of the current Font - BOOL mbFontKernInit; // FALSE: FontKerns must be queried int mnPenWidth; // Linienbreite BOOL mbStockPen; // is Pen a stockpen BOOL mbStockBrush; // is Brush a stcokbrush @@ -140,10 +186,6 @@ public: BOOL mbScreen; // is Screen compatible BOOL mbXORMode; // _every_ output with RasterOp XOR - // Used collectively by the (derived) SalLayout instances returned by - // SalGraphics::GetTextLayout, to cache data derived from mhDC's font; - // flushed whenever a new font is selected into mhDC: - boost::scoped_ptr< ImplTextLayoutCache > mxTextLayoutCache; public: WinSalGraphics(); virtual ~WinSalGraphics(); @@ -247,16 +289,14 @@ public: // get kernign pairs of the current font // return only PairCount if (pKernPairs == NULL) virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ); - // get the repertoire of the current font; the code pairs returned - // contain unicode ranges. if pCodePairs is NULL return only the - // number of pairs which would be filled - virtual ULONG GetFontCodeRanges( sal_uInt32* pCodePairs ) const; + // get the repertoire of the current font + virtual ImplFontCharMap* GetImplFontCharMap() const; // graphics must fill supplied font list virtual void GetDevFontList( ImplDevFontList* ); // graphics should call ImplAddDevFontSubstitute on supplied // OutputDevice for all its device specific preferred font substitutions virtual void GetDevFontSubstList( OutputDevice* ); - virtual ImplFontData* AddTempDevFont( const String& rFileURL, const String& rFontName ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); // CreateFontSubset: a method to get a subset of glyhps of a font // inside a new valid font file // returns TRUE if creation of subset was successfull @@ -317,10 +357,8 @@ void ImplSalInitGraphics( WinSalGraphics* mpData ); void ImplSalDeInitGraphics( WinSalGraphics* mpData ); void ImplUpdateSysColorEntries(); int ImplIsSysColorEntry( SalColor nSalColor ); -void ImplGetLogFontFromFontSelect( HDC hDC, - const ImplFontSelectData* pFont, - LOGFONTW& rLogFont, - bool bTestVerticalAvail ); +void ImplGetLogFontFromFontSelect( HDC hDC, const ImplFontSelectData*, + LOGFONTW&, bool bTestVerticalAvail ); // ----------- // - Defines - @@ -338,9 +376,9 @@ inline bool ImplCmpKernData( const KERNINGPAIR& a, const KERNINGPAIR& b ) { if( a.wFirst < b.wFirst ) return true; - if( (a.wFirst == b.wFirst) && (a.wSecond < b.wSecond) ) - return true; - return false; + if( a.wFirst > b.wFirst ) + return false; + return (a.wSecond < b.wSecond); } #endif // _SV_SALGDI_H |