@@ -2287,24 +2287,26 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
2287
2287
}
2288
2288
self .file ._annotations [- 1 ][1 ].append (link_annotation )
2289
2289
2290
- # If fonttype != 3 or there are no multibyte characters, emit the whole
2291
- # string at once .
2292
- if fonttype != 3 or all ( ord ( char ) <= 255 for char in s ) :
2290
+ # If fonttype != 3 emit the whole string at once without manual
2291
+ # kerning .
2292
+ if fonttype != 3 :
2293
2293
self .file .output (Op .begin_text ,
2294
2294
self .file .fontName (prop ), fontsize , Op .selectfont )
2295
2295
self ._setup_textpos (x , y , angle )
2296
- self .file .output (self .encode_string (s , fonttype ), Op . show ,
2297
- Op .end_text )
2296
+ self .file .output (self .encode_string (s , fonttype ),
2297
+ Op .show , Op . end_text )
2298
2298
2299
2299
# There is no way to access multibyte characters of Type 3 fonts, as
2300
2300
# they cannot have a CIDMap. Therefore, in this case we break the
2301
2301
# string into chunks, where each chunk contains either a string of
2302
- # consecutive 1-byte characters or a single multibyte character. Each
2303
- # chunk is emitted with a separate command: 1-byte characters use the
2304
- # regular text show command (Tj), whereas multibyte characters use
2305
- # the XObject command (Do). (If using Type 42 fonts, all of this
2306
- # complication is avoided, but of course, those fonts can not be
2307
- # subsetted.)
2302
+ # consecutive 1-byte characters or a single multibyte character.
2303
+ # A sequence of 1-byte characters is broken into multiple chunks to
2304
+ # adjust the kerning between adjacent chunks. Each chunk is emitted
2305
+ # with a separate command: 1-byte characters use the regular text show
2306
+ # command (TJ) with appropriate kerning between chunks, whereas
2307
+ # multibyte characters use the XObject command (Do). (If using Type
2308
+ # 42 fonts, all of this complication is avoided, but of course, those
2309
+ # fonts can not be subsetted.)
2308
2310
else :
2309
2311
# List of (start_x, [prev_kern, char, char, ...]), w/o zero kerns.
2310
2312
singlebyte_chunks = []
0 commit comments