title: android widget: set typeface programmatically
body: <p>I understand that to use custom fonts in a widget I need to render the font to a bitmap, but how do I set a system typeface programmatically?</p>
  
  <pre><code>android:typeface="serif"
  </code></pre>
  
  <p>in XML is successful, but I cannot find a way to do this at run time.</p>
  
  <p>I currently have</p>
  
  <pre><code>int fn = fullDate.length();
  SpannableString dt = new SpannableString(fullDate);
  dt.setSpan(new StyleSpan(Typeface.BOLD), 0, fn, 0);
  remoteView.setTextViewText(R.id.dateText, dt);
  </code></pre>
  
  <p>Which works, but using, for example, <code>Typeface.SERIF</code>, gives <code>The constructor StyleSpan(Typeface) is undefined</code></p>