summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-19 11:58:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-19 11:58:59 +0100
commit1ee8a779c21e8d6f6a85a4e0bcefee227bff5a94 (patch)
treef2df5ffb4080f3ab63e87467c93d6a539b9c7521 /vcl
parentMerge FreetypeServerFont and ServerFont now its split out into unx (diff)
downloadcore-1ee8a779c21e8d6f6a85a4e0bcefee227bff5a94.tar.gz
core-1ee8a779c21e8d6f6a85a4e0bcefee227bff5a94.zip
now cairo is the only way to render text under X
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/glyphcache.hxx2
-rw-r--r--vcl/inc/unx/salgdi.h6
-rw-r--r--vcl/unx/generic/gdi/salgdi3.cxx32
-rw-r--r--vcl/unx/generic/glyphs/gcach_ftyp.cxx2
4 files changed, 11 insertions, 31 deletions
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index d9c84c828b28..164bc0cbffed 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -194,7 +194,7 @@ public:
const ::rtl::OString* GetFontFileName() const;
int GetFontFaceNumber() const;
bool TestFont() const;
- void* GetFtFace() const;
+ FT_Face GetFtFace() const;
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
void SetFontOptions( boost::shared_ptr<ImplFontOptions> );
boost::shared_ptr<ImplFontOptions> GetFontOptions() const;
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index fba9240a405d..a44a3f562436 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -64,18 +64,20 @@ namespace basegfx {
// -=-= SalGraphicsData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+typedef struct FT_FaceRec_* FT_Face;
+
class CairoFontsCache
{
public:
struct CacheId
{
- const void *mpFace;
+ FT_Face maFace;
const void *mpOptions;
bool mbEmbolden;
bool mbVerticalMetrics;
bool operator ==(const CacheId& rOther) const
{
- return mpFace == rOther.mpFace &&
+ return maFace == rOther.maFace &&
mpOptions == rOther.mpOptions &&
mbEmbolden == rOther.mbEmbolden &&
mbVerticalMetrics == rOther.mbVerticalMetrics;
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 1b33ba4e1860..ca0385baac1f 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -235,14 +235,6 @@ void ImplServerFontEntry::HandleFontOptions( void )
//--------------------------------------------------------------------------
-namespace
-{
- bool isCairoRenderable(const ServerFont& rFont)
- {
- return rFont.GetFtFace();
- }
-} //namespace
-
CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts;
int CairoFontsCache::mnRefCount = 0;
@@ -370,9 +362,9 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
ServerFont& rFont = rLayout.GetServerFont();
- void* pFace = rFont.GetFtFace();
+ FT_Face aFace = rFont.GetFtFace();
CairoFontsCache::CacheId aId;
- aId.mpFace = pFace;
+ aId.maFace = aFace;
aId.mpOptions = rFont.GetFontOptions().get();
aId.mbEmbolden = rFont.NeedsArtificialBold();
@@ -398,11 +390,11 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
if (!font_face)
{
const ImplFontOptions *pOptions = rFont.GetFontOptions().get();
- void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden, aId.mbVerticalMetrics) : NULL;
+ void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden, aId.mbVerticalMetrics) : NULL;
if (pPattern)
font_face = cairo_ft_font_face_create_for_pattern(reinterpret_cast<FcPattern*>(pPattern));
if (!font_face)
- font_face = cairo_ft_font_face_create_for_ft_face(reinterpret_cast<FT_Face>(pFace), rFont.GetLoadFlags());
+ font_face = cairo_ft_font_face_create_for_ft_face(reinterpret_cast<FT_Face>(aFace), rFont.GetLoadFlags());
m_aCairoFontsCache.CacheFont(font_face, aId);
}
cairo_set_font_face(cr, font_face);
@@ -427,7 +419,6 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout )
cairo_matrix_init_identity(&em_square);
cairo_get_matrix(cr, &em_square);
- FT_Face aFace = reinterpret_cast<FT_Face>(pFace);
cairo_matrix_scale(&em_square, aFace->units_per_EM,
aFace->units_per_EM);
cairo_set_matrix(cr, &em_square);
@@ -832,20 +823,7 @@ void X11SalGraphics::DrawServerSimpleFontString( const ServerFontLayout& rSalLay
void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout )
{
- // draw complex text
- ServerFont& rFont = rLayout.GetServerFont();
- if( isCairoRenderable(rFont) )
- DrawCairoAAFontString( rLayout );
- else
- {
- X11GlyphPeer& rGlyphPeer = X11GlyphCache::GetInstance().GetPeer();
- if( rGlyphPeer.GetGlyphSet( rFont, m_nScreen ) )
- DrawServerAAFontString( rLayout );
- else if( !rGlyphPeer.ForcedAntialiasing( rFont, m_nScreen ) )
- DrawServerSimpleFontString( rLayout );
- else
- DrawServerAAForcedString( rLayout );
- }
+ DrawCairoAAFontString( rLayout );
}
//--------------------------------------------------------------------------
diff --git a/vcl/unx/generic/glyphs/gcach_ftyp.cxx b/vcl/unx/generic/glyphs/gcach_ftyp.cxx
index c110650a00da..e2cf92df9047 100644
--- a/vcl/unx/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/unx/generic/glyphs/gcach_ftyp.cxx
@@ -577,7 +577,7 @@ FreetypeManager::FreetypeManager()
// -----------------------------------------------------------------------
-void* ServerFont::GetFtFace() const
+FT_Face ServerFont::GetFtFace() const
{
if( maSizeFT )
pFTActivateSize( maSizeFT );