Beispiel #1
0
void TestMoblet::testLoadDefault()
{
	mShowing = 3;

	maSetColor(0x000000);
	MAExtent size = maGetScrSize();
	maFillRect(0,0,EXTENT_X(size),EXTENT_Y(size) );

	maSetColor(0xCD5555);

	int top = 0;
	maDrawText(10,top,"--------- Test maFontLoadDefault ---------");

	top += 20;
	maDrawText(10,top,"Test Monospace Normal -10");
	testFont(FONT_TYPE_MONOSPACE,FONT_STYLE_NORMAL,-10,top);

	top += 20;
	maDrawText(10, top, "Test Monospace Bold 15");
	testFont(FONT_TYPE_MONOSPACE, FONT_STYLE_BOLD, 15, top);

	top += 20;
	maDrawText(10, top, "Test Monospace Italic 15");
	testFont(FONT_TYPE_MONOSPACE, FONT_STYLE_ITALIC, 15, top);

	top += 20;
	maDrawText(10, top, "Test SansSerif Normal 15");
	testFont(FONT_TYPE_SANS_SERIF, FONT_STYLE_NORMAL, 15, top);

	top += 20;
	maDrawText(10, top, "Test SansSerif Bold 15");
	testFont(FONT_TYPE_SANS_SERIF, FONT_STYLE_BOLD, 15, top);

	top += 20;
	maDrawText(10, top, "Test SansSerif Italic 15");
	testFont(FONT_TYPE_SANS_SERIF, FONT_STYLE_ITALIC, 15, top);

	top += 20;
	maDrawText(10, top, "Test Serif Normal 15");
	testFont(FONT_TYPE_SERIF, FONT_STYLE_NORMAL, 15, top);

	top += 20;
	maDrawText(10, top, "Test Serif Bold 15");
	testFont(FONT_TYPE_SERIF, FONT_STYLE_BOLD, 15, top);

	top += 20;
	maDrawText(10, top, "Test Serif Italic 15");
	testFont(FONT_TYPE_SERIF, FONT_STYLE_ITALIC, 15, top);

	maDrawText(10, top+40, "Tap screen to EXIT");
	maUpdateScreen();
}
Beispiel #2
0
// Create a font
HFONT X11Wnd::createFont(const char** names, int width, int height, int weight)
{
  const char* name = NULL;
  for (int i = 0; names[i] != NULL; i++)
  {
    if (testFont(names[i]))
    {
      name = names[i];
      break;
    }
  }
  if (name == NULL)
    name = "Courier";

  return ::CreateFont(height,width,
    0,0,weight,FALSE,FALSE,FALSE,ANSI_CHARSET,
    OUT_TT_ONLY_PRECIS,CLIP_DEFAULT_PRECIS,PROOF_QUALITY,
    DEFAULT_PITCH|FF_DONTCARE,name);
}