/**
 * Copyright 2010 The PlayN Authors
 *
 * Licensed 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
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package playn.showcase.android;

import android.app.ActivityManager;
import android.os.Build;

import playn.android.GameActivity;
import playn.core.Font;

import playn.showcase.core.Showcase;

public class ShowcaseActivity extends GameActivity {

  @Override
  public void main(){
    platform().graphics().registerFont("text/Museo.otf", "Museo-300", Font.Style.PLAIN);
    platform().graphics().registerFont("text/Museo.otf", "Museo-300", Font.Style.BOLD);
    platform().graphics().registerFont("text/Museo.otf", "Museo-300", Font.Style.ITALIC);
    platform().graphics().registerFont("text/Museo.otf", "Museo-300", Font.Style.BOLD_ITALIC);
    _game = new Showcase(platform(), new Showcase.DeviceService() {
      public String info() {
        Runtime rt = Runtime.getRuntime();
        ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
        return ("Android [model=" + Build.MODEL + ", cpu=" + Build.CPU_ABI +
                ", osver=" + Build.VERSION.RELEASE + ", mclass=" + am.getMemoryClass() +
                ", mem=" + (rt.freeMemory()/1024) + "k/" + (rt.totalMemory()/1024) + "k" +
                ", maxmem=" + (rt.maxMemory()/1024) + "k]");
      }
    });
  }

  @Override public void onBackPressed () {
    if (_game == null || _game.shouldExitOnBack()) super.onBackPressed();
  }

  protected Showcase _game;
}

@@ -684,16 +684,50 @@
 s.Build;
+%0Aimport android.graphics.Typeface;
 %0A%0Aimport
@@ -906,16 +906,87 @@
 main()%7B%0A
+    Typeface face = platform().assets().getTypeface(%22text/Museo.otf%22);%0A
     plat
@@ -1016,32 +1016,20 @@
 terFont(
-%22text/Museo.otf%22
+face
 , %22Museo
@@ -1093,32 +1093,20 @@
 terFont(
-%22text/Museo.otf%22
+face
 , %22Museo
@@ -1169,32 +1169,20 @@
 terFont(
-%22text/Museo.otf%22
+face
 , %22Museo
@@ -1247,32 +1247,20 @@
 terFont(
-%22text/Museo.otf%22
+face
 , %22Museo

Update Android font loading.