]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/parser/builder.cpp
* all: beginning of bitmap font support. At the moment only the digits
[vlc] / modules / gui / skins2 / parser / builder.cpp
index 2e721a138fa5d15066f3a89a9cd8ac7b720e3020..219a15e1f703ae8e6c06880b2373e9b03712d160 100755 (executable)
@@ -31,6 +31,7 @@
 #include "../src/generic_bitmap.hpp"
 #include "../src/top_window.hpp"
 #include "../src/anchor.hpp"
+#include "../src/bitmap_font.hpp"
 #include "../src/ft2_font.hpp"
 #include "../src/theme.hpp"
 #include "../controls/ctrl_button.hpp"
@@ -81,6 +82,7 @@ Theme *Builder::build()
     // Create everything from the data in the XML
     ADD_OBJECTS( Theme );
     ADD_OBJECTS( Bitmap );
+    ADD_OBJECTS( BitmapFont );
     ADD_OBJECTS( Font );
     ADD_OBJECTS( Window );
     ADD_OBJECTS( Layout );
@@ -137,6 +139,23 @@ void Builder::addBitmap( const BuilderData::Bitmap &rData )
 }
 
 
+void Builder::addBitmapFont( const BuilderData::BitmapFont &rData )
+{
+    GenericBitmap *pBmp = new PngBitmap( getIntf(), rData.m_file, 0 );
+    m_pTheme->m_bitmaps[rData.m_id] = GenericBitmapPtr( pBmp );
+
+    GenericFont *pFont = new BitmapFont( getIntf(), *pBmp );
+    if( pFont->init() )
+    {
+        m_pTheme->m_fonts[rData.m_id] = GenericFontPtr( pFont );
+    }
+    else
+    {
+        delete pFont;
+    }
+}
+
+
 void Builder::addFont( const BuilderData::Font &rData )
 {
     GenericFont *pFont = new FT2Font( getIntf(), rData.m_fontFile,