split/Tioga/pdftext.c in tioga-1.5 vs split/Tioga/pdftext.c in tioga-1.6

- old
+ new

@@ -147,11 +147,11 @@ } VALUE FM_register_font(VALUE fmkr, VALUE font_name) { font_name = rb_String(font_name); - int font_num = c_register_font(RSTRING(font_name)->ptr); + int font_num = c_register_font(RSTRING_PTR(font_name)); return INT2FIX(font_num); } bool Used_Any_Fonts(void) { @@ -251,11 +251,11 @@ VALUE FM_marker_string_info(VALUE fmkr, VALUE font_number, VALUE string, VALUE scale) { // [ width, llx, lly, urx, ury ] in figure coords FM *p = Get_FM(fmkr); font_number = rb_Integer(font_number); string = rb_String(string); - unsigned char *text = (unsigned char *)(RSTRING(string)->ptr); + unsigned char *text = (unsigned char *)(RSTRING_PTR(string)); scale = rb_Float(scale); double ft_ht = p->default_text_scale * NUM2DBL(scale) * p->default_font_size * ENLARGE; int ft_height = ROUND(ft_ht); ft_ht = ft_height; double llx, lly, urx, ury, width; @@ -275,13 +275,10 @@ return result; } #define TRANSFORM_VEC(dx,dy) tmp = dx; dx = (dx) * a + (dy) * c; dy = tmp * b + (dy) * d; -/* This macro checks that it's a real number we're looking at */ -#define is_okay_number(x) ((x) - (x) == 0.0) - void c_rotated_string_at_points(FM *p, double rotation, int font_number, unsigned char *text, double scale, int n, double *xs, double *ys, int alignment, int justification, double horizontal_scaling, double vertical_scaling, double italic_angle, double ascent_angle) { double ft_ht = p->default_text_scale * scale * p->default_font_size * ENLARGE; @@ -401,10 +398,10 @@ prev_line_width = p->line_width; // restore it later fprintf(TF, "%0.6f w\n", width * ENLARGE); } } else { string = rb_String(string); - text = (unsigned char *)(RSTRING(string)->ptr); + text = (unsigned char *)(RSTRING_PTR(string)); } fprintf(TF, "%d Tr\n", mode); if (stroke_color != Qnil && stroke_color != p->stroke_color && (mode == STROKE || mode == FILL_AND_STROKE || mode == STROKE_AND_CLIP || mode == FILL_STROKE_AND_CLIP)) { prev_stroke_color = p->stroke_color; restore_stroke_color = true;