![]() |
|
font size |
Recorder
Member #6,860
February 2006
|
Newbie question Is the only way to get a larger font size when using textout or textprintf to create a custom font? Or maybe some other output function I should use? I don't mind using the default font but I just want it to be bigger. |
ReyBrujo
Moderator
January 2001
![]() |
Yes, Allegro can't use true type fonts, only bitmap-based ones. So, you need to create your own font with the size you want. -- |
Jeff Bernard
Member #6,698
December 2005
![]() |
Or you could just write a function to stretch the default font...something like this:
This is untested code, but it looks to me like it would work. There may be some modifications to make it better... -- |
Recorder
Member #6,860
February 2006
|
Thanks. I was looking at the api and didn't any obvious 'increment here to increase font' values. I'll try both suggestions |
Thomas Fjellstrom
Member #476
June 2000
![]() |
// get size of message int size = 0; for (; message[size] != '\0'; size++);
How bout this instead: -- |
Jeff Bernard
Member #6,698
December 2005
![]() |
Thomas Fjellstrom said:
// get size of message int size = 0; for (; message[size] != '\0'; size++);
How bout this instead: strlen() requires you to #include <string>. With my method, you don't need to include strings. So, if you're already using string objects, I suppose it would be better to use strlen(), however, if you don't have any other string objects I think my method would be better because then you don't have to include and entire file just for one function. -- |
Thomas Fjellstrom
Member #476
June 2000
![]() |
actually, it requires you to include string.h, or cstring, depending on if you use C, or C++ (in that order) also, C strings are not objects, they are plain arrays of char. And its always best to use the provided standard functions. -- |
miran
Member #2,407
June 2002
|
And what's wrong with Allegro's ustrlen()? -- |
|