瀏覽代碼

Load the default font (Perspective Sans) by default

rdb 12 年之前
父節點
當前提交
829e79cf29
共有 3 個文件被更改,包括 10 次插入5 次删除
  1. 1 1
      panda/src/rocket/Sources.pp
  2. 5 0
      panda/src/rocket/config_rocket.cxx
  3. 4 4
      panda/src/rocket/rocketSystemInterface.cxx

+ 1 - 1
panda/src/rocket/Sources.pp

@@ -9,7 +9,7 @@
 #begin lib_target
   #define TARGET p3rocket
   #define LOCAL_LIBS \
-    p3display p3pgraph p3gobj p3linmath p3putil p3dgraph
+    p3display p3pgraph p3gobj p3linmath p3putil p3dgraph p3text
 
   #define COMBINED_SOURCES p3rocket_composite1.cxx
 

+ 5 - 0
panda/src/rocket/config_rocket.cxx

@@ -20,6 +20,7 @@
 
 #include "pandaSystem.h"
 #include "dconfig.h"
+#include "default_font.h"
 
 // This is defined by both Panda and Rocket.
 #define Factory RocketFactory
@@ -59,4 +60,8 @@ init_librocket() {
   Rocket::Core::SetSystemInterface(si);
 
   Rocket::Core::Initialise();
+
+#ifdef COMPILE_IN_DEFAULT_FONT
+  Rocket::Core::FontDatabase::LoadFontFace(default_font_data, default_font_size);
+#endif
 }

+ 4 - 4
panda/src/rocket/rocketSystemInterface.cxx

@@ -41,16 +41,16 @@ LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message) {
   case Rocket::Core::Log::LT_ALWAYS:
   case Rocket::Core::Log::LT_ERROR:
   case Rocket::Core::Log::LT_ASSERT:
-    rocket_cat.error() << message.CString() << "\n";
+    rocket_cat->error() << message.CString() << "\n";
     return true;
   case Rocket::Core::Log::LT_WARNING:
-    rocket_cat.warning() << message.CString() << "\n";
+    rocket_cat->warning() << message.CString() << "\n";
     return true;
   case Rocket::Core::Log::LT_INFO:
-    rocket_cat.info() << message.CString() << "\n";
+    rocket_cat->info() << message.CString() << "\n";
     return true;
   case Rocket::Core::Log::LT_DEBUG:
-    rocket_cat.debug() << message.CString() << "\n";
+    rocket_cat->debug() << message.CString() << "\n";
   }
   return true;
 }