@@ -288,11 +288,11 @@ def _parse_attrs(self, attrs):
288
288
except :
289
289
pass
290
290
elif k in (
291
- HTML .Attrs .HREF ,
292
- HTML .Attrs .SRC ,
293
- HTML .Attrs .WIDTH ,
294
- HTML .Attrs .HEIGHT ,
295
- HTML .Attrs .TYPE ,
291
+ HTML .Attrs .HREF ,
292
+ HTML .Attrs .SRC ,
293
+ HTML .Attrs .WIDTH ,
294
+ HTML .Attrs .HEIGHT ,
295
+ HTML .Attrs .TYPE ,
296
296
):
297
297
attrs_dict [k ] = v
298
298
return attrs_dict
@@ -646,8 +646,8 @@ def handle_data(self, data):
646
646
data = f"{ data } " # FIXME: attaching a space in blind is wrong
647
647
data = self ._remove_multi_spaces (data )
648
648
if len (self .html_tags ) and self .html_tags [- 1 ] in (
649
- HTML .Tag .UL ,
650
- HTML .Tag .OL ,
649
+ HTML .Tag .UL ,
650
+ HTML .Tag .OL ,
651
651
):
652
652
self ._w .insert (tk .INSERT , "\t " * 2 * len (self .list_tags ))
653
653
@@ -712,12 +712,15 @@ def _w_tags_apply_all(self):
712
712
713
713
# add tags
714
714
self .hlink_slots = []
715
+ default_font_scaling = int (self .default_font .actual ("size" )) / 9
715
716
for key , tag in self ._w_tags .items ():
716
717
if "config" in tag : # HF change justify to left for tkinter (only supports left, right, center)
717
718
if tag ["config" ].get ("justify" ) == "justify" :
718
719
tag ["config" ]["justify" ] = "left"
719
720
self ._w .tag_add (key , tag [WTag .START_INDEX ], tag [WTag .END_INDEX ])
720
721
tag_font = self .default_font .copy () if self .default_font is not None else font .Font ()
722
+ if "size" in tag [Fnt .KEY ]:
723
+ tag [Fnt .KEY ]["size" ] = int (default_font_scaling * tag [Fnt .KEY ]["size" ])
721
724
tag_font .config (** tag [Fnt .KEY ])
722
725
self ._w .tag_config (key , font = tag_font , selectforeground = self .default_selectforeground ,
723
726
selectbackground = self .default_selectbackground , ** tag [WCfg .KEY ])
0 commit comments