summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-01-10 19:00:39 +0000
committerManolo Gouy <Manolo>2016-01-10 19:00:39 +0000
commitacc50806538da470ba18a2f7b76ea65a64cb5f5c (patch)
tree6075675196b31c5a04aa3554a8421c65a5f4c5bc /src
parent19c8c9b9180e599a6b5bd3933e4e008632f8ce5a (diff)
Replicate in branch-1.3-porting a recent change of branch-1.3
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11001 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_font_win32.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx
index 9078827ab..5e15ec807 100644
--- a/src/fl_font_win32.cxx
+++ b/src/fl_font_win32.cxx
@@ -383,6 +383,8 @@ exit_error:
void Fl_GDI_Graphics_Driver::draw(const char* str, int n, int x, int y) {
COLORREF oldColor = SetTextColor(fl_gc, fl_RGB());
+ // avoid crash if no font has been set yet
+ if (!font_descriptor()) this->font(FL_HELVETICA, FL_NORMAL_SIZE);
SelectObject(fl_gc, font_descriptor()->fid);
int wn = fl_utf8toUtf16(str, n, wstr, wstr_len);
if(wn >= wstr_len) {