diff --git a/common/vgui_surfacelib/FontManager.h b/common/vgui_surfacelib/FontManager.h index 56471364..0d7d1e58 100644 --- a/common/vgui_surfacelib/FontManager.h +++ b/common/vgui_surfacelib/FontManager.h @@ -17,7 +17,7 @@ #include "filesystem.h" #include "vguifont.h" -#ifdef LINUX +#if defined(LINUX) || defined(OSX) #include #include FT_FREETYPE_H typedef void *(*FontDataHelper)( const char *pchFontName, int &size, const char *fontFileName ); @@ -71,7 +71,7 @@ public: IFileSystem *FileSystem() { return m_pFileSystem; } IMaterialSystem *MaterialSystem() { return m_pMaterialSystem; } -#ifdef LINUX +#if defined(LINUX) || defined(OSX) FT_Library GetFontLibraryHandle() { return library; } void SetFontDataHelper( FontDataHelper helper ) { m_pFontDataHelper = helper; } #endif @@ -96,7 +96,7 @@ private: CUtlVector m_FontAmalgams; CUtlVector m_Win32Fonts; -#ifdef LINUX +#if defined(LINUX) || defined(OSX) FT_Library library; FontDataHelper m_pFontDataHelper; #endif diff --git a/common/vgui_surfacelib/vguifont.h b/common/vgui_surfacelib/vguifont.h index 34ee32c8..02374f36 100644 --- a/common/vgui_surfacelib/vguifont.h +++ b/common/vgui_surfacelib/vguifont.h @@ -23,10 +23,7 @@ struct newChar_t #ifdef WIN32 #include "Win32Font.h" typedef CWin32Font font_t; -#elif defined(OSX) -#include "osxfont.h" -typedef COSXFont font_t; -#elif defined(LINUX) +#elif defined(LINUX) || defined(OSX) #include "linuxfont.h" typedef CLinuxFont font_t; #else diff --git a/vgui2/vgui_surfacelib/FontManager.cpp b/vgui2/vgui_surfacelib/FontManager.cpp index 8942c158..dd86900e 100644 --- a/vgui2/vgui_surfacelib/FontManager.cpp +++ b/vgui2/vgui_surfacelib/FontManager.cpp @@ -43,7 +43,7 @@ CFontManager::CFontManager() m_FontAmalgams.AddToTail(); m_Win32Fonts.EnsureCapacity( MAX_INITIAL_FONTS ); -#ifdef LINUX +#if defined(LINUX) || defined(OSX) FT_Error error = FT_Init_FreeType( &library ); if ( error ) Error( "Unable to initalize freetype library, is it installed?" ); @@ -75,7 +75,7 @@ CFontManager::~CFontManager() { ClearAllFonts(); m_FontAmalgams.RemoveAll(); -#ifdef LINUX +#if defined(LINUX) || defined(OSX) FT_Done_FreeType( library ); #endif } @@ -280,7 +280,7 @@ font_t *CFontManager::CreateOrFindWin32Font(const char *windowsFontName, int tal i = m_Win32Fonts.AddToTail(); m_Win32Fonts[i] = NULL; -#ifdef LINUX +#if defined(LINUX) || defined(OSX) int memSize = 0; void *pchFontData = m_pFontDataHelper( windowsFontName, memSize, NULL ); @@ -730,7 +730,7 @@ void CFontManager::GetKernedCharWidth( vgui::HFont font, wchar_t ch, wchar_t chB { wide = 0.0f; flabcA = 0.0f; - + Assert( font != vgui::INVALID_FONT ); if ( font == vgui::INVALID_FONT ) return; @@ -749,8 +749,8 @@ void CFontManager::GetKernedCharWidth( vgui::HFont font, wchar_t ch, wchar_t chB if ( m_FontAmalgams[font].GetFontForChar( chAfter ) != pFont ) chAfter = 0; - -#if defined(LINUX) + +#if defined(LINUX) || defined(OSX) pFont->GetKernedCharWidth( ch, chBefore, chAfter, wide, flabcA, flabcC ); #else pFont->GetKernedCharWidth( ch, chBefore, chAfter, wide, flabcA );