views:

135

answers:

1

I want to change the font in my widget such that it uses a specific font in "assets" folder of my app.

I usually do this in my app to change the font:

        Typeface tf= Typeface.createFromAsset(getAssets(), "advertising.ttf");
        TextView converted = (TextView)findViewById(R.id.TextView03);
        converted.setTypeFace(tf);

and it works like a charm.

How can I do this in widgets? I can only set the text and change the color:

      remoteView.setTextViewText(R.id.TextView03,"some text" );
    remoteView.setTextColor(R.id.TextView03, Color.BLACK);

but I don't see a way to set the font. Any help please?

A: 

Ran into the same problem as well and found this: "Because widgets live in other processes, they can only use system typefaces, and not additional fonts that might be internal to your package. One way around this would be to render your font onto a Bitmap in your process, and then push it across RemoteViews." Posted by Jeff Sharkey here: http://www.mailinglistarchive.com/html/[email protected]/2009-06/msg00211.html

shaemus mcgoo