Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

需要自定义DTCoreTextParagraphStyle属性 #1283

Open
Gaozn opened this issue Sep 5, 2024 · 1 comment
Open

需要自定义DTCoreTextParagraphStyle属性 #1283

Gaozn opened this issue Sep 5, 2024 · 1 comment

Comments

@Gaozn
Copy link

Gaozn commented Sep 5, 2024

rt.

@vickyleu
Copy link

vickyleu commented Sep 6, 2024

You need to always ask questions in english, because GitHub is a global comprehensive community, To avoid consuming the maintainer's energy, We should all maintain good asking habits to facilitate more users with questions to find the same questions. you can also consider using my modified DTCoreText, which adds a public interface.

pod 'DTCoreText', :git => "https://github.com/vickyleu/DTCoreText.git"

I use kotlin multiplatform for development, you can change to swift or objective-c according to the open interface

 val stringBuilder = DTHTMLAttributedStringBuilder(
        hTML = data,
        options = options,
        documentAttributes = null
    )
    if(density!=null){
        //  表格处理
        stringBuilder.registerTagHandlers(tagHandlers = TableHandler(maxWidth, density).allHandlers())
        stringBuilder.registerTagHandlers(tagHandlers = listOf(MathHandler(maxWidth, density)))
        stringBuilder.registerTagHandlers(tagHandlers = listOf(Base64ImageHandler(maxWidth, density)))
        stringBuilder.registerTagHandlers(
            tagHandlers = listOf(
                PTagHandler(),
                ATagHandler(maxWidth),
                EmTextBlockHandler()
            )
        )
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants