Fix font size in xhtml
This commit is contained in:
parent
09962db66a
commit
554c3694c8
1 changed files with 16 additions and 7 deletions
|
@ -337,14 +337,23 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
|
||||||
|
|
||||||
def _parse_style_font_size(self, tag, value):
|
def _parse_style_font_size(self, tag, value):
|
||||||
try:
|
try:
|
||||||
|
# see http://developer.gnome.org/pango/stable/pango-Text-Attributes.html#PANGO-SCALE-XX-SMALL:CAPS
|
||||||
|
# http://consciouslyusing.blogspot.ru/2012/01/heads-up-missing-pango-text-scale.html
|
||||||
scale = {
|
scale = {
|
||||||
'xx-small': Pango.SCALE_XX_SMALL,
|
#'xx-small': Pango.SCALE_XX_SMALL,
|
||||||
'x-small': Pango.SCALE_X_SMALL,
|
#'x-small': Pango.SCALE_X_SMALL,
|
||||||
'small': Pango.SCALE_SMALL,
|
#'small': Pango.SCALE_SMALL,
|
||||||
'medium': Pango.SCALE_MEDIUM,
|
#'medium': Pango.SCALE_MEDIUM,
|
||||||
'large': Pango.SCALE_LARGE,
|
#'large': Pango.SCALE_LARGE,
|
||||||
'x-large': Pango.SCALE_X_LARGE,
|
#'x-large': Pango.SCALE_X_LARGE,
|
||||||
'xx-large': Pango.SCALE_XX_LARGE,
|
#'xx-large': Pango.SCALE_XX_LARGE,
|
||||||
|
'xx-small': 0.5787037037037,
|
||||||
|
'x-small': 0.6444444444444,
|
||||||
|
'small': 0.8333333333333,
|
||||||
|
'medium': 1.0,
|
||||||
|
'large': 1.2,
|
||||||
|
'x-large': 1.4399999999999,
|
||||||
|
'xx-large': 1.728,
|
||||||
} [value]
|
} [value]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue