Example #1
0
/*
 * @brief Sets the font
 * to display the sensors values.
 */
void setFont()
{
	MAHandle defaultFont = maFontLoadDefault(FONT_TYPE_SANS_SERIF, 0, TEXT_SIZE);
	//Check if it's implemented on the current platform.
	if (0 > defaultFont)
	{
		maPanic(0, "Device fonts is only available on Android and iOS.");
	}
	maFontSetCurrent(defaultFont);
}
Example #2
0
void TestMoblet::testFont (int family, int style, int size, int top)
{
	MAHandle font = maFontLoadDefault(family,style,size);
	if ( font == RES_FONT_INVALID_SIZE)
	{
		maSetColor(0xCD3333);
		maDrawText(200,top,"Invalid size");
		maSetColor(0xC1FFC1);
	}
	else if( font == RES_FONT_NO_TYPE_STYLE_COMBINATION)
	{
		maSetColor(0xCD3333);
		maDrawText(200,top,"No type style combination");
		maSetColor(0xC1FFC1);
	}
	else
	{
		maFontSetCurrent(font);
		MAUtil::String message = "Ok, handle: " + MAUtil::integerToString(font);
		maDrawText(200, top, message.c_str());
	}
}