add support for Ayatana indicator to Notification plugin
[claws.git] / src / plugins / litehtml_viewer / litehtml / el_font.cpp
blob3d5f6d9f73ea5556cc2eeaf5d6c8da15aaba0a40
1 #include "html.h"
2 #include "el_font.h"
5 litehtml::el_font::el_font(const std::shared_ptr<document>& doc) : html_tag(doc)
10 void litehtml::el_font::parse_attributes()
12 const char* str = get_attr("color");
13 if(str)
15 m_style.add_property(_color_, str, "", false, get_document()->container());
18 str = get_attr("face");
19 if(str)
21 m_style.add_property(_font_family_, str);
24 str = get_attr("size");
25 if(str)
27 int sz = atoi(str);
28 if(*str == '+' || *str == '-') sz = 3 + sz; // relative size
30 if(sz <= 1)
32 m_style.add_property(_font_size_, "x-small");
33 } else if(sz >= 6)
35 m_style.add_property(_font_size_, "xx-large");
36 } else
38 switch(sz)
40 case 2:
41 m_style.add_property(_font_size_, "small");
42 break;
43 case 3:
44 m_style.add_property(_font_size_, "medium");
45 break;
46 case 4:
47 m_style.add_property(_font_size_, "large");
48 break;
49 case 5:
50 m_style.add_property(_font_size_, "x-large");
51 break;
56 html_tag::parse_attributes();