The R Project SVN R

Rev

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

Rev 5731 Rev 6098
Line 45... Line 45...
45
typedef enum {
45
typedef enum {
46
    PlainFont	   = 1,
46
    PlainFont	   = 1,
47
    BoldFont	   = 2,
47
    BoldFont	   = 2,
48
    ItalicFont	   = 3,
48
    ItalicFont	   = 3,
49
    BoldItalicFont = 4,
49
    BoldItalicFont = 4,
50
    SymbolFont	   = 5,
50
    SymbolFont	   = 5
51
} FontType;
51
} FontType;
52
 
52
 
53
/*
53
/*
54
 *  Italic Correction Factor
54
 *  Italic Correction Factor
55
 *
55
 *
Line 1007... Line 1007...
1007
    FontType font = prevfont;
1007
    FontType font = prevfont;
1008
    chr[1] = '\0';
1008
    chr[1] = '\0';
1009
    if (str) {
1009
    if (str) {
1010
	char *s = str;
1010
	char *s = str;
1011
	while (*s) {
1011
	while (*s) {
1012
	    if (isdigit(*s) && font != PlainFont) {
1012
	    if (isdigit((int)*s) && font != PlainFont) {
1013
		font = PlainFont;
1013
		font = PlainFont;
1014
		SetFont(PlainFont);
1014
		SetFont(PlainFont);
1015
	    }
1015
	    }
1016
	    else if (font != prevfont) {
1016
	    else if (font != prevfont) {
1017
		font = prevfont;
1017
		font = prevfont;
Line 2877... Line 2877...
2877
 
2877
 
2878
void GMathText(double x, double y, int coords, SEXP expr,
2878
void GMathText(double x, double y, int coords, SEXP expr,
2879
	       double xc, double yc, double rot, DevDesc *dd)
2879
	       double xc, double yc, double rot, DevDesc *dd)
2880
{
2880
{
2881
    BBOX bbox;
2881
    BBOX bbox;
-
 
2882
 
-
 
2883
#ifdef BUG61
-
 
2884
#else
-
 
2885
    /* IF font metric information is not available for device */
-
 
2886
    /* then bail out */
-
 
2887
    double ascent, descent, width;
-
 
2888
    GMetricInfo(0, &ascent, &descent, &width, DEVICE, dd);
-
 
2889
    if ((ascent==0) && (descent==0) && (width==0))
-
 
2890
	error("Metric information not yet available for this device\n");
-
 
2891
#endif
-
 
2892
 
2882
    MathDevice = dd;
2893
    MathDevice = dd;
2883
    BaseCex = MathDevice->gp.cex;
2894
    BaseCex = MathDevice->gp.cex;
2884
    BoxColor = name2col("pink");
2895
    BoxColor = name2col("pink");
2885
    TextColor = MathDevice->gp.col;
2896
    TextColor = MathDevice->gp.col;
2886
    CurrentStyle = STYLE_D;
2897
    CurrentStyle = STYLE_D;
Line 2910... Line 2921...
2910
		double at, int las, DevDesc *dd)
2921
		double at, int las, DevDesc *dd)
2911
{
2922
{
2912
    int coords = 0;
2923
    int coords = 0;
2913
    double a, xadj, yadj;
2924
    double a, xadj, yadj;
2914
 
2925
 
-
 
2926
#ifdef BUG61
-
 
2927
#else
-
 
2928
    /* IF font metric information is not available for device */
-
 
2929
    /* then bail out */
-
 
2930
    double ascent, descent, width;
-
 
2931
    GMetricInfo(0, &ascent, &descent, &width, DEVICE, dd);
-
 
2932
    if ((ascent==0) && (descent==0) && (width==0))
-
 
2933
	error("Metric information not yet available for this device\n");
-
 
2934
#endif
-
 
2935
 
2915
    MathDevice = dd;
2936
    MathDevice = dd;
2916
 
2937
 
2917
    if (outer) {
2938
    if (outer) {
2918
	switch (side) {
2939
	switch (side) {
2919
	case 1:
2940
	case 1: