Skip to content

Commit

Permalink
add Canvas support to set font size and weight
Browse files Browse the repository at this point in the history
  • Loading branch information
lcgamboa committed Jan 22, 2024
1 parent 21838bc commit 2133079
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/ccanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class CCanvas:public CObject
void SetFgColor (lxString color);
void SetFgColor (uint r, uint g, uint b);
void SetFont (wxFont font);
void SetFontSize (const int pointsize);
void SetFontWeight (const int weight);
wxColor GetFgColor (void);
/**
* Set Background Color by wxColor.
Expand Down
14 changes: 13 additions & 1 deletion lib/ccanvas.cc
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,19 @@ void
CCanvas::SetFont(wxFont font)
{
Font = font;
if (DC != NULL)DC->SetFont (font);
if (DC != NULL)DC->SetFont (Font);
}

void
CCanvas::SetFontSize (const int pointsize){
Font.SetPointSize(pointsize);
if (DC != NULL)DC->SetFont (Font);
}

void
CCanvas::SetFontWeight (const int weight){
Font.SetWeight((wxFontWeight)weight);
if (DC != NULL)DC->SetFont (Font);
}

void
Expand Down

0 comments on commit 2133079

Please sign in to comment.