I am trying to get the longest length of some strings. It is working
Except it is not using MainWindow's font, which is proportional. It is using the system default font, which is mono spaced. I am not assigning a different font for my window, why isn't it using the correct one to measure the lengths?
- SAK_LongestStrLenPixels(int32 From,int32 To)
- STRPTR Text;
- int32 MaxLen=0, Len, i;
- for (i=From; i<=To; i++)
- if ((Text=SAK_LocaleString(i)))
- if ((Len=IGraphics->TextLength(MainWindow->RPort,Text,IUtility->Strlen(Text)))>MaxLen)