Cocoanetics / DTCoreText

Methods to allow using HTML code with CoreText
BSD 2-Clause "Simplified" License
6.34k stars 1.18k forks source link

The underlines of Chinese characters, English characters and symbols are not aligned #1242

Open jayden320 opened 3 years ago

jayden320 commented 3 years ago

The underlines of Chinese characters, English characters and symbols are not aligned <p><u>这里是/中文he/llo这里/是/中文</u></p>

This is a screenshot of using DTAttributedLabel

image

This is a screenshot of using UILabel

image

DTCoreText version: 1.6.26 System version: iOS15

BeingCode commented 2 years ago

I have the same problem

AndyLxl commented 2 years ago

原先划线用透明色或同背景色,重新再划线,我是这么处理的

ximmyxiao commented 2 years ago

There is a way to avoid this alignment , just replace the font from helvetica to pingfang

image

Here is the result after this change:

image