PDA

View Full Version : Render Font on canvas problem



kyelin
09-19-2014, 03:27 AM
m_tex = clan::Texture2D(get_canvas(), 100,100);
m_fb = FrameBuffer(get_canvas());
m_fb.attach_color( 0, m_tex );
clan::Canvas canvas(get_canvas(), m_fb);
//canvas.fill_rect(Sizef(50.0f, 50.0f),Colorf::white);
m_font.draw_text(canvas,0,20, "test_string", Colorf::red);
m_img_text = clan::Image(m_tex, Rect(0,0,100,100));


Just as code show, if i don't add fill_rect ,m_img_text draw nothing, Unless clear canvas or fill groundback.

Judas
09-20-2014, 01:04 AM
You have to disable the subpixel rendering on the font to fix this problem.

kyelin
09-22-2014, 01:59 AM
I see, thks.:)