Text bug

I came across this curious bug. Run the small program below. It shows an ‘a’ and a ‘b’. Now comment out (or delete) the ‘text(“b”,…’, and run again. The ‘a’ is also gone! Now change the ‘a’ to something else. It shows up again. Looks like you can’t use the letter ‘a’ in ‘text’ anymore! This bug seems to be connected with the use of ‘text’ within the ‘setContext’ in the setup. Apparently if you use the same string in ‘text’ on an image using ‘setContext’ that string can not be shown anymore with ‘text’!

Can anyone confirm what I’m seeing? Thanks!

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")
    local img=image(30,60)
    setContext(img)
    font("Arial-BoldMT")
    fontSize(48)
    text("a",0,0)
    setContext()
    img=image(30,60)
    setContext(img)
    font("Arial-BoldMT")
    fontSize(48)
    text("a",0,0)
    setContext()
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(0, 0, 0, 255)

    -- This sets the line thickness
    strokeWidth(5)

    -- Do your drawing here
    font("Arial-BoldMT")
    fontSize(48)
    text("a",WIDTH/2,HEIGHT/2)
    text("b",WIDTH/2,HEIGHT/2-60)
end


Thanks for reporting this. Could you lodge this as an issue on the tracker (with your example code)? That would be really helpful — http://bitbucket.org/TwoLivesLeft/codea/issues

I think I know what’s causing it.

Done. I’m curious but too difficult to explain I guess?