The R Project SVN R

Rev

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

Rev 45667 Rev 45962
Line 1060... Line 1060...
1060
		    memset(chr, 0, sizeof(chr));
1060
		    memset(chr, 0, sizeof(chr));
1061
		    /* should not be possible, as we just converted to wc */
1061
		    /* should not be possible, as we just converted to wc */
1062
		    if(wcrtomb(chr, wc, &mb_st) == -1)
1062
		    if(wcrtomb(chr, wc, &mb_st) == -1)
1063
			error("invalid multibyte string");
1063
			error("invalid multibyte string");
1064
		    PMoveAcross(lastItalicCorr, mc);
1064
		    PMoveAcross(lastItalicCorr, mc);
1065
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr, CE_NATIVE,
1065
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr,
-
 
1066
			   CE_NATIVE,
1066
			   0.0, 0.0, mc->CurrentAngle, gc, dd);
1067
			   0.0, 0.0, mc->CurrentAngle, gc, dd);
1067
		    PMoveAcross(bboxWidth(glyphBBox), mc);
1068
		    PMoveAcross(bboxWidth(glyphBBox), mc);
1068
		}
1069
		}
1069
		bboxWidth(resultBBox) += lastItalicCorr;
1070
		bboxWidth(resultBBox) += lastItalicCorr;
1070
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1071
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
Line 1090... Line 1091...
1090
		else
1091
		else
1091
		    bboxItalic(glyphBBox) = 0;
1092
		    bboxItalic(glyphBBox) = 0;
1092
		if (draw) {
1093
		if (draw) {
1093
		    chr[0] = *s;
1094
		    chr[0] = *s;
1094
		    PMoveAcross(lastItalicCorr, mc);
1095
		    PMoveAcross(lastItalicCorr, mc);
1095
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr, CE_NATIVE,
1096
		    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), chr, 
-
 
1097
			   CE_NATIVE,
1096
			   0.0, 0.0, mc->CurrentAngle, gc, dd);
1098
			   0.0, 0.0, mc->CurrentAngle, gc, dd);
1097
		    PMoveAcross(bboxWidth(glyphBBox), mc);
1099
		    PMoveAcross(bboxWidth(glyphBBox), mc);
1098
		}
1100
		}
1099
		bboxWidth(resultBBox) += lastItalicCorr;
1101
		bboxWidth(resultBBox) += lastItalicCorr;
1100
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
1102
		resultBBox = CombineBBoxes(resultBBox, glyphBBox);
Line 1142... Line 1144...
1142
		      pGEcontext gc, pGEDevDesc dd)
1144
		      pGEcontext gc, pGEDevDesc dd)
1143
{
1145
{
1144
    BBOX glyphBBox = NullBBox(); /* might be use do italic corr on str="" */
1146
    BBOX glyphBBox = NullBBox(); /* might be use do italic corr on str="" */
1145
    BBOX resultBBox = NullBBox();
1147
    BBOX resultBBox = NullBBox();
1146
    int nc = 0;
1148
    int nc = 0;
-
 
1149
    cetype_t enc = (gc->fontface == 5) ? CE_SYMBOL : CE_NATIVE;
1147
 
1150
 
1148
    if (str) {
1151
    if (str) {
1149
#ifdef SUPPORT_MBCS
1152
#ifdef SUPPORT_MBCS
1150
	/* need to advance by character, not byte, except in the symbol font */
1153
	/* need to advance by character, not byte, except in the symbol font */
1151
	if(mbcslocale && gc->fontface != 5) {
1154
	if(mbcslocale && gc->fontface != 5) {
Line 1169... Line 1172...
1169
		s++; nc++;
1172
		s++; nc++;
1170
	    }
1173
	    }
1171
	}
1174
	}
1172
	if(nc > 1) {
1175
	if(nc > 1) {
1173
	    /* Finding the width by adding up boxes is incorrect (kerning) */
1176
	    /* Finding the width by adding up boxes is incorrect (kerning) */
1174
	    double wd = GEStrWidth(str, CE_NATIVE, gc, dd);
1177
	    double wd = GEStrWidth(str, enc, gc, dd);
1175
	    bboxWidth(resultBBox) = fromDeviceHeight(wd, MetricUnit, dd);
1178
	    bboxWidth(resultBBox) = fromDeviceHeight(wd, MetricUnit, dd);
1176
	}
1179
	}
1177
	if (draw) {
1180
	if (draw) {
1178
	    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), str, CE_NATIVE,
1181
	    GEText(ConvertedX(mc ,dd), ConvertedY(mc, dd), str, enc,
1179
		   0.0, 0.0, mc->CurrentAngle, gc, dd);
1182
		   0.0, 0.0, mc->CurrentAngle, gc, dd);
1180
	    PMoveAcross(bboxWidth(resultBBox), mc);
1183
	    PMoveAcross(bboxWidth(resultBBox), mc);
1181
	}
1184
	}
1182
	if (UsingItalics(gc))
1185
	if (UsingItalics(gc))
1183
	    bboxItalic(resultBBox) = ItalicFactor * bboxHeight(glyphBBox);
1186
	    bboxItalic(resultBBox) = ItalicFactor * bboxHeight(glyphBBox);