void SetFontStyle(wxFont &font, MadFontStyles fs)
{
    if((fs&fsBold)!=0)  font.SetWeight(wxFONTWEIGHT_BOLD);
    else                font.SetWeight(wxFONTWEIGHT_NORMAL);
    if((fs&fsItalic)!=0) font.SetStyle(wxFONTSTYLE_ITALIC);
    else                 font.SetStyle(wxFONTSTYLE_NORMAL);
    font.SetUnderlined((fs&fsUnderline)!=0);
}
예제 #2
0
/// Initializes a wxFont object using the FontSetting data
/// @param font wxFont object to initialize
void FontSetting::GetFont(wxFont& font) const
{
    //------Last Checked------//
    // - Dec 6, 2004
    font.SetPointSize(GetPointSize());
    font.SetFamily(wxDEFAULT);
    font.SetStyle(((IsItalic()) ? wxITALIC : wxNORMAL));
    
    if (m_weight <= weightLight)
        font.SetWeight(wxLIGHT);
    else if (m_weight < weightBold)
        font.SetWeight(wxNORMAL);
    else
        font.SetWeight(wxBOLD);
    font.SetUnderlined(IsUnderline());
    font.SetFaceName(GetFaceName());
}