mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Reduce code block font point sizes by 10% on the new attributed string builder.
This commit is contained in:
committed by
Stefan Ceriu
parent
f8cca30164
commit
cf9df8a8e1
@@ -174,7 +174,10 @@ struct AttributedStringBuilderV2: AttributedStringBuilderProtocol {
|
||||
case "code", "pre":
|
||||
let preserveFormatting = preserveFormatting || tag == "pre"
|
||||
content = attributedString(element: childElement, documentBody: documentBody, preserveFormatting: preserveFormatting, listTag: listTag, listIndex: &childIndex, indentLevel: indentLevel)
|
||||
|
||||
let fontPointSize = fontPointSize * 0.9 // Intentionally shrink code blocks by 10%
|
||||
content.setFontPreservingSymbolicTraits(UIFont.monospacedSystemFont(ofSize: fontPointSize, weight: .regular))
|
||||
|
||||
content.addAttribute(.CodeBlock, value: true, range: NSRange(location: 0, length: content.length))
|
||||
content.addAttribute(.backgroundColor, value: UIColor.compound._bgCodeBlock as Any, range: NSRange(location: 0, length: content.length))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user