在Windml里写字,是不是创建了一个font之后,只能调用一次uglTextDraw,如果要写其他字就要重新创建font?下面的程序能实现吗?先写0.125再写0.345
uglFontFindString(fontDrvId, "familyName=Courier; pixelSize = 12", &DialogFontDef); if ((fontDialog= uglFontCreate(fontDrvId, &DialogFontDef)) == UGL_NULL) { printf("Font not found. Exiting.\n"); return; }
uglBackgroundColorSet(gc, colorTable[BLACK].uglColor); uglForegroundColorSet(gc, colorTable[LIGHTGREEN].uglColor); uglTextSizeGetW(fontDialog, &textWidth, &textHeight, -1, "0.125"); uglFontSet(gc, fontDialog); uglTextDrawW(gc, 0, 0, -1, "0.125");
uglTextSizeGetW(fontDialog, &textWidth, &textHeight, -1, "0.345"); uglFontSet(gc, fontDialog); uglTextDrawW(gc, 0, 0, -1, "0.345");