[Libreoffice-commits] core.git: vcl/inc vcl/win
Chris Sherlock
chris.sherlock79 at gmail.com
Sat Jan 9 18:32:27 PST 2016
vcl/inc/win/salgdi.h | 10 ++++----
vcl/win/gdi/salfont.cxx | 52 +++++++++++++++++++++++-----------------------
vcl/win/gdi/winlayout.cxx | 14 ++++++------
vcl/win/gdi/winlayout.hxx | 8 +++----
4 files changed, 42 insertions(+), 42 deletions(-)
New commits:
commit d538eb2bfa45e07ddb1303330c1e0e80c7c0ead0
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun Jan 10 09:54:07 2016 +1100
vcl: (Windows only) Changed ImplWinFontData name to WinFontFace
The base class name for WinFontFace is PhysicalFontFace, which gives
the actual font installed on Windows (this is eventually mapped and
realized into a LogicalFontInstance). However, PhysicalFontFace is
not just a data structure, it also holds the function CreateFontInstance
which must be implemented by the subclasses for each platform to allow
fonts to be used in LibreOffice.
Therefore, to keep the naming consistent I am following the lead of the
base class and renaming ImplWinFontData to WinFontFace (and removing
the "Impl" business, as this is not necessary).
Change-Id: I4debb3af3ab5067b7e12e3659f2c71aba91e848c
Reviewed-on: https://gerrit.libreoffice.org/21298
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 29f519a..00931f0 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -71,13 +71,13 @@ private:
#endif
// win32 specific physically available font face
-class ImplWinFontData : public PhysicalFontFace
+class WinFontFace : public PhysicalFontFace
{
public:
- explicit ImplWinFontData( const ImplFontAttributes&,
+ explicit WinFontFace( const ImplFontAttributes&,
int nFontHeight, BYTE eWinCharSet,
BYTE nPitchAndFamily );
- virtual ~ImplWinFontData();
+ virtual ~WinFontFace();
virtual PhysicalFontFace* Clone() const override;
virtual LogicalFontInstance* CreateFontInstance( FontSelectPattern& ) const override;
@@ -199,7 +199,7 @@ private:
HWND mhWnd; // Window-Handle, when Window-Graphics
HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks
- const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face
+ const WinFontFace* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face
WinFontInstance* mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance
float mfFontScale[ MAX_FALLBACK ]; // allows metrics emulation of huge font sizes
float mfCurrentFontScale;
@@ -458,7 +458,7 @@ inline bool ImplCmpKernData( const KERNINGPAIR& a, const KERNINGPAIR& b )
}
// called extremely often from just one spot => inline
-inline bool ImplWinFontData::HasChar( sal_uInt32 cChar ) const
+inline bool WinFontFace::HasChar( sal_uInt32 cChar ) const
{
if( mpUnicodeMap->HasChar( cChar ) )
return true;
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 76a9da5..9c917f3 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -444,7 +444,7 @@ void ImplGetLogFontFromFontSelect( HDC, const FontSelectPattern*,
// does a font face hold the given missing characters?
bool WinGlyphFallbackSubstititution::HasMissingChars( PhysicalFontFace* pFace, const OUString& rMissingChars ) const
{
- ImplWinFontData* pWinFont = static_cast< ImplWinFontData* >(pFace);
+ WinFontFace* pWinFont = static_cast< WinFontFace* >(pFace);
FontCharMapPtr pCharMap = pWinFont->GetFontCharMap();
if( !pCharMap )
{
@@ -844,7 +844,7 @@ static ImplFontAttributes WinFont2DevFontAttributes( const ENUMLOGFONTEXW& rEnum
}
-static ImplWinFontData* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
+static WinFontFace* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogFont,
const NEWTEXTMETRICW* pMetric,
DWORD nFontType )
{
@@ -852,7 +852,7 @@ static ImplWinFontData* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogF
if ( nFontType & RASTER_FONTTYPE )
nHeight = pMetric->tmHeight - pMetric->tmInternalLeading;
- ImplWinFontData* pData = new ImplWinFontData(
+ WinFontFace* pData = new WinFontFace(
WinFont2DevFontAttributes(*pLogFont, *pMetric, nFontType),
nHeight,
pLogFont->elfLogFont.lfCharSet,
@@ -994,7 +994,7 @@ const void * GrFontData::getTable(unsigned int name, size_t *len) const
}
#endif
-ImplWinFontData::ImplWinFontData( const ImplFontAttributes& rDFS,
+WinFontFace::WinFontFace( const ImplFontAttributes& rDFS,
int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
: PhysicalFontFace( rDFS ),
mnId( 0 ),
@@ -1036,11 +1036,11 @@ ImplWinFontData::ImplWinFontData( const ImplFontAttributes& rDFS,
}
}
#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::ImplWinFontData() %lx\n", (unsigned long)this);
+ fprintf(grLog(), "WinFontFace::WinFontFace() %lx\n", (unsigned long)this);
#endif
}
-ImplWinFontData::~ImplWinFontData()
+WinFontFace::~WinFontFace()
{
if( mpUnicodeMap )
mpUnicodeMap = 0;
@@ -1048,13 +1048,13 @@ ImplWinFontData::~ImplWinFontData()
if (mpGraphiteData)
mpGraphiteData->DeReference();
#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::~ImplWinFontData %lx\n", (unsigned long)this);
+ fprintf(grLog(), "WinFontFace::~WinFontFace %lx\n", (unsigned long)this);
#endif
#endif // ENABLE_GRAPHITE
delete mpEncodingVector;
}
-sal_IntPtr ImplWinFontData::GetFontId() const
+sal_IntPtr WinFontFace::GetFontId() const
{
return mnId;
}
@@ -1062,7 +1062,7 @@ sal_IntPtr ImplWinFontData::GetFontId() const
static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);}
static inline DWORD CalcTag( const char p[4]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3]<<24)); }
-void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
+void WinFontFace::UpdateFromHDC( HDC hDC ) const
{
// short circuit if already initialized
if( mpUnicodeMap != NULL )
@@ -1080,7 +1080,7 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
if (mbHasGraphiteSupport)
{
#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::UpdateFromHDC %lx\n",
+ fprintf(grLog(), "WinFontFace::UpdateFromHDC %lx\n",
(unsigned long)this);
#endif
if (mpGraphiteData == NULL)
@@ -1099,42 +1099,42 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
}
#if ENABLE_GRAPHITE
-const gr_face* ImplWinFontData::GraphiteFace() const
+const gr_face* WinFontFace::GraphiteFace() const
{
#ifdef DEBUG
- fprintf(grLog(), "ImplWinFontData::GraphiteFace %lx has face %lx\n",
+ fprintf(grLog(), "WinFontFace::GraphiteFace %lx has face %lx\n",
(unsigned long)this, mpGraphiteData? mpGraphiteData->getFace(): 0);
#endif
return (mpGraphiteData)? mpGraphiteData->getFace() : NULL;
}
#endif
-bool ImplWinFontData::HasGSUBstitutions( HDC hDC ) const
+bool WinFontFace::HasGSUBstitutions( HDC hDC ) const
{
if( !mbGsubRead )
ReadGsubTable( hDC );
return !maGsubTable.empty();
}
-bool ImplWinFontData::IsGSUBstituted( sal_UCS4 cChar ) const
+bool WinFontFace::IsGSUBstituted( sal_UCS4 cChar ) const
{
return( maGsubTable.find( cChar ) != maGsubTable.end() );
}
-FontCharMapPtr ImplWinFontData::GetFontCharMap() const
+FontCharMapPtr WinFontFace::GetFontCharMap() const
{
if( !mpUnicodeMap )
return NULL;
return mpUnicodeMap;
}
-bool ImplWinFontData::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
+bool WinFontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
{
rFontCapabilities = maFontCapabilities;
return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
}
-void ImplWinFontData::ReadGsubTable( HDC hDC ) const
+void WinFontFace::ReadGsubTable( HDC hDC ) const
{
mbGsubRead = true;
@@ -1179,7 +1179,7 @@ void ImplWinFontData::ReadGsubTable( HDC hDC ) const
CloseTTFont( pTTFont );
}
-void ImplWinFontData::ReadCmapTable( HDC hDC ) const
+void WinFontFace::ReadCmapTable( HDC hDC ) const
{
if( mpUnicodeMap != NULL )
return;
@@ -1206,7 +1206,7 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
}
}
-void ImplWinFontData::GetFontCapabilities( HDC hDC ) const
+void WinFontFace::GetFontCapabilities( HDC hDC ) const
{
// read this only once per font
if( mbFontCapabilitiesRead )
@@ -1297,7 +1297,7 @@ void ImplGetLogFontFromFontSelect( HDC hDC,
}
else
{
- const ImplWinFontData* pWinFontData = static_cast<const ImplWinFontData*>( pFont->mpFontData );
+ const WinFontFace* pWinFontData = static_cast<const WinFontFace*>( pFont->mpFontData );
rLogFont.lfCharSet = pWinFontData->GetCharSet();
rLogFont.lfPitchAndFamily = pWinFontData->GetPitchAndFamily();
}
@@ -1438,7 +1438,7 @@ sal_uInt16 WinSalGraphics::SetFont( FontSelectPattern* pFont, int nFallbackLevel
DBG_ASSERT( pFont->mpFontData, "WinSalGraphics mpFontData==NULL");
mpWinFontEntry[ nFallbackLevel ] = reinterpret_cast<WinFontInstance*>( pFont->mpFontInstance );
- mpWinFontData[ nFallbackLevel ] = static_cast<const ImplWinFontData*>( pFont->mpFontData );
+ mpWinFontData[ nFallbackLevel ] = static_cast<const WinFontFace*>( pFont->mpFontData );
HFONT hOldFont = 0;
HFONT hNewFont = ImplDoSetFont( pFont, mfFontScale[ nFallbackLevel ], hOldFont );
@@ -1606,7 +1606,7 @@ int CALLBACK SalEnumFontsProcExW( const ENUMLOGFONTEXW* pLogFont,
if( (nFontType & RASTER_FONTTYPE) && !(nFontType & DEVICE_FONTTYPE) )
return 1;
- ImplWinFontData* pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType );
+ WinFontFace* pData = ImplLogMetricToDevFontDataW( pLogFont, &(pMetric->ntmTm), nFontType );
pData->SetFontId( sal_IntPtr( pInfo->mnFontCount++ ) );
// knowing Courier to be scalable is nice
@@ -1831,7 +1831,7 @@ bool WinSalGraphics::AddTempDevFont( PhysicalFontCollection* pFontCollection,
aDFS.maMapName = aFontName;
*/
- ImplWinFontData* pFontData = new ImplWinFontData( aDFA, 0,
+ WinFontFace* pFontData = new WinFontFace( aDFA, 0,
sal::static_int_cast<BYTE>(DEFAULT_CHARSET),
sal::static_int_cast<BYTE>(TMPF_VECTOR|TMPF_TRUETYPE) );
pFontData->SetFontId( reinterpret_cast<sal_IntPtr>(pFontData) );
@@ -2226,7 +2226,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile,
HFONT hOldFont = 0;
ImplDoSetFont( &aIFSD, fScale, hOldFont );
- ImplWinFontData* pWinFontData = (ImplWinFontData*)aIFSD.mpFontData;
+ WinFontFace* pWinFontData = (WinFontFace*)aIFSD.mpFontData;
#if OSL_DEBUG_LEVEL > 1
// get font metrics
@@ -2434,7 +2434,7 @@ const Ucs2SIntMap* WinSalGraphics::GetFontEncodingVector( const PhysicalFontFace
if( pNonEncoded )
*pNonEncoded = NULL;
- const ImplWinFontData* pWinFontData = static_cast<const ImplWinFontData*>(pFont);
+ const WinFontFace* pWinFontData = static_cast<const WinFontFace*>(pFont);
const Ucs2SIntMap* pEncoding = pWinFontData->GetEncodingVector();
if( pEncoding == NULL )
{
@@ -2499,7 +2499,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont,
free( pMetrics );
rUnicodeEnc.clear();
}
- const ImplWinFontData* pWinFont = static_cast<const ImplWinFontData*>(pFont);
+ const WinFontFace* pWinFont = static_cast<const WinFontFace*>(pFont);
FontCharMapPtr pMap = pWinFont->GetFontCharMap();
DBG_ASSERT( pMap && pMap->GetCharCount(), "no map" );
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 5810c34..998865e 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -508,7 +508,7 @@ void WinFontInstance::setupGLyphy(HDC hDC)
mpGLyphyFont = demo_font_create(hNewDC, mpGLyphyAtlas);
}
-WinLayout::WinLayout(HDC hDC, const ImplWinFontData& rWFD, WinFontInstance& rWFE, bool bUseOpenGL)
+WinLayout::WinLayout(HDC hDC, const WinFontFace& rWFD, WinFontInstance& rWFE, bool bUseOpenGL)
: mhDC( hDC ),
mhFont( (HFONT)GetCurrentObject(hDC,OBJ_FONT) ),
mnBaseAdv( 0 ),
@@ -718,7 +718,7 @@ static void InitUSP()
bUspInited = true;
}
-UniscribeLayout::UniscribeLayout(HDC hDC, const ImplWinFontData& rWinFontData,
+UniscribeLayout::UniscribeLayout(HDC hDC, const WinFontFace& rWinFontData,
WinFontInstance& rWinFontEntry, bool bUseOpenGL)
: WinLayout(hDC, rWinFontData, rWinFontEntry, bUseOpenGL),
mpScriptItems( NULL ),
@@ -2754,7 +2754,7 @@ float gr_fontAdvance(const void* appFontHandle, gr_uint16 glyphId)
return gm.gmCellIncX;
}
-GraphiteWinLayout::GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, WinFontInstance& rWFE, bool bUseOpenGL) throw()
+GraphiteWinLayout::GraphiteWinLayout(HDC hDC, const WinFontFace& rWFD, WinFontInstance& rWFE, bool bUseOpenGL) throw()
: WinLayout(hDC, rWFD, rWFE, bUseOpenGL), mpFont(NULL),
maImpl(rWFD.GraphiteFace(), rWFE)
{
@@ -2914,7 +2914,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& /*rArgs*/, int nFallba
WinLayout* pWinLayout = NULL;
- const ImplWinFontData& rFontFace = *mpWinFontData[ nFallbackLevel ];
+ const WinFontFace& rFontFace = *mpWinFontData[ nFallbackLevel ];
WinFontInstance& rFontInstance = *mpWinFontEntry[ nFallbackLevel ];
bool bUseOpenGL = OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter;
@@ -2991,17 +2991,17 @@ bool WinFontInstance::InitKashidaHandling( HDC hDC )
return true;
}
-PhysicalFontFace* ImplWinFontData::Clone() const
+PhysicalFontFace* WinFontFace::Clone() const
{
#if ENABLE_GRAPHITE
if ( mpGraphiteData )
mpGraphiteData->AddReference();
#endif
- PhysicalFontFace* pClone = new ImplWinFontData( *this );
+ PhysicalFontFace* pClone = new WinFontFace( *this );
return pClone;
}
-LogicalFontInstance* ImplWinFontData::CreateFontInstance( FontSelectPattern& rFSD ) const
+LogicalFontInstance* WinFontFace::CreateFontInstance( FontSelectPattern& rFSD ) const
{
LogicalFontInstance* pFontInstance = new WinFontInstance( rFSD );
return pFontInstance;
diff --git a/vcl/win/gdi/winlayout.hxx b/vcl/win/gdi/winlayout.hxx
index c7a532b..7a52fe3 100644
--- a/vcl/win/gdi/winlayout.hxx
+++ b/vcl/win/gdi/winlayout.hxx
@@ -40,7 +40,7 @@ struct VisualItem;
class WinLayout : public SalLayout
{
public:
- WinLayout(HDC, const ImplWinFontData&, WinFontInstance&, bool bUseOpenGL);
+ WinLayout(HDC, const WinFontFace&, WinFontInstance&, bool bUseOpenGL);
virtual ~WinLayout();
virtual void InitFont() const override;
void SetFontScale( float f ) { mfFontScale = f; }
@@ -64,14 +64,14 @@ public:
float mfFontScale; // allows metrics emulation of huge font sizes
bool mbUseOpenGL; ///< We need to render via OpenGL
- const ImplWinFontData& mrWinFontData;
+ const WinFontFace& mrWinFontData;
WinFontInstance& mrWinFontEntry;
};
class UniscribeLayout : public WinLayout
{
public:
- UniscribeLayout(HDC, const ImplWinFontData&, WinFontInstance&, bool bUseOpenGL);
+ UniscribeLayout(HDC, const WinFontFace&, WinFontInstance&, bool bUseOpenGL);
virtual bool LayoutText( ImplLayoutArgs& ) override;
virtual void AdjustLayout( ImplLayoutArgs& ) override;
@@ -162,7 +162,7 @@ private:
grutils::GrFeatureParser * mpFeatures;
mutable GraphiteLayoutWinImpl maImpl;
public:
- GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, WinFontInstance& rWFE, bool bUseOpenGL) throw();
+ GraphiteWinLayout(HDC hDC, const WinFontFace& rWFD, WinFontInstance& rWFE, bool bUseOpenGL) throw();
virtual ~GraphiteWinLayout();
// used by upper layers
More information about the Libreoffice-commits
mailing list