The R Project SVN R

Rev

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

Rev 32720 Rev 32871
Line 319... Line 319...
319
    case xi11:	  /* big_op_spacing3 */
319
    case xi11:	  /* big_op_spacing3 */
320
    case xi12:	  /* big_op_spacing4 */
320
    case xi12:	  /* big_op_spacing4 */
321
    case xi13:	  /* big_op_spacing5 */
321
    case xi13:	  /* big_op_spacing5 */
322
	return 0.15 * XHeight(gc, dd);
322
	return 0.15 * XHeight(gc, dd);
323
    default:/* never happens (enum type) */
323
    default:/* never happens (enum type) */
324
	error("invalid `which' in TeX()!"); return 0;/*-Wall*/
324
	error(_("invalid `which' in TeX")); return 0;/*-Wall*/
325
    }
325
    }
326
}
326
}
327
 
327
 
328
static STYLE GetStyle(mathContext *mc)
328
static STYLE GetStyle(mathContext *mc)
329
{
329
{
Line 346... Line 346...
346
    case STYLE_SS:
346
    case STYLE_SS:
347
    case STYLE_SS1:
347
    case STYLE_SS1:
348
	gc->cex = 0.5 * mc->BaseCex;
348
	gc->cex = 0.5 * mc->BaseCex;
349
	break;
349
	break;
350
    default:
350
    default:
351
	error("invalid math style encountered");
351
	error(_("invalid math style encountered"));
352
    }
352
    }
353
    mc->CurrentStyle = newstyle;
353
    mc->CurrentStyle = newstyle;
354
}
354
}
355
 
355
 
356
static void SetPrimeStyle(STYLE style, mathContext *mc, R_GE_gcontext *gc)
356
static void SetPrimeStyle(STYLE style, mathContext *mc, R_GE_gcontext *gc)
Line 1257... Line 1257...
1257
	opBBox = CombineBBoxes(arg1BBox, opBBox);
1257
	opBBox = CombineBBoxes(arg1BBox, opBBox);
1258
	opBBox = CombineBBoxes(opBBox, arg2BBox);
1258
	opBBox = CombineBBoxes(opBBox, arg2BBox);
1259
	return opBBox;
1259
	return opBBox;
1260
    }
1260
    }
1261
    else
1261
    else
1262
	error("invalid mathematical annotation");
1262
	error(_("invalid mathematical annotation"));
1263
 
1263
 
1264
    return NullBBox();		/* -Wall */
1264
    return NullBBox();		/* -Wall */
1265
}
1265
}
1266
 
1266
 
1267
static SymTab BinTable[] = {
1267
static SymTab BinTable[] = {
Line 1404... Line 1404...
1404
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw, mc, gc, dd));
1404
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw, mc, gc, dd));
1405
	return CombineBBoxes(bbox, RenderElement(CADR(expr), draw, mc,
1405
	return CombineBBoxes(bbox, RenderElement(CADR(expr), draw, mc,
1406
						 gc, dd));
1406
						 gc, dd));
1407
    }
1407
    }
1408
    else
1408
    else
1409
	error("invalid mathematical annotation");
1409
	error(_("invalid mathematical annotation"));
1410
 
1410
 
1411
    return NullBBox();		/* -Wall */
1411
    return NullBBox();		/* -Wall */
1412
 
1412
 
1413
}
1413
}
1414
 
1414
 
Line 1706... Line 1706...
1706
    return NameAtom(expr) && (AccentCode(expr) != 0);
1706
    return NameAtom(expr) && (AccentCode(expr) != 0);
1707
}
1707
}
1708
 
1708
 
1709
static void InvalidAccent(SEXP expr)
1709
static void InvalidAccent(SEXP expr)
1710
{
1710
{
1711
    errorcall(expr, "invalid accent");
1711
    errorcall(expr, _("invalid accent"));
1712
}
1712
}
1713
 
1713
 
1714
static BBOX RenderAccent(SEXP expr, int draw, mathContext *mc,
1714
static BBOX RenderAccent(SEXP expr, int draw, mathContext *mc,
1715
			 R_GE_gcontext *gc, GEDevDesc *dd)
1715
			 R_GE_gcontext *gc, GEDevDesc *dd)
1716
{
1716
{
Line 1991... Line 1991...
1991
	    code = '}';
1991
	    code = '}';
1992
	else if (StringMatch(head, "") || StringMatch(head, "."))
1992
	else if (StringMatch(head, "") || StringMatch(head, "."))
1993
	    code = '.';
1993
	    code = '.';
1994
    }
1994
    }
1995
    if (code == 0)
1995
    if (code == 0)
1996
	errorcall(expr, "invalid group delimiter");
1996
	errorcall(expr, _("invalid group delimiter"));
1997
    return code;
1997
    return code;
1998
}
1998
}
1999
 
1999
 
2000
static BBOX RenderDelimiter(int delim, int draw, mathContext *mc,
2000
static BBOX RenderDelimiter(int delim, int draw, mathContext *mc,
2001
			    R_GE_gcontext *gc, GEDevDesc *dd)
2001
			    R_GE_gcontext *gc, GEDevDesc *dd)
