Scale font in viewer.drawText() api call

65 views
Skip to first unread message

katisss

unread,
Dec 14, 2017, 4:22:28 AM12/14/17
to Python Programming for Autodesk Maya
hi,
Is it possible to scale font size in a viewer.drawText() api call?
I tried glScale etc with no effect. Thanks fro your help

hasla...@gmail.com

unread,
Dec 15, 2017, 7:38:48 PM12/15/17
to Python Programming for Autodesk Maya
Did you figure it all out ?

katisss

unread,
Dec 16, 2017, 11:42:44 PM12/16/17
to Python Programming for Autodesk Maya
Hi,
No, I spend the rest of the week doing other projects.
The text is just debug so it is not super critical but then how hard can It be?
Happy holidays

fruit...@gmail.com

unread,
Dec 22, 2017, 12:13:17 PM12/22/17
to Python Programming for Autodesk Maya
I remember having the same issue a few years ago (drawText() is REALLY small ^^), and I couldn't find any solution. I ended up writing my text using openGL instead of maya.
something like
void yourLoc::vBitmapOutput(int x, int y, char *string, void *font){
int len;
glRasterPos2f(x,y) // position of the first char of the chain
len = (int) strlen(string) // get the length of the chain
// display each element of the string
for (unsigned int i(0); i<len; i++)
glutBitmapCharacter(font, string[i]);
Then in the maya method :
vBitmapOutput(0,0,(char*)textValue.asChar(),GLUT_BITMAP_HELVETICA_18); // or any other font, of another size (18 is the size, in my case).

One last thing : I don't know anything about openGL ; this works, but it's probably not the cleanest way

hasla...@gmail.com

unread,
Dec 31, 2017, 1:06:10 AM12/31/17
to Python Programming for Autodesk Maya
Hahah
Reply all
Reply to author
Forward
0 new messages