Exemplo n.º 1
0
void DumpObject::InitFont(void)
{
    char c[2];
    AG_Surface *dummy;

    AG_PushTextState();
    pDbgDialogTextFont = AG_TextFontLookup(&DebuggerTextFont[0], DBG_TEXT_PT, 0);
    c[0] = '0';
    c[1] = '\0';
    if(pDbgDialogTextFont != NULL) {
        AG_TextFont(pDbgDialogTextFont);
    }
    AG_TextSize(c ,&CHRW, &CHRH);

    pDbgDialogSymFont = AG_TextFontLookup(DebuggerSymFont, DBG_TEXT_PT, 0);
    AG_PopTextState();
}
Exemplo n.º 2
0
static void
RenderText(VG_Text *vt, char *sIn, VG_View *vv)
{
	char sSubst[VG_TEXT_MAX], *s;
	VG_Vector v1, v2, vMid;
	int x, y;
	int su;

	if (vt->vsObj != NULL) {
		AG_VariableSubst(vt->vsObj, sIn, sSubst, sizeof(sSubst));
		s = sSubst;
	} else {
		s = sIn;
	}

	AG_PushTextState();

	if (vt->fontFace[0] != '\0' &&
	   ((agGUI && vt->fontSize != (int)agDefaultFont->spec.size) ||
	    (agGUI && vt->fontFlags != agDefaultFont->flags))) {
		AG_TextFontLookup(vt->fontFace, vt->fontSize, vt->fontFlags);
	}
	AG_TextColor(VG_MapColorRGB(VGNODE(vt)->color));

	v1 = VG_Pos(vt->p1);
	v2 = VG_Pos(vt->p2);
	vMid.x = v1.x + (v2.x - v1.x)/2.0f;
	vMid.y = v1.y + (v2.y - v1.y)/2.0f;
	VG_GetViewCoords(vv, vMid, &x, &y);
	
	if ((su = AG_TextCacheGet(vv->tCache, s)) != -1) {
		VG_DrawSurface(vv, x, y,
		    VG_Degrees(VG_Atan2(v1.y-v2.y, v1.x-v2.x)),
		    su);
	}
	AG_PopTextState();
}