summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/vcl/fontmanager.hxx15
-rw-r--r--vcl/inc/vcl/glyphcache.hxx10
-rw-r--r--vcl/inc/vcl/impfont.hxx35
-rw-r--r--vcl/inc/vcl/outdev.hxx2
-rw-r--r--vcl/inc/vcl/outfont.hxx14
-rw-r--r--vcl/inc/vcl/salgdi.hxx3
-rw-r--r--vcl/inc/vcl/settings.hxx6
-rw-r--r--vcl/inc/vcl/vclenum.hxx21
8 files changed, 82 insertions, 24 deletions
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index 7e1733b49bca..6ebd777f1c61 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -49,6 +49,7 @@
// forward declarations
namespace utl { class MultiAtomProvider; } // see unotools/atom.hxx
class FontSubsetInfo;
+class ImplFontOptions;
namespace psp {
class PPDParser; // see ppdparser.hxx
@@ -162,8 +163,6 @@ struct FastPrintFontInfo
weight::type m_eWeight;
pitch::type m_ePitch;
rtl_TextEncoding m_aEncoding;
- fcstatus::type m_eEmbeddedbitmap;
- fcstatus::type m_eAntialias;
bool m_bSubsettable;
bool m_bEmbeddable;
@@ -175,9 +174,7 @@ struct FastPrintFontInfo
m_eWidth( width::Unknown ),
m_eWeight( weight::Unknown ),
m_ePitch( pitch::Unknown ),
- m_aEncoding( RTL_TEXTENCODING_DONTKNOW ),
- m_eEmbeddedbitmap( fcstatus::isunset ),
- m_eAntialias( fcstatus::isunset )
+ m_aEncoding( RTL_TEXTENCODING_DONTKNOW )
{}
};
@@ -294,9 +291,6 @@ class VCL_DLLPUBLIC PrintFontManager
bool m_bHaveVerticalSubstitutedGlyphs;
bool m_bUserOverride;
- fcstatus::type m_eEmbeddedbitmap;
- fcstatus::type m_eAntialias;
-
std::map< sal_Unicode, sal_Int32 > m_aEncodingVector;
std::map< sal_Unicode, rtl::OString > m_aNonEncoded;
@@ -736,10 +730,11 @@ public:
false else
*/
bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
+ bool getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*), ImplFontOptions& rResult ) const;
rtl::OUString Substitute( const rtl::OUString& rFontName, rtl::OUString& rMissingCodes,
- const rtl::OString& rLangAttrib, italic::type eItalic, weight::type eWeight,
- width::type eWidth, pitch::type ePitch) const;
+ const rtl::OString& rLangAttrib, italic::type& rItalic, weight::type& rWeight,
+ width::type& rWidth, pitch::type& rPitch) const;
bool hasFontconfig() const { return m_bFontconfigSuccess; }
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx
index 8c7d6e41b168..fa3e99f2373f 100644
--- a/vcl/inc/vcl/glyphcache.hxx
+++ b/vcl/inc/vcl/glyphcache.hxx
@@ -39,6 +39,7 @@ class ServerFontLayoutEngine;
class ServerFontLayout;
class ExtraKernInfo;
struct ImplKernPairData;
+class ImplFontOptions;
#include <tools/gen.hxx>
#include <hash_map>
@@ -59,8 +60,8 @@ class ServerFontLayout;
class VCL_DLLPUBLIC GlyphCache
{
public:
- GlyphCache( GlyphCachePeer& );
- ~GlyphCache();
+ explicit GlyphCache( GlyphCachePeer& );
+ /*virtual*/ ~GlyphCache();
static GlyphCache& GetInstance();
void LoadFonts();
@@ -74,6 +75,7 @@ public:
ServerFont* CacheFont( const ImplFontSelectData& );
void UncacheFont( ServerFont& );
+ void InvalidateAllGlyphs();
protected:
GlyphCachePeer& mrPeer;
@@ -96,7 +98,6 @@ private:
struct IFSD_Hash{ size_t operator()( const ImplFontSelectData& ) const; };
typedef ::std::hash_map<ImplFontSelectData,ServerFont*,IFSD_Hash,IFSD_Equal > FontList;
FontList maFontList;
-
ULONG mnMaxSize; // max overall cache size in bytes
mutable ULONG mnBytesUsed;
mutable long mnLruIndex;
@@ -179,6 +180,7 @@ public:
virtual bool TestFont() const { return true; }
virtual void* GetFtFace() const { return 0; }
virtual int GetLoadFlags() const { return 0; }
+ virtual void SetFontOptions( const ImplFontOptions&) {}
virtual bool NeedsArtificialBold() const { return false; }
virtual bool NeedsArtificialItalic() const { return false; }
@@ -208,7 +210,7 @@ public:
protected:
friend class GlyphCache;
friend class ServerFontLayout;
- ServerFont( const ImplFontSelectData& );
+ explicit ServerFont( const ImplFontSelectData& );
virtual ~ServerFont();
void AddRef() const { ++mnRefCount; }
diff --git a/vcl/inc/vcl/impfont.hxx b/vcl/inc/vcl/impfont.hxx
index d53785bc691a..6ce9f21500b5 100644
--- a/vcl/inc/vcl/impfont.hxx
+++ b/vcl/inc/vcl/impfont.hxx
@@ -133,6 +133,41 @@ public:
bool operator==( const ImplFontMetric& ) const;
};
+// ------------------
+// - ImplFontHints -
+// ------------------
+
+class ImplFontOptions
+{
+public:
+ FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
+ FontAntiAlias meAntiAlias; // whether the font should be antialiased
+ FontAutoHint meAutoHint; // whether the font should be autohinted
+ FontHinting meHinting; // whether the font should be hinted
+ FontHintStyle meHintStyle; // type of font hinting to be used
+public:
+ ImplFontOptions() :
+ meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
+ meAntiAlias(ANTIALIAS_DONTKNOW),
+ meAutoHint(AUTOHINT_DONTKNOW),
+ meHinting(HINTING_DONTKNOW),
+ meHintStyle(HINT_SLIGHT)
+ {}
+ ImplFontOptions( FontEmbeddedBitmap eEmbeddedBitmap, FontAntiAlias eAntiAlias,
+ FontAutoHint eAutoHint, FontHinting eHinting, FontHintStyle eHintStyle) :
+ meEmbeddedBitmap(eEmbeddedBitmap),
+ meAntiAlias(eAntiAlias),
+ meAutoHint(eAutoHint),
+ meHinting(eHinting),
+ meHintStyle(eHintStyle)
+ {}
+ FontAutoHint GetUseAutoHint() const { return meAutoHint; }
+ FontHintStyle GetHintStyle() const { return meHintStyle; }
+ bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
+ bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
+ bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
+};
+
// -------------------
// - ImplFontCharMap -
// -------------------
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 101a368b0586..be5c0a880ed7 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -77,6 +77,7 @@ class AlphaMask;
class FontCharMap;
class SalLayout;
class ImplLayoutArgs;
+class ImplFontAttributes;
class VirtualDevice;
namespace com {
@@ -541,7 +542,6 @@ public:
SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont );
SAL_DLLPRIVATE static BOOL ImplIsUnderlineAbove( const Font& );
-
// tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
SAL_DLLPRIVATE bool ImplIsAntiparallel() const ;
diff --git a/vcl/inc/vcl/outfont.hxx b/vcl/inc/vcl/outfont.hxx
index 87c20ebfd7f9..995fcd6009ff 100644
--- a/vcl/inc/vcl/outfont.hxx
+++ b/vcl/inc/vcl/outfont.hxx
@@ -94,8 +94,6 @@ public: // TODO: create matching interface class
bool IsDeviceFont() const { return mbDevice; }
bool IsEmbeddable() const { return mbEmbeddable; }
bool IsSubsettable() const { return mbSubsettable; }
- FontEmbeddedBitmap UseEmbeddedBitmap() const { return meEmbeddedBitmap; }
- FontAntiAlias UseAntiAlias() const { return meAntiAlias; }
public: // TODO: hide members behind accessor methods
String maMapNames; // List of family name aliass separated with ';'
@@ -104,8 +102,6 @@ public: // TODO: hide members behind accessor methods
bool mbDevice; // true: built in font
bool mbSubsettable; // true: a subset of the font can be created
bool mbEmbeddable; // true: the font can be embedded
- FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
- FontAntiAlias meAntiAlias; // whether the font should be antialiased
};
// ----------------
@@ -339,15 +335,17 @@ public: // TODO: make data members private
short mnOrientation; // text angle in 3600 system
bool mbInit; // true if maMetric member is valid
- void AddFallbackForUnicode( sal_UCS4, const String& rFontName );
- bool GetFallbackForUnicode( sal_UCS4, String* pFontName ) const;
- void IgnoreFallbackForUnicode( sal_UCS4, const String& rFontName );
+ void AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
+ bool GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, String* pFontName ) const;
+ void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
private:
// cache of Unicode characters and replacement font names
// TODO: a fallback map can be shared with many other ImplFontEntries
// TODO: at least the ones which just differ in orientation, stretching or height
- typedef ::std::hash_map<sal_UCS4,String> UnicodeFallbackList;
+ typedef ::std::pair<sal_UCS4,FontWeight> GFBCacheKey;
+ struct GFBCacheKey_Hash{ size_t operator()( const GFBCacheKey& ) const; };
+ typedef ::std::hash_map<GFBCacheKey,String,GFBCacheKey_Hash> UnicodeFallbackList;
UnicodeFallbackList* mpUnicodeFallbackList;
};
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index f72c4df57481..02e9efbc0f94 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -234,9 +234,10 @@ public:
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
virtual void GetFontMetric( ImplFontMetricData* ) = 0;
+
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
- virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs ) = 0;
+ virtual ULONG GetKernPairs( ULONG nMaxPairCount, ImplKernPairData* ) = 0;
// get the repertoire of the current font
virtual ImplFontCharMap* GetImplFontCharMap() const = 0;
// graphics must fill supplied font list
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index e55c2a53345b..24fd30750501 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -437,6 +437,7 @@ private:
ULONG mnPreferredSymbolsStyle;
USHORT mnSkipDisabledInMenus;
Wallpaper maWorkspaceGradient;
+ const void* mpFontOptions;
};
#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
@@ -754,6 +755,11 @@ public:
BOOL GetSkipDisabledInMenus() const
{ return (BOOL) mpData->mnSkipDisabledInMenus; }
+ void SetCairoFontOptions( const void *pOptions )
+ { CopyData(); mpData->mpFontOptions = pOptions; }
+ const void* GetCairoFontOptions() const
+ { return mpData->mpFontOptions; }
+
void SetAppFont( const Font& rFont )
{ CopyData(); mpData->maAppFont = rFont; }
const Font& GetAppFont() const
diff --git a/vcl/inc/vcl/vclenum.hxx b/vcl/inc/vcl/vclenum.hxx
index ded36cc163f0..a34c633479e7 100644
--- a/vcl/inc/vcl/vclenum.hxx
+++ b/vcl/inc/vcl/vclenum.hxx
@@ -281,6 +281,27 @@ enum FontAntiAlias { ANTIALIAS_DONTKNOW, ANTIALIAS_FALSE, ANTIALIAS_TRUE };
#endif
+#ifndef ENUM_FONTAUTOHINT_DECLARED
+#define ENUM_FONTAUTOHINT_DECLARED
+
+enum FontAutoHint { AUTOHINT_DONTKNOW, AUTOHINT_FALSE, AUTOHINT_TRUE };
+
+#endif
+
+#ifndef ENUM_FONTHINTING_DECLARED
+#define ENUM_FONTHINTING_DECLARED
+
+enum FontHinting { HINTING_DONTKNOW, HINTING_FALSE, HINTING_TRUE };
+
+#endif
+
+#ifndef ENUM_FONTHINTSTYLE_DECLARED
+#define ENUM_FONTHINTSTYLE_DECLARED
+
+enum FontHintStyle { HINT_NONE, HINT_SLIGHT, HINT_MEDIUM, HINT_FULL };
+
+#endif
+
// ------------------------------------------------------------
#ifndef ENUM_KEYFUNCTYPE_DECLARED