Computer Science Canada Problem with Font.Draw, simple problem. |
Author: | GlobeTrotter [ Mon Jan 31, 2005 6:07 pm ] | ||
Post subject: | Problem with Font.Draw, simple problem. | ||
In that code, why doesn't all of the text fit in? It simply does not make sense to me. |
Author: | person [ Mon Jan 31, 2005 6:24 pm ] |
Post subject: | |
it has to do with the font u r using |
Author: | GlobeTrotter [ Mon Jan 31, 2005 6:27 pm ] |
Post subject: | |
Actually, I don't think so. Its the same thing with Arial, and others. I intentionally tried a font that is uniform, since I thought this might have been a solution to the problem, but it wasn't |
Author: | Cervantes [ Mon Jan 31, 2005 6:30 pm ] | ||
Post subject: | |||
Perhaps because of the spacing between the numbers? Perhaps Font.Width will be useful:
It pains me to have to do that, but that's all I can think of at the moment. ![]() -Cervantes |
Author: | person [ Mon Jan 31, 2005 6:36 pm ] |
Post subject: | |
Quote: Actually, I don't think so. Its the same thing with Arial, and others. I intentionally tried a font that is uniform, since I thought this might have been a solution to the problem, but it wasn't
try these fonts, u should see a drastic difference: Coronet Edwardian Script ITC if u dont...well i dont know ur problem cuz its different on my comp |
Author: | basketball4ever [ Mon Jan 31, 2005 6:46 pm ] |
Post subject: | |
person wrote: Quote: Actually, I don't think so. Its the same thing with Arial, and others. I intentionally tried a font that is uniform, since I thought this might have been a solution to the problem, but it wasn't
try these fonts, u should see a drastic difference: Coronet Edwardian Script ITC if u dont...well i dont know ur problem cuz its different on my comp ![]() |
Author: | GlobeTrotter [ Mon Jan 31, 2005 6:48 pm ] | ||||
Post subject: | |||||
Thanks Cervantes, that works. I made it a bit less hardcoded.
edit: I found a way to make my original code work. I am unsure why the fix is necessary, but multiplying the width by 3/4 makes it right.
|
Author: | person [ Mon Jan 31, 2005 7:17 pm ] |
Post subject: | |
correct me if im wrong cuz im not so sure about this...anyways...i have a feeling that it measures not in pixels, but in the width of a certain font size |
Author: | basketball4ever [ Mon Jan 31, 2005 7:26 pm ] |
Post subject: | |
person wrote: correct me if im wrong cuz im not so sure about this...anyways...i have a feeling that it measures not in pixels, but in the width of a certain font size
The width of a certain font size is measured in pixels. Thats how Font.Draw works. Thats why some fonts fit in his original coding, but not in others. However, you can fix the width of each font also. As shown by cervantes. |