Kaydet (Commit) 7785c201 authored tarafından Chris Sherlock's avatar Chris Sherlock

vcl: split more font classes from outfont.hxx

Change-Id: Ifa10c3b954dd245ff8357b790b59316b3fb111a9
üst 7aeb2e8c
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "outfont.hxx" #include "outfont.hxx"
#include "fontattributes.hxx" #include "fontattributes.hxx"
#include "fontselect.hxx"
class ImplFontEntry; class ImplFontEntry;
struct FontMatchStatus; struct FontMatchStatus;
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef INCLUDED_VCL_INC_FONTSELECT_HXX #ifndef INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
#define INCLUDED_VCL_INC_FONTSELECT_HXX #define INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
#include <i18nlangtag/lang.h> #include <i18nlangtag/lang.h>
#include <vcl/dllapi.h> #include <vcl/dllapi.h>
#include <unotools/fontdefs.hxx> #include <unotools/fontdefs.hxx>
#include <vcl/vclenum.hxx> #include <vcl/vclenum.hxx>
#include "outfont.hxx" #include "fontselect.hxx"
#include <unordered_map> #include <unordered_map>
...@@ -241,6 +241,6 @@ private: ...@@ -241,6 +241,6 @@ private:
}; };
#endif // INCLUDED_VCL_INC_FONTSELECT_HXX #endif // INCLUDED_VCL_INC_FONTATTRIBUTES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_VCL_INC_FONTSELECT_HXX
#define INCLUDED_VCL_INC_FONTSELECT_HXX
#include <vcl/dllapi.h>
#include "fontattributes.hxx"
#include <unordered_map>
class PhysicalFontFace;
class ImplFontEntry;
class ImplFontCache;
namespace vcl { class Font; }
class ConvertChar;
class OutputDevice;
class Size;
class FontSelectPatternAttributes : public ImplFontAttributes
{
public:
FontSelectPatternAttributes( const vcl::Font&, const OUString& rSearchName,
const Size&, float fExactHeight );
#ifdef WNT
FontSelectPatternAttributes( const PhysicalFontFace&, const Size&,
float fExactHeight, int nOrientation, bool bVertical );
#endif
size_t hashCode() const;
bool operator==(const FontSelectPatternAttributes& rOther) const;
bool operator!=(const FontSelectPatternAttributes& rOther) const
{
return !(*this == rOther);
}
public:
OUString maTargetName; // name of the font name token that is chosen
OUString maSearchName; // name of the font that matches best
int mnWidth; // width of font in pixel units
int mnHeight; // height of font in pixel units
float mfExactHeight; // requested height (in pixels with subpixel details)
int mnOrientation; // text orientation in 3600 system
LanguageType meLanguage; // text language
bool mbVertical; // vertical mode of requested font
bool mbNonAntialiased; // true if antialiasing is disabled
bool mbEmbolden; // Force emboldening
ItalicMatrix maItalicMatrix; // Force matrix for slant
};
class FontSelectPattern : public FontSelectPatternAttributes
{
public:
FontSelectPattern( const vcl::Font&, const OUString& rSearchName,
const Size&, float fExactHeight );
#ifdef WNT
// ifdeffed to prevent it going into unusedcode.easy
FontSelectPattern( const PhysicalFontFace&, const Size&,
float fExactHeight, int nOrientation, bool bVertical );
#endif
public: // TODO: change to private
const PhysicalFontFace* mpFontData; // a matching PhysicalFontFace object
ImplFontEntry* mpFontEntry; // pointer to the resulting FontCache entry
void copyAttributes(const FontSelectPatternAttributes &rAttributes);
};
#endif // INCLUDED_VCL_INC_FONTSELECT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -20,70 +20,17 @@ ...@@ -20,70 +20,17 @@
#ifndef INCLUDED_VCL_INC_OUTFONT_HXX #ifndef INCLUDED_VCL_INC_OUTFONT_HXX
#define INCLUDED_VCL_INC_OUTFONT_HXX #define INCLUDED_VCL_INC_OUTFONT_HXX
#include <sal/types.h>
#include <vcl/dllapi.h> #include <vcl/dllapi.h>
#include "fontselect.hxx"
#include "fontattributes.hxx" #include "fontattributes.hxx"
#include <unordered_map> #include <unordered_map>
class PhysicalFontFace;
class ImplFontEntry;
class ImplFontCache;
namespace vcl { class Font; } namespace vcl { class Font; }
class ImplFontCache;
class ConvertChar; class ConvertChar;
class OutputDevice;
class Size;
class FontSelectPatternAttributes : public ImplFontAttributes
{
public:
FontSelectPatternAttributes( const vcl::Font&, const OUString& rSearchName,
const Size&, float fExactHeight );
#ifdef WNT
FontSelectPatternAttributes( const PhysicalFontFace&, const Size&,
float fExactHeight, int nOrientation, bool bVertical );
#endif
size_t hashCode() const;
bool operator==(const FontSelectPatternAttributes& rOther) const;
bool operator!=(const FontSelectPatternAttributes& rOther) const
{
return !(*this == rOther);
}
public:
OUString maTargetName; // name of the font name token that is chosen
OUString maSearchName; // name of the font that matches best
int mnWidth; // width of font in pixel units
int mnHeight; // height of font in pixel units
float mfExactHeight; // requested height (in pixels with subpixel details)
int mnOrientation; // text orientation in 3600 system
LanguageType meLanguage; // text language
bool mbVertical; // vertical mode of requested font
bool mbNonAntialiased; // true if antialiasing is disabled
bool mbEmbolden; // Force emboldening
ItalicMatrix maItalicMatrix; // Force matrix for slant
};
class FontSelectPattern : public FontSelectPatternAttributes
{
public:
FontSelectPattern( const vcl::Font&, const OUString& rSearchName,
const Size&, float fExactHeight );
#ifdef WNT
// ifdeffed to prevent it going into unusedcode.easy
FontSelectPattern( const PhysicalFontFace&, const Size&,
float fExactHeight, int nOrientation, bool bVertical );
#endif
public: // TODO: change to private
const PhysicalFontFace* mpFontData; // a matching PhysicalFontFace object
ImplFontEntry* mpFontEntry; // pointer to the resulting FontCache entry
void copyAttributes(const FontSelectPatternAttributes &rAttributes);
};
// - ImplFontEntry -
// TODO: rename ImplFontEntry to LogicalFontInstance // TODO: rename ImplFontEntry to LogicalFontInstance
// TODO: allow sharing of metrics for related fonts // TODO: allow sharing of metrics for related fonts
...@@ -121,56 +68,6 @@ private: ...@@ -121,56 +68,6 @@ private:
UnicodeFallbackList* mpUnicodeFallbackList; UnicodeFallbackList* mpUnicodeFallbackList;
}; };
class ImplTextLineInfo
{
private:
long mnWidth;
sal_Int32 mnIndex;
sal_Int32 mnLen;
public:
ImplTextLineInfo( long nWidth, sal_Int32 nIndex, sal_Int32 nLen )
{
if(nIndex == -1 || nIndex == 0x0FFFF || nLen == -1 || nLen == 0x0FFFF)
{
SAL_INFO("sal.rtl.xub",
"ImplTextLine Info Suspicious arguments nIndex:" << nIndex << " nLen:" << nLen);
}
mnWidth = nWidth;
mnIndex = nIndex;
mnLen = nLen;
}
long GetWidth() const { return mnWidth; }
sal_Int32 GetIndex() const { return mnIndex; }
sal_Int32 GetLen() const { return mnLen; }
};
#define MULTITEXTLINEINFO_RESIZE 16
class ImplMultiTextLineInfo
{
public:
ImplMultiTextLineInfo();
~ImplMultiTextLineInfo();
void AddLine( ImplTextLineInfo* pLine );
void Clear();
ImplTextLineInfo* GetLine( sal_Int32 nLine ) const
{ return mpLines[nLine]; }
sal_Int32 Count() const { return mnLines; }
private:
ImplMultiTextLineInfo( const ImplMultiTextLineInfo& ) = delete;
ImplMultiTextLineInfo& operator=( const ImplMultiTextLineInfo& ) = delete;
ImplTextLineInfo** mpLines;
sal_Int32 mnLines;
sal_Int32 mnSize;
};
#endif // INCLUDED_VCL_INC_OUTFONT_HXX #endif // INCLUDED_VCL_INC_OUTFONT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_VCL_INC_TEXTLINEINFO_HXX
#define INCLUDED_VCL_INC_TEXTLINEINFO_HXX
#include <vcl/dllapi.h>
#include <sal/types.h>
#include <unordered_map>
class PhysicalFontFace;
class ImplFontEntry;
class ImplFontCache;
namespace vcl { class Font; }
class ConvertChar;
class OutputDevice;
class Size;
class ImplTextLineInfo
{
private:
long mnWidth;
sal_Int32 mnIndex;
sal_Int32 mnLen;
public:
ImplTextLineInfo( long nWidth, sal_Int32 nIndex, sal_Int32 nLen )
{
if(nIndex == -1 || nIndex == 0x0FFFF || nLen == -1 || nLen == 0x0FFFF)
{
SAL_INFO("sal.rtl.xub",
"ImplTextLine Info Suspicious arguments nIndex:" << nIndex << " nLen:" << nLen);
}
mnWidth = nWidth;
mnIndex = nIndex;
mnLen = nLen;
}
long GetWidth() const { return mnWidth; }
sal_Int32 GetIndex() const { return mnIndex; }
sal_Int32 GetLen() const { return mnLen; }
};
#define MULTITEXTLINEINFO_RESIZE 16
class ImplMultiTextLineInfo
{
public:
ImplMultiTextLineInfo();
~ImplMultiTextLineInfo();
void AddLine( ImplTextLineInfo* pLine );
void Clear();
ImplTextLineInfo* GetLine( sal_Int32 nLine ) const
{ return mpLines[nLine]; }
sal_Int32 Count() const { return mnLines; }
private:
ImplMultiTextLineInfo( const ImplMultiTextLineInfo& ) = delete;
ImplMultiTextLineInfo& operator=( const ImplMultiTextLineInfo& ) = delete;
ImplTextLineInfo** mpLines;
sal_Int32 mnLines;
sal_Int32 mnSize;
};
#endif // INCLUDED_VCL_INC_TEXTLINEINFO_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "salgdi.hxx" #include "salgdi.hxx"
#include "sallayout.hxx" #include "sallayout.hxx"
#include "textlayout.hxx" #include "textlayout.hxx"
#include "textlineinfo.hxx"
#include "pdfwriter_impl.hxx" #include "pdfwriter_impl.hxx"
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
#include <svdata.hxx> #include <svdata.hxx>
#include <textlayout.hxx> #include <textlayout.hxx>
#include "textlineinfo.hxx"
#include <config_graphite.h> #include <config_graphite.h>
#if ENABLE_GRAPHITE #if ENABLE_GRAPHITE
#include "graphite_features.hxx" #include "graphite_features.hxx"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment