/*********************************************************************
*
*       _DrawScreen
*/
static void _DrawScreen(void) {
  GUI_RECT Rect;
  int yd;

  GUI_DrawBitmap(&_bmSeggerLogo_50x25, 10, 10);
  GUI_SetFont(GUI_FONT_20B_ASCII);
  GUI_DispStringHCenterAt("Antialiased text sample", 190, 5);
  GUI_SetFont(GUI_FONT_13_ASCII);
  GUI_DispStringHCenterAt("Shows antialiased text on different backgrounds.", 190, 25);
  Rect.x0 = 0;
  Rect.y0 = 43;
  Rect.x1 = 59;
  Rect.y1 = Rect.y0 + 95;
  yd = (Rect.y1 - Rect.y0) / 3;
  //
  // 4 bit antialiasing sample
  //
  _DrawText("Antialiased text\n (4 bpp)", &Rect);
  GUI_SetFont(&_FontAA4_32);
  _DrawSample(&Rect, yd);
  //
  // 2 bit antialiasing sample
  //
  GUI_MoveRect(&Rect, 0, 101);
  _DrawText("Antialiased text\n (2 bpp)", &Rect);
  GUI_SetFont(&_FontAA2_32);
  _DrawSample(&Rect, yd);
}
Example #2
0
/*********************************************************************
*
*       _DrawScreen
*/
static void _DrawScreen(void) {
  GUI_RECT Rect;
  int      TitleSize;
  int      xSize;
  int      ySize;
  int      xOff;
  int      yOff;


  TitleSize = GUIDEMO_GetTitleSize();
  xSize     = LCD_GetXSize();
  ySize     = LCD_GetYSize();
  if ((xSize < XSIZE_MAX) || (ySize < YSIZE_MAX)) {
    //
    // Do not show this demo on displays of too small dimensions.
    //
    return;
  }
  xOff      = (xSize - XSIZE_MAX) / 2;
  yOff      = ((ySize - TitleSize) - (YSIZE_MAX - TitleSize)) / 2;
  //
  // 4 bit anti-aliasing sample
  //
  Rect.x0   = xOff;
  Rect.y0   = TitleSize + yOff;
  Rect.x1   = xSize - xOff;
  Rect.y1   = TitleSize + (ySize - TitleSize) / 2 - 1;
  //_DrawText("Antialiased text\n(4 bpp)", &Rect);
  //GUI_SetFont(&GUI_FontAA4_32);
  _DrawSample(Rect, &GUI_FontAA4_32, "Antialiased text\n(4 bpp)");
  //
  // 2 bit anti-aliasing sample
  //
  Rect.y0   = Rect.y1 + 1;
  Rect.y1   = ySize - yOff;
  //_DrawText("Antialiased text\n(2 bpp)", &Rect);
  //GUI_SetFont(&GUI_FontAA2_32);
  _DrawSample(Rect, &GUI_FontAA2_32, "Antialiased text\n(2 bpp)");
}