Beispiel #1
0
void drawSaveMenu(SaveMenu* sm){
	Font* font = InitFont();
	drawBitmap(sm->Exit, Exit3X, Exit3Y, ALIGN_LEFT, 0);
	if (sm->exit == 1) {
		drawBitmap(sm->Highlight, Exit3X, Exit3Y, ALIGN_LEFT, 0);
	} else if (sm->flag1 == 1) {
		drawBitmap(sm->Highlight2, 500, 235, ALIGN_LEFT, 0);
	} else if (sm->flag2 == 1) {
		drawBitmap(sm->Highlight2, 550, 235, ALIGN_LEFT, 0);
	} else if (sm->flag3 == 1) {
		drawBitmap(sm->Highlight2, 600, 235, ALIGN_LEFT, 0);
	}
	drawChar(font, sm->Letter1, 500, 200);
	drawChar(font, sm->Letter3, 600, 200);
	drawChar(font, sm->Letter2, 550, 200);
	char str[15];
	sprintf(str, "%d", sm->score);
	char score[] = "SCORE";
	char name[] = "NAME";
	drawText(font, name, 300, 200);
	drawText(font, score, 270, 400);
	drawText(font, str, 500, 400);
	deleteFont(font);

}
Beispiel #2
0
void
XeTeXFontMgr::getOpSizeRecAndStyleFlags(Font* theFont)
{
    XeTeXFont font = createFont(theFont->fontRef, 655360);
    XeTeXFontInst* fontInst = (XeTeXFontInst*) font;
    if (font != 0) {
        const OpSizeRec* pSizeRec = getOpSize(font);
        if (pSizeRec != NULL) {
            theFont->opSizeInfo.designSize = pSizeRec->designSize;
            if (pSizeRec->subFamilyID == 0
                && pSizeRec->nameCode == 0
                && pSizeRec->minSize == 0
                && pSizeRec->maxSize == 0)
                goto done_size; // feature is valid, but no 'size' range
            theFont->opSizeInfo.subFamilyID = pSizeRec->subFamilyID;
            theFont->opSizeInfo.nameCode = pSizeRec->nameCode;
            theFont->opSizeInfo.minSize = pSizeRec->minSize;
            theFont->opSizeInfo.maxSize = pSizeRec->maxSize;
        }
    done_size:

        const TT_OS2* os2Table = (TT_OS2*) fontInst->getFontTable(ft_sfnt_os2);
        if (os2Table != NULL) {
            theFont->weight = os2Table->usWeightClass;
            theFont->width = os2Table->usWidthClass;
            uint16_t sel = os2Table->fsSelection;
            theFont->isReg = (sel & (1 << 6)) != 0;
            theFont->isBold = (sel & (1 << 5)) != 0;
            theFont->isItalic = (sel & (1 << 0)) != 0;
        }

        const TT_Header* headTable = (TT_Header*) fontInst->getFontTable(ft_sfnt_head);
        if (headTable != NULL) {
            uint16_t ms = headTable->Mac_Style;
            if ((ms & (1 << 0)) != 0)
                theFont->isBold = true;
            if ((ms & (1 << 1)) != 0)
                theFont->isItalic = true;
        }

        const TT_Postscript* postTable = (const TT_Postscript*) fontInst->getFontTable(ft_sfnt_post);
        if (postTable != NULL) {
            theFont->slant = (int)(1000 * (tan(Fix2D(-postTable->italicAngle) * M_PI / 180.0)));
        }
        deleteFont(font);
    }
}
Beispiel #3
0
void
XeTeXFontMgr::getOpSizeRecAndStyleFlags(Font* theFont)
{
	XeTeXFont	font = createFont(theFont->fontRef, 655360);
	if (font != 0) {
		const OpSizeRec* pSizeRec = getOpSizePtr(font);
		if (pSizeRec != NULL) {
			theFont->opSizeInfo.designSize = SWAP(pSizeRec->designSize);
			if (SWAP(pSizeRec->subFamilyID) == 0
				&& SWAP(pSizeRec->nameCode) == 0
				&& SWAP(pSizeRec->minSize) == 0
				&& SWAP(pSizeRec->maxSize) == 0)
				goto done_size;	// feature is valid, but no 'size' range
			theFont->opSizeInfo.subFamilyID = SWAP(pSizeRec->subFamilyID);
			theFont->opSizeInfo.nameCode = SWAP(pSizeRec->nameCode);
			theFont->opSizeInfo.minSize = SWAP(pSizeRec->minSize);
			theFont->opSizeInfo.maxSize = SWAP(pSizeRec->maxSize);
		}
	done_size:

		const OS2TableHeader* os2Table = (const OS2TableHeader*)getFontTablePtr(font, LE_OS_2_TABLE_TAG);
		if (os2Table != NULL) {
			theFont->weight = SWAP(os2Table->usWeightClass);
			theFont->width = SWAP(os2Table->usWidthClass);
			UInt16 sel = SWAP(os2Table->fsSelection);
			theFont->isReg = (sel & (1 << 6)) != 0;
			theFont->isBold = (sel & (1 << 5)) != 0;
			theFont->isItalic = (sel & (1 << 0)) != 0;
		}

		const HEADTable* headTable = (const HEADTable*)getFontTablePtr(font, LE_HEAD_TABLE_TAG);
		if (headTable != NULL) {
			UInt16	ms = SWAP(headTable->macStyle);
			if ((ms & (1 << 0)) != 0)
				theFont->isBold = true;
			if ((ms & (1 << 1)) != 0)
				theFont->isItalic = true;
		}

		const POSTTable* postTable = (const POSTTable*)getFontTablePtr(font, LE_POST_TABLE_TAG);
		if (postTable != NULL) {
			theFont->slant = (int)(1000 * (tan(Fix2X(-SWAP(postTable->italicAngle)) * M_PI / 180.0)));
		}
		deleteFont(font);
	}
}
Beispiel #4
0
void XEditBox::keydownEvent(X_Event *event)
{
	switch(event->key->keysym.sym)
	{
		case SDLK_LEFT:
			
			CursorLeftMove();
		break;				
		case SDLK_RIGHT:
			CursorRightMove();
		break;
		
		case SDLK_BACKSPACE:
			{
				deleteFont();
				onPaint(X_UPDATE);
			}
		break;
		
	}
	
	if(event->key->keysym.sym <=126 && event->key->keysym.sym>=32)
	{
		char ch[2]="\n";
		
		*ch=event->key->keysym.sym;
		text.insert(cursor_addr,1,event->key->keysym.sym);
		cursor_addr++;
		cursor_postion+=font->getFontWidth(ch);
		if(cursor_postion> widget_rect.w-3)
		{
			cursor_postion = widget_rect.w-4;
			
		}
		
		static_cursor.resume();
		static_cursor.setLocation(text_rect.x+cursor_postion,widget_rect.y+5);
		static_cursor.paint();
		
		onPaint(X_UPDATE);
	}
}
Beispiel #5
0
void drawHighScores(HighScores* hs){
	drawBitmap(hs->HighScore, HighScore2X, HighScore2Y, ALIGN_LEFT, 0);
	drawBitmap(hs->Exit, Exit3X, Exit3Y, ALIGN_LEFT, 0);
	if (hs->exit == 1) {
		drawBitmap(hs->Highlight, Exit3X, Exit3Y, ALIGN_LEFT, 0);
	}
	Font* font = InitFont();
	int i, j;
	int Xpos = 350;
	int Ypos = 150;
	for (i = 0; i < 9; i++) {
		for (j = 0; j < 11; j++) {
			drawChar(font, hs->cells[i][j], Xpos, Ypos);
			Xpos = Xpos + 30;
		}
		if (Xpos == 680) {
			Xpos = 350;
			Ypos += 50;
		}
	}
	deleteFont(font);
	hs->counter++;
}
Beispiel #6
0
EWXWEXPORT(void,wxFont_SafeDelete)(wxFont* obj)
{
  if (!wxFont_IsStatic(obj)) {
    deleteFont(obj);
  }
}
Beispiel #7
0
cFontMgr::~cFontMgr()							// Destructor.
{
	deleteFont();
}