office-gobmx/vcl/inc/aqua/coretext/salcoretextfontutils.hxx
Norbert Thiebaud 8c91ec1ab0 Initial basic support for CoreText. very partial and highly unstable.
Change-Id: I5dc9fb342e45fa3d428e340a597a2d9d4e246cb5
2012-06-23 23:23:25 -05:00

67 lines
2.2 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
#define _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
class ImplCoreTextFontData;
class ImplDevFontList;
#include <boost/unordered_map.hpp>
#include <vcl/fontcapabilities.hxx>
#include "outfont.hxx"
#include "impfont.hxx"
class ImplCoreTextFontData : public PhysicalFontFace
{
public:
ImplCoreTextFontData(const ImplDevFontAttributes&, CTFontRef font);
virtual ~ImplCoreTextFontData();
virtual PhysicalFontFace* Clone() const;
virtual ImplFontEntry* CreateFontInstance( FontSelectPattern& ) const;
virtual sal_IntPtr GetFontId() const { return (sal_IntPtr)m_CTFontRef;};
CTFontRef GetCTFont() const { return m_CTFontRef; };
const ImplFontCharMap* GetImplFontCharMap();
bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities);
bool HasChar( sal_uInt32 cChar ) const;
void ReadOs2Table();
void ReadIosCmapEncoding();
bool HasCJKSupport();
bool GetRawFontData( std::vector<unsigned char>& rBuffer, bool* pJustCFF ) const;
private:
void DetermineCJKSupport_OS2(CFDataRef rOS2Table);
void DetermineCJKSupport_cmap(CFDataRef rCmapTable);
CTFontRef m_CTFontRef;
mutable const ImplFontCharMap* m_pCharMap;
mutable vcl::FontCapabilities m_aFontCapabilities;
mutable bool m_bHasOs2Table;
mutable bool m_bOs2TableRead;
mutable bool m_bCmapTableRead; // true if cmap encoding of Mac font is read
mutable bool m_bHasCJKSupport; // #i78970# CJK fonts need extra leading
mutable bool m_bFontCapabilitiesRead;
};
/* This class has the responsibility of assembling a list of CoreText
fonts available on the system and enabling access to that list.
*/
class SystemFontList
{
public:
SystemFontList();
~SystemFontList();
void AnnounceFonts( ImplDevFontList& ) const;
ImplCoreTextFontData* GetFontDataFromRef( CTFontRef ) const;
private:
typedef boost::unordered_map<CTFontRef,ImplCoreTextFontData*> CoreTextFontContainer;
CoreTextFontContainer m_aFontContainer;
void InitGlyphFallbacks();
};
#endif // _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */