@@ -1437,15 +1437,15 @@ class AutoWidthChar(Hlist):
14371437 of some characters (such as the BaKoMa fonts), the correct glyph will
14381438 be selected, otherwise this will always just return a scaled version
14391439 of the glyph."""
1440- def __init__ (self , c , width , state , always = False ):
1440+ def __init__ (self , c , width , state , always = False , char_class = Char ):
14411441 alternatives = state .font_output .get_sized_alternatives_for_symbol (
14421442 state .font , c )
14431443
14441444 state = state .copy ()
14451445 big_enough = False
14461446 for fontname , sym in alternatives :
14471447 state .font = fontname
1448- char = Char (sym , state )
1448+ char = char_class (sym , state )
14491449 if char .width > width :
14501450 big_enough = True
14511451 break
@@ -1455,7 +1455,7 @@ def __init__(self, c, width, state, always=False):
14551455 if not big_enough :
14561456 factor = width / char .width
14571457 state .fontsize *= factor
1458- char = Char (sym , state )
1458+ char = char_class (sym , state )
14591459
14601460 Hlist .__init__ (self , [char ])
14611461
@@ -1969,12 +1969,15 @@ def accent(self, s, loc, toks):
19691969 raise ParseFatalException ("Error parsing accent" )
19701970 accent , sym = toks [0 ]
19711971 if accent in self ._wide_accents :
1972- accent = AutoWidthChar (accent , sym .width , state )
1972+ accent = AutoWidthChar (
1973+ accent , sym .width , state , char_class = Accent )
1974+ shift_amount = 0.
19731975 else :
19741976 accent = Accent (self ._accent_map [accent ], state )
1977+ shift_amount = accent ._metrics .xmin
19751978 centered = HCentered ([accent ])
19761979 centered .hpack (sym .width , 'exactly' )
1977- centered .shift_amount = accent . _metrics . xmin
1980+ centered .shift_amount = shift_amount
19781981 return Vlist ([
19791982 centered ,
19801983 Vbox (0. , thickness * 2.0 ),
0 commit comments