The R Project SVN R

Rev

Rev 45963 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 45963 Rev 45972
Line 1054... Line 1054...
1054
		}
1054
		}
1055
		else if (font != prevfont) {
1055
		else if (font != prevfont) {
1056
		    font = prevfont;
1056
		    font = prevfont;
1057
		    SetFont(prevfont, gc);
1057
		    SetFont(prevfont, gc);
1058
		}
1058
		}
1059
		glyphBBox = GlyphBBox((int)wc, gc, dd);
1059
		glyphBBox = GlyphBBox((unsigned int) wc, gc, dd);
1060
		if (UsingItalics(gc))
1060
		if (UsingItalics(gc))
1061
		    bboxItalic(glyphBBox) =
1061
		    bboxItalic(glyphBBox) =
1062
			ItalicFactor * bboxHeight(glyphBBox);
1062
			ItalicFactor * bboxHeight(glyphBBox);
1063
		else
1063
		else
1064
		    bboxItalic(glyphBBox) = 0;
1064
		    bboxItalic(glyphBBox) = 0;
Line 1088... Line 1088...
1088
		}
1088
		}
1089
		else if (font != prevfont) {
1089
		else if (font != prevfont) {
1090
		    font = prevfont;
1090
		    font = prevfont;
1091
		    SetFont(prevfont, gc);
1091
		    SetFont(prevfont, gc);
1092
		}
1092
		}
1093
		glyphBBox = GlyphBBox(*s, gc, dd);
1093
		glyphBBox = GlyphBBox((unsigned char) *s, gc, dd);
1094
		if (UsingItalics(gc))
1094
		if (UsingItalics(gc))
1095
		    bboxItalic(glyphBBox) =
1095
		    bboxItalic(glyphBBox) =
1096
			ItalicFactor * bboxHeight(glyphBBox);
1096
			ItalicFactor * bboxHeight(glyphBBox);
1097
		else
1097
		else
1098
		    bboxItalic(glyphBBox) = 0;
1098
		    bboxItalic(glyphBBox) = 0;
Line 1162... Line 1162...
1162
	    wchar_t wc;
1162
	    wchar_t wc;
1163
	    const char *p = str;
1163
	    const char *p = str;
1164
	    mbstate_t mb_st;
1164
	    mbstate_t mb_st;
1165
	    mbs_init(&mb_st);
1165
	    mbs_init(&mb_st);
1166
	    while ((used = Mbrtowc(&wc, p, n, &mb_st)) > 0) {
1166
	    while ((used = Mbrtowc(&wc, p, n, &mb_st)) > 0) {
-
 
1167
		/* On Windows could have sign extension here */
1167
		glyphBBox = GlyphBBox(wc, gc, dd);
1168
		glyphBBox = GlyphBBox((unsigned int) wc, gc, dd);
1168
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1169
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1169
		p += used; n -= used; nc++;
1170
		p += used; n -= used; nc++;
1170
	    }
1171
	    }
1171
	} else
1172
	} else
1172
#endif
1173
#endif
1173
	{
1174
	{
1174
	    const char *s = str;
1175
	    const char *s = str;
1175
	    while (*s) {
1176
	    while (*s) {
-
 
1177
		/* Watch for sign extension here - fixed > 2.7.1 */
1176
		glyphBBox = GlyphBBox(*s, gc, dd);
1178
		glyphBBox = GlyphBBox((unsigned char) *s, gc, dd);
1177
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1179
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1178
		s++; nc++;
1180
		s++; nc++;
1179
	    }
1181
	    }
1180
	}
1182
	}
1181
	if(nc > 1) {
1183
	if(nc > 1) {