Closed oblank closed 2 years ago
🤔 That doesn't make much sense, as paragraphSeparator
is used to separate the paragraphs, not the lines inside a paragraph.
I will have a look, nevertheless. Thanks for reporting!
🤔 That doesn't make much sense, as
paragraphSeparator
is used to separate the paragraphs, not the lines inside a paragraph.I will have a look, nevertheless. Thanks for reporting!
It's confused,and if only english words, it seems there is no bug.
Thanks
I did a bit of research and it is related to paragraph styles, rather than the paragraph separator. That is, if there are paragraphs in the resulting attributed strings, then you get the weird differences in line spacing. I still have no clue on how to fix this one.
I did a bit of research and it is related to paragraph styles, rather than the paragraph separator. That is, if there are paragraphs in the resulting attributed strings, then you get the weird differences in line spacing. I still have no clue on how to fix this one.
get.
Thanks for your works.
To me, it looks like an iOS-only issue. Here is a screenshot of the Dingus example running in macOS:
I see a consistent line spacing that only differs a little when the line has mixed Latin and Chinese characters, which is expected.
finaly, I found this https://stackoverflow.com/questions/6367681/line-spacing-in-multi-language-layout-with-core-text
looks like it's not a bug, but a typesetting systems problem. and after some research I 'fix' it with some codes below
paragraphStyle.lineSpacing = 0.25 * font.pointSize
paragraphStyle.maximumLineHeight = font.lineHeight;
paragraphStyle.minimumLineHeight = font.lineHeight;
looks better.
Yeah, that makes sense as a workaround. But the default values in the paragraph style should work properly as well.
Hi @oblank, I have been testing this with MarkdownUI 1.0.0 (which comes with a new renderer), and I can't reproduce it. It displays the markdown you provided correctly in iOS 14, iOS 14.5, and iOS 15.0.
just like the screenshot
and the markedown text is:
I found the
static let paragraphSeparator = "\u{2029}"
caused this bug, if I set it to empty bystatic let paragraphSeparator = ""
, it looks okbut loose the paragraph's line height between