These are chat archives for jheinen/GR.jl

25th
Jul 2016
Tom Breloff
@tbreloff
Jul 25 2016 19:45
@jheinen what's the difference between these methods:
function gr_inqtext(x, y, s)
    if length(s) >= 2 && s[1] == '$' && s[end] == '$'
        GR.inqtextext(x, y, s[2:end-1])
    elseif search(s, '\\') != 0 || search(s, '_') != 0 || search(s, '^') != 0
        GR.inqtextext(x, y, s)
    else
        GR.inqtext(x, y, s)
    end
end

function gr_text(x, y, s)
    if length(s) >= 2 && s[1] == '$' && s[end] == '$'
        GR.mathtex(x, y, s[2:end-1])
    elseif search(s, '\\') != 0 || search(s, '_') != 0 || search(s, '^') != 0
        GR.textext(x, y, s)
    else
        GR.text(x, y, s)
    end
end
Josef Heinen
@jheinen
Jul 25 2016 20:09
@tbreloff , inqtext returns the bounding box of the given text (tbx[4],tby[4]), text() draws the text.
The inqtext() function for mathtex() (LaTeX formatted string) is not yet implemented ... :-(