Line 2018... Line 2018...
2018
{
2018
{
2019
    double cexSaved = gc->cex;
2019
    double cexSaved = gc->cex;
2020
    BBOX bbox;
2020
    BBOX bbox;
2021
    int code;
2021
    int code;
2022
    if (length(expr) != 4)
2022
    if (length(expr) != 4)
2023
	errorcall(expr, "invalid group specification");
2023
	errorcall(expr, _("invalid group specification"));
2024
    bbox = NullBBox();
2024
    bbox = NullBBox();
2025
    code = DelimCode(expr, CADR(expr));
2025
    code = DelimCode(expr, CADR(expr));
2026
    gc->cex = DelimSymbolMag * gc->cex;
2026
    gc->cex = DelimSymbolMag * gc->cex;
2027
    if (code == 2) {
2027
    if (code == 2) {
2028
	bbox = RenderSymbolChar('|', draw, mc, gc, dd);
2028
	bbox = RenderSymbolChar('|', draw, mc, gc, dd);
Line 2089... Line 2089...
2089
	break;
2089
	break;
2090
    case '}':
2090
    case '}':
2091
	top = 252; ext = 239; bot = 254; mid = 253;
2091
	top = 252; ext = 239; bot = 254; mid = 253;
2092
	break;
2092
	break;
2093
    default:
2093
    default:
2094
	error("group is incomplete");
2094
	error(_("group is incomplete"));
2095
	return ansBBox;/*never reached*/
2095
	return ansBBox;/*never reached*/
2096
    }
2096
    }
2097
    topBBox = GlyphBBox(top, gc, dd);
2097
    topBBox = GlyphBBox(top, gc, dd);
2098
    extBBox = GlyphBBox(ext, gc, dd);
2098
    extBBox = GlyphBBox(ext, gc, dd);
2099
    botBBox = GlyphBBox(bot, gc, dd);
2099
    botBBox = GlyphBBox(bot, gc, dd);
Line 2164... Line 2164...
2164
    BBOX bbox;
2164
    BBOX bbox;
2165
    double axisHeight = TeX(sigma22, gc, dd);
2165
    double axisHeight = TeX(sigma22, gc, dd);
2166
    double extra = 0.2 * xHeight(gc, dd);
2166
    double extra = 0.2 * xHeight(gc, dd);
2167
    int delim1, delim2;
2167
    int delim1, delim2;
2168
    if (length(expr) != 4)
2168
    if (length(expr) != 4)
2169
	errorcall(expr, "invalid group specification");
2169
	errorcall(expr, _("invalid group specification"));
2170
    bbox = NullBBox();
2170
    bbox = NullBBox();
2171
    delim1 = DelimCode(expr, CADR(expr));
2171
    delim1 = DelimCode(expr, CADR(expr));
2172
    delim2 = DelimCode(expr, CADDDR(expr));
2172
    delim2 = DelimCode(expr, CADDDR(expr));
2173
    bbox = RenderElement(CADDR(expr), 0, mc, gc, dd);
2173
    bbox = RenderElement(CADDR(expr), 0, mc, gc, dd);
2174
    dist = max(bboxHeight(bbox) - axisHeight, bboxDepth(bbox) + axisHeight);
2174
    dist = max(bboxHeight(bbox) - axisHeight, bboxDepth(bbox) + axisHeight);
Line 2688... Line 2688...
2688
	bbox = CombineBBoxes(bbox, RenderSymbolChar(op, draw, mc, gc, dd));
2688
	bbox = CombineBBoxes(bbox, RenderSymbolChar(op, draw, mc, gc, dd));
2689
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw, mc, gc, dd));
2689
	bbox = CombineBBoxes(bbox, RenderGap(gap, draw, mc, gc, dd));
2690
	return
2690
	return
2691
	    CombineBBoxes(bbox, RenderElement(CADDR(expr), draw, mc, gc, dd));
2691
	    CombineBBoxes(bbox, RenderElement(CADDR(expr), draw, mc, gc, dd));
2692
    }
2692
    }
2693
    else error("invalid mathematical annotation");
2693
    else error(_("invalid mathematical annotation"));
2694
 
2694
 
2695
    return NullBBox();		/* -Wall */
2695
    return NullBBox();		/* -Wall */
2696
}
2696
}
2697
 
2697
 
2698
 
2698
 
Line 3148... Line 3148...
3148
    /* then bail out */
3148
    /* then bail out */
3149
    double ascent, descent, width;
3149
    double ascent, descent, width;
3150
    GEMetricInfo(0, gc,
3150
    GEMetricInfo(0, gc,
3151
		&ascent, &descent, &width, dd);
3151
		&ascent, &descent, &width, dd);
3152
    if ((ascent==0) && (descent==0) && (width==0))
3152
    if ((ascent==0) && (descent==0) && (width==0))
3153
	error("Metric information not yet available for this device");
3153
	error(_("Metric information not available for this device"));
3154
#endif
3154
#endif
3155
 
3155
 
3156
    /*
3156
    /*
3157
     * Build a "drawing context" for the current expression
3157
     * Build a "drawing context" for the current expression
3158
     */
3158
     */
Line 3260... Line 3260...
3260
    /* IF font metric information is not available for device */
3260
    /* IF font metric information is not available for device */
3261
    /* then bail out */
3261
    /* then bail out */
3262
    double ascent, descent, width;
3262
    double ascent, descent, width;
3263
    GMetricInfo(0, &ascent, &descent, &width, DEVICE, dd);
3263
    GMetricInfo(0, &ascent, &descent, &width, DEVICE, dd);
3264
    if ((ascent==0) && (descent==0) && (width==0))
3264
    if ((ascent==0) && (descent==0) && (width==0))
3265
	error("Metric information not yet available for this device");
3265
	error(_("Metric information not available for this device"));
3266
#endif
3266
#endif
3267
 
3267
 
3268
    xadj = Rf_gpptr(dd)->adj;
3268
    xadj = Rf_gpptr(dd)->adj;
3269
 
3269
 
3270
    /* This is MOSTLY the same as the same section of GMtext
3270
    /* This is MOSTLY the same as the same section of GMtext