The R Project SVN R

Rev

Rev 38916 | Rev 40672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 38916 Rev 39507
Line 1050... Line 1050...
1050
 
1050
 
1051
	    memset(&mb_st, 0, sizeof(mb_st));
1051
	    memset(&mb_st, 0, sizeof(mb_st));
1052
	    while (*s) {
1052
	    while (*s) {
1053
		wc = 0;
1053
		wc = 0;
1054
		res = mbrtowc(&wc, s, MB_LEN_MAX, &mb_st);
1054
		res = mbrtowc(&wc, s, MB_LEN_MAX, &mb_st);
-
 
1055
		if(res == -1) error("invalid multibyte string");
1055
		if (iswdigit(wc) && font != PlainFont) {
1056
		if (iswdigit(wc) && font != PlainFont) {
1056
		    font = PlainFont;
1057
		    font = PlainFont;
1057
		    SetFont(PlainFont, gc);
1058
		    SetFont(PlainFont, gc);
1058
		}
1059
		}
1059
		else if (font != prevfont) {
1060
		else if (font != prevfont) {
Line 1066... Line 1067...
1066
			ItalicFactor * bboxHeight(glyphBBox);
1067
			ItalicFactor * bboxHeight(glyphBBox);
1067
		else
1068
		else
1068
		    bboxItalic(glyphBBox) = 0;
1069
		    bboxItalic(glyphBBox) = 0;
1069
		if (draw) {
1070
		if (draw) {
1070
		    memset(chr, 0, sizeof(chr));
1071
		    memset(chr, 0, sizeof(chr));
1071
		    wcrtomb(chr,wc,&mb_st);
1072
		    res  = wcrtomb(chr, wc, &mb_st);
-
 
1073
		    if(res == -1) error("invalid multibyte string");
1072
		    PMoveAcross(lastItalicCorr, mc);
1074
		    PMoveAcross(lastItalicCorr, mc);
1073
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr,
1075
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr,
1074
			   0.0, 0.0, mc->CurrentAngle, gc,
1076
			   0.0, 0.0, mc->CurrentAngle, gc,
1075
			   dd);
1077
			   dd);
1076
		    PMoveAcross(bboxWidth(glyphBBox), mc);
1078
		    PMoveAcross(bboxWidth(glyphBBox), mc);
Line 1131... Line 1133...
1131
    bbox = GlyphBBox(ascii, gc, dd);
1133
    bbox = GlyphBBox(ascii, gc, dd);
1132
    if (draw) {
1134
    if (draw) {
1133
        memset(asciiStr, 0, sizeof(asciiStr));
1135
        memset(asciiStr, 0, sizeof(asciiStr));
1134
#ifdef SUPPORT_MBCS
1136
#ifdef SUPPORT_MBCS
1135
	if(mbcslocale) {
1137
	if(mbcslocale) {
1136
	    wcrtomb(asciiStr, ascii, NULL);
1138
	    size_t res = wcrtomb(asciiStr, ascii, NULL);
-
 
1139
	    if(res == -1)
-
 
1140
		error("invalid character in current multibyte locale");
1137
	} else
1141
	} else
1138
#endif
1142
#endif
1139
	    asciiStr[0] = ascii;
1143
	    asciiStr[0] = ascii;
1140
	GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), asciiStr,
1144
	GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), asciiStr,
1141
	       0.0, 0.0, mc->CurrentAngle, gc,
1145
	       0.0, 0.0, mc->CurrentAngle, gc,