    # File lib/rvg/misc.rb, line 139
                    def shift_baseline(glyph_orientation, glyph)
                        glyph_dimensions = @ctx.shadow.get_type_metrics(glyph)
                        if glyph_orientation == 0 || glyph_orientation == 180
                            x = glyph_dimensions.width
                        else
                            x = glyph_dimensions.ascent - glyph_dimensions.descent
                        end
                        case @ctx.text_attrs.baseline_shift
                            when :baseline
                                x = 0
                            when :sub
                                ;
                            when :super
                                x = -x
                            when /[-+]?(\d+)%/
                                m = $1 == '-' ? -1.0 : 1.0
                                x = (m * x * $1.to_f / 100.0)
                            else
                                x = -@ctx.text_attrs.baseline_shift
                        end
                        return x
                    end