loplugin:mergeclasses
Change-Id: If8fabc79f4cbef6fc0d164bbe2f6136f1d1f00af
This commit is contained in:
@@ -46,7 +46,6 @@ merge ISwFrameControl with SwFrameMenuButtonBase
|
|||||||
merge IXFAttrList with XFSaxAttrList
|
merge IXFAttrList with XFSaxAttrList
|
||||||
merge IXFStream with XFSaxStream
|
merge IXFStream with XFSaxStream
|
||||||
merge IXFStyle with XFStyle
|
merge IXFStyle with XFStyle
|
||||||
merge ImplFontOptions with FontConfigFontOptions
|
|
||||||
merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution
|
merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution
|
||||||
merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution
|
merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution
|
||||||
merge LwpDLList with LwpParaProperty
|
merge LwpDLList with LwpParaProperty
|
||||||
|
@@ -1140,15 +1140,12 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
|
|||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
class FontConfigFontOptions : public ImplFontOptions
|
FontConfigFontOptions::~FontConfigFontOptions()
|
||||||
{
|
{
|
||||||
public:
|
FcPatternDestroy(mpPattern);
|
||||||
FontConfigFontOptions() : mpPattern(0) {}
|
}
|
||||||
virtual ~FontConfigFontOptions()
|
|
||||||
{
|
void *FontConfigFontOptions::GetPattern(void * face, bool bEmbolden) const
|
||||||
FcPatternDestroy(mpPattern);
|
|
||||||
}
|
|
||||||
virtual void *GetPattern(void * face, bool bEmbolden, bool /*bVerticalLayout*/) const SAL_OVERRIDE
|
|
||||||
{
|
{
|
||||||
FcValue value;
|
FcValue value;
|
||||||
value.type = FcTypeFTFace;
|
value.type = FcTypeFTFace;
|
||||||
@@ -1163,10 +1160,8 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
return mpPattern;
|
return mpPattern;
|
||||||
}
|
}
|
||||||
FcPattern* mpPattern;
|
|
||||||
};
|
|
||||||
|
|
||||||
ImplFontOptions* PrintFontManager::getFontOptions(
|
FontConfigFontOptions* PrintFontManager::getFontOptions(
|
||||||
const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*))
|
const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*))
|
||||||
{
|
{
|
||||||
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
|
FontCfgWrapper& rWrapper = FontCfgWrapper::get();
|
||||||
@@ -1210,9 +1205,7 @@ ImplFontOptions* PrintFontManager::getFontOptions(
|
|||||||
(void) FcPatternGetInteger(pResult,
|
(void) FcPatternGetInteger(pResult,
|
||||||
FC_HINT_STYLE, 0, &hintstyle);
|
FC_HINT_STYLE, 0, &hintstyle);
|
||||||
|
|
||||||
pOptions = new FontConfigFontOptions;
|
pOptions = new FontConfigFontOptions(pResult);
|
||||||
|
|
||||||
pOptions->mpPattern = pResult;
|
|
||||||
|
|
||||||
if( eEmbeddedBitmap == FcResultMatch )
|
if( eEmbeddedBitmap == FcResultMatch )
|
||||||
pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
|
pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE;
|
||||||
|
@@ -555,7 +555,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI )
|
|||||||
mnLoadFlags |= FT_LOAD_NO_BITMAP;
|
mnLoadFlags |= FT_LOAD_NO_BITMAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions)
|
void ServerFont::SetFontOptions(std::shared_ptr<FontConfigFontOptions> xFontOptions)
|
||||||
{
|
{
|
||||||
mxFontOptions = xFontOptions;
|
mxFontOptions = xFontOptions;
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions)
|
|||||||
mnLoadFlags |= FT_LOAD_NO_BITMAP;
|
mnLoadFlags |= FT_LOAD_NO_BITMAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ImplFontOptions> ServerFont::GetFontOptions() const
|
std::shared_ptr<FontConfigFontOptions> ServerFont::GetFontOptions() const
|
||||||
{
|
{
|
||||||
return mxFontOptions;
|
return mxFontOptions;
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
namespace utl { class MultiAtomProvider; }
|
namespace utl { class MultiAtomProvider; }
|
||||||
|
|
||||||
class FontSubsetInfo;
|
class FontSubsetInfo;
|
||||||
class ImplFontOptions;
|
class FontConfigFontOptions;
|
||||||
class FontSelectPattern;
|
class FontSelectPattern;
|
||||||
|
|
||||||
namespace psp {
|
namespace psp {
|
||||||
@@ -498,7 +498,7 @@ public:
|
|||||||
false else
|
false else
|
||||||
*/
|
*/
|
||||||
bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
|
bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale );
|
||||||
static ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*));
|
static FontConfigFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*));
|
||||||
|
|
||||||
bool Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes );
|
bool Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes );
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class FtFontInfo;
|
|||||||
class GlyphCachePeer;
|
class GlyphCachePeer;
|
||||||
class GlyphData;
|
class GlyphData;
|
||||||
class GraphiteFaceWrapper;
|
class GraphiteFaceWrapper;
|
||||||
class ImplFontOptions;
|
class FontConfigFontOptions;
|
||||||
class PhysicalFontCollection;
|
class PhysicalFontCollection;
|
||||||
class RawBitmap;
|
class RawBitmap;
|
||||||
class ServerFont;
|
class ServerFont;
|
||||||
@@ -174,8 +174,8 @@ public:
|
|||||||
bool TestFont() const { return mbFaceOk;}
|
bool TestFont() const { return mbFaceOk;}
|
||||||
FT_Face GetFtFace() const;
|
FT_Face GetFtFace() const;
|
||||||
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
|
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
|
||||||
void SetFontOptions(std::shared_ptr<ImplFontOptions>);
|
void SetFontOptions(std::shared_ptr<FontConfigFontOptions>);
|
||||||
std::shared_ptr<ImplFontOptions> GetFontOptions() const;
|
std::shared_ptr<FontConfigFontOptions> GetFontOptions() const;
|
||||||
bool NeedsArtificialBold() const { return mbArtBold; }
|
bool NeedsArtificialBold() const { return mbArtBold; }
|
||||||
bool NeedsArtificialItalic() const { return mbArtItalic; }
|
bool NeedsArtificialItalic() const { return mbArtItalic; }
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ private:
|
|||||||
FT_FaceRec_* maFaceFT;
|
FT_FaceRec_* maFaceFT;
|
||||||
FT_SizeRec_* maSizeFT;
|
FT_SizeRec_* maSizeFT;
|
||||||
|
|
||||||
std::shared_ptr<ImplFontOptions> mxFontOptions;
|
std::shared_ptr<FontConfigFontOptions> mxFontOptions;
|
||||||
|
|
||||||
bool mbFaceOk;
|
bool mbFaceOk;
|
||||||
bool mbArtItalic;
|
bool mbArtItalic;
|
||||||
@@ -278,7 +278,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ServerFont* mpServerFont;
|
ServerFont* mpServerFont;
|
||||||
std::shared_ptr<ImplFontOptions> mxFontOptions;
|
std::shared_ptr<FontConfigFontOptions> mxFontOptions;
|
||||||
bool mbGotFontOptions;
|
bool mbGotFontOptions;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -122,9 +122,8 @@ public:
|
|||||||
bool operator==( const ImplFontMetric& ) const;
|
bool operator==( const ImplFontMetric& ) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// - ImplFontOptions -
|
typedef struct _FcPattern FcPattern;
|
||||||
|
class FontConfigFontOptions
|
||||||
class ImplFontOptions
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
|
FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used
|
||||||
@@ -132,21 +131,31 @@ public:
|
|||||||
FontAutoHint meAutoHint; // whether the font should be autohinted
|
FontAutoHint meAutoHint; // whether the font should be autohinted
|
||||||
FontHinting meHinting; // whether the font should be hinted
|
FontHinting meHinting; // whether the font should be hinted
|
||||||
FontHintStyle meHintStyle; // type of font hinting to be used
|
FontHintStyle meHintStyle; // type of font hinting to be used
|
||||||
public:
|
|
||||||
ImplFontOptions() :
|
FontConfigFontOptions() :
|
||||||
meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
|
meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
|
||||||
meAntiAlias(ANTIALIAS_DONTKNOW),
|
meAntiAlias(ANTIALIAS_DONTKNOW),
|
||||||
meAutoHint(AUTOHINT_DONTKNOW),
|
meAutoHint(AUTOHINT_DONTKNOW),
|
||||||
meHinting(HINTING_DONTKNOW),
|
meHinting(HINTING_DONTKNOW),
|
||||||
meHintStyle(HINT_SLIGHT) {}
|
meHintStyle(HINT_SLIGHT),
|
||||||
virtual ~ImplFontOptions() {}
|
mpPattern(0) {}
|
||||||
|
FontConfigFontOptions(FcPattern* pPattern) :
|
||||||
|
meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
|
||||||
|
meAntiAlias(ANTIALIAS_DONTKNOW),
|
||||||
|
meAutoHint(AUTOHINT_DONTKNOW),
|
||||||
|
meHinting(HINTING_DONTKNOW),
|
||||||
|
meHintStyle(HINT_SLIGHT),
|
||||||
|
mpPattern(pPattern) {}
|
||||||
|
~FontConfigFontOptions();
|
||||||
|
|
||||||
FontAutoHint GetUseAutoHint() const { return meAutoHint; }
|
FontAutoHint GetUseAutoHint() const { return meAutoHint; }
|
||||||
FontHintStyle GetHintStyle() const { return meHintStyle; }
|
FontHintStyle GetHintStyle() const { return meHintStyle; }
|
||||||
bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
|
bool DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
|
||||||
bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
|
bool DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
|
||||||
bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
|
bool DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
|
||||||
virtual void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/, bool /*bVerticalMetrics*/) const { return NULL; }
|
void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/) const;
|
||||||
|
private:
|
||||||
|
FcPattern* mpPattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
// - ImplFontCharMap -
|
// - ImplFontCharMap -
|
||||||
|
@@ -100,7 +100,7 @@ bool CairoTextRender::setFont( const FontSelectPattern *pEntry, int nFallbackLev
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize);
|
FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize);
|
||||||
|
|
||||||
void ImplServerFontEntry::HandleFontOptions()
|
void ImplServerFontEntry::HandleFontOptions()
|
||||||
{
|
{
|
||||||
@@ -257,8 +257,8 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout )
|
|||||||
cairo_font_face_t* font_face = static_cast<cairo_font_face_t*>(CairoFontsCache::FindCachedFont(aId));
|
cairo_font_face_t* font_face = static_cast<cairo_font_face_t*>(CairoFontsCache::FindCachedFont(aId));
|
||||||
if (!font_face)
|
if (!font_face)
|
||||||
{
|
{
|
||||||
const ImplFontOptions *pOptions = rFont.GetFontOptions().get();
|
const FontConfigFontOptions *pOptions = rFont.GetFontOptions().get();
|
||||||
void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden, aId.mbVerticalMetrics) : NULL;
|
void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden) : NULL;
|
||||||
if (pPattern)
|
if (pPattern)
|
||||||
font_face = cairo_ft_font_face_create_for_pattern(static_cast<FcPattern*>(pPattern));
|
font_face = cairo_ft_font_face_create_for_pattern(static_cast<FcPattern*>(pPattern));
|
||||||
if (!font_face)
|
if (!font_face)
|
||||||
@@ -439,7 +439,7 @@ void cairosubcallback(void* pPattern)
|
|||||||
static_cast<FcPattern*>(pPattern));
|
static_cast<FcPattern*>(pPattern));
|
||||||
}
|
}
|
||||||
|
|
||||||
ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize)
|
FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize)
|
||||||
{
|
{
|
||||||
psp::FastPrintFontInfo aInfo;
|
psp::FastPrintFontInfo aInfo;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user