Added check for NULL for numbnuts (like me) who query the size of a font before choosing a font... .
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5179 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
30786c2ed3
commit
aa9148eea8
@ -292,6 +292,11 @@ double fl_width(const char* txt, int n) {
|
||||
// The result should be the same.
|
||||
}
|
||||
}
|
||||
if (!fl_fontsize) {
|
||||
fl_font(0, 12); // avoid a crash!
|
||||
if (!fl_fontsize)
|
||||
return 0.0; // user must select a font first!
|
||||
}
|
||||
OSStatus err;
|
||||
// convert to UTF-16 first
|
||||
UniChar *uniStr = fl_macToUtf16(txt, n);
|
||||
|
Loading…
Reference in New Issue
Block a user