File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/library/grDevices/src/cairo Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1488,9 +1488,9 @@ R_win32_cairo_select_font_face(cairo_t *cr,
14881488 cairo_font_face_t * ff ;
14891489
14901490 memset (& lf , 0 , sizeof (LOGFONTW ));
1491- if (mbstowcs (lf .lfFaceName , family , 32 ) == (size_t )-1 )
1491+ if (mbstowcs (lf .lfFaceName , family , LF_FACESIZE - 1 ) == (size_t ) -1 )
14921492 return ;
1493- lf .lfFaceName [32 - 1 ] = L'\0' ;
1493+ lf .lfFaceName [LF_FACESIZE - 1 ] = L'\0' ;
14941494
14951495 if (weight == CAIRO_FONT_WEIGHT_BOLD )
14961496 lf .lfWeight = FW_BOLD ;
@@ -1506,6 +1506,9 @@ R_win32_cairo_select_font_face(cairo_t *cr,
15061506 ff = cairo_win32_font_face_create_for_logfontw (& lf );
15071507 if (ff && cairo_font_face_status (ff ) == CAIRO_STATUS_SUCCESS )
15081508 cairo_set_font_face (cr , ff );
1509+ else /* fall back to the default handler if not found */
1510+ cairo_select_font_face (cr , family , slant , weight );
1511+ if (ff ) cairo_font_face_destroy (ff );
15091512}
15101513#endif
15111514
You can’t perform that action at this time.
0 commit comments