Skip to content

Commit

Permalink
declare font and size for drawing text
Browse files Browse the repository at this point in the history
  • Loading branch information
glurp committed Sep 25, 2017
1 parent 329f0fc commit 948ecf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ruiby_gtk/dsl/canvas.rb
Expand Up @@ -151,6 +151,13 @@ def cv.draw_varbarr(x0,y0,x1,y1,dmin,dmax,lvalues0,width,&b)
w.draw_line(lxy,color, width) if color
}
end
def cv.ctx_font(name,size)
w,cr=@currentCanvasCtx
fd=Pango::FontDescription.new(name)
cr.select_font_face(fd.family, Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL)
cr.set_font_size(size)
end

def cv.draw_text_left(x,y,text,scale=1,color=nil,bgcolor=nil)
w,cr=@currentCanvasCtx
cr.set_line_width(1)
Expand Down

0 comments on commit 948ecf1

Please sign in to comment.