The R Project SVN R

Rev

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

Rev 45967 Rev 45971
Line 1050... Line 1050...
1050
		}
1050
		}
1051
		else if (font != prevfont) {
1051
		else if (font != prevfont) {
1052
		    font = prevfont;
1052
		    font = prevfont;
1053
		    SetFont(prevfont, gc);
1053
		    SetFont(prevfont, gc);
1054
		}
1054
		}
1055
		glyphBBox = GlyphBBox((int)wc, gc, dd);
1055
		glyphBBox = GlyphBBox((unsigned int) wc, gc, dd);
1056
		if (UsingItalics(gc))
1056
		if (UsingItalics(gc))
1057
		    bboxItalic(glyphBBox) =
1057
		    bboxItalic(glyphBBox) =
1058
			ItalicFactor * bboxHeight(glyphBBox);
1058
			ItalicFactor * bboxHeight(glyphBBox);
1059
		else
1059
		else
1060
		    bboxItalic(glyphBBox) = 0;
1060
		    bboxItalic(glyphBBox) = 0;
Line 1084... Line 1084...
1084
		}
1084
		}
1085
		else if (font != prevfont) {
1085
		else if (font != prevfont) {
1086
		    font = prevfont;
1086
		    font = prevfont;
1087
		    SetFont(prevfont, gc);
1087
		    SetFont(prevfont, gc);
1088
		}
1088
		}
1089
		glyphBBox = GlyphBBox(*s, gc, dd);
1089
		glyphBBox = GlyphBBox((unsigned char) *s, gc, dd);
1090
		if (UsingItalics(gc))
1090
		if (UsingItalics(gc))
1091
		    bboxItalic(glyphBBox) =
1091
		    bboxItalic(glyphBBox) =
1092
			ItalicFactor * bboxHeight(glyphBBox);
1092
			ItalicFactor * bboxHeight(glyphBBox);
1093
		else
1093
		else
1094
		    bboxItalic(glyphBBox) = 0;
1094
		    bboxItalic(glyphBBox) = 0;
Line 1158... Line 1158...
1158
	    wchar_t wc;
1158
	    wchar_t wc;
1159
	    const char *p = str;
1159
	    const char *p = str;
1160
	    mbstate_t mb_st;
1160
	    mbstate_t mb_st;
1161
	    mbs_init(&mb_st);
1161
	    mbs_init(&mb_st);
1162
	    while ((used = Mbrtowc(&wc, p, n, &mb_st)) > 0) {
1162
	    while ((used = Mbrtowc(&wc, p, n, &mb_st)) > 0) {
-
 
1163
		/* On Windows could have sign extension here */
1163
		glyphBBox = GlyphBBox(wc, gc, dd);
1164
		glyphBBox = GlyphBBox((unsigned int) wc, gc, dd);
1164
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1165
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1165
		p += used; n -= used; nc++;
1166
		p += used; n -= used; nc++;
1166
	    }
1167
	    }
1167
	} else
1168
	} else
1168
#endif
1169
#endif
1169
	{
1170
	{
1170
	    const char *s = str;
1171
	    const char *s = str;
1171
	    while (*s) {
1172
	    while (*s) {
-
 
1173
		/* Watch for sign extension here - fixed > 2.7.1 */
1172
		glyphBBox = GlyphBBox(*s, gc, dd);
1174
		glyphBBox = GlyphBBox((unsigned char) *s, gc, dd);
1173
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1175
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1174
		s++; nc++;
1176
		s++; nc++;
1175
	    }
1177
	    }
1176
	}
1178
	}
1177
	if(nc > 1) {
1179
	if(nc > 1) {