mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +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":
|
case "code", "pre":
|
||||||
let preserveFormatting = preserveFormatting || tag == "pre"
|
let preserveFormatting = preserveFormatting || tag == "pre"
|
||||||
content = attributedString(element: childElement, documentBody: documentBody, preserveFormatting: preserveFormatting, listTag: listTag, listIndex: &childIndex, indentLevel: indentLevel)
|
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.setFontPreservingSymbolicTraits(UIFont.monospacedSystemFont(ofSize: fontPointSize, weight: .regular))
|
||||||
|
|
||||||
content.addAttribute(.CodeBlock, value: true, range: NSRange(location: 0, length: content.length))
|
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))
|
content.addAttribute(.backgroundColor, value: UIColor.compound._bgCodeBlock as Any, range: NSRange(location: 0, length: content.length))
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:bbe5650088750690bb31a4aaedbbee8e087222f86bf563fd3cb57e1a82f31e5e
|
oid sha256:c5597aa7bd2475300acdbf32ff6bc5c0781ef773a4ccc9f50c93fed3f4d67378
|
||||||
size 1106686
|
size 1112093
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:bbe5650088750690bb31a4aaedbbee8e087222f86bf563fd3cb57e1a82f31e5e
|
oid sha256:c5597aa7bd2475300acdbf32ff6bc5c0781ef773a4ccc9f50c93fed3f4d67378
|
||||||
size 1106686
|
size 1112093
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:52ad9c6b5db4c5e876ef28aa019a3a75395c00d606daf56b961a43f10c6ae378
|
oid sha256:c1ea06e567eb4549250863c7318003620a852d1144a993fd692500554c53bdb7
|
||||||
size 1281081
|
size 1266526
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:52ad9c6b5db4c5e876ef28aa019a3a75395c00d606daf56b961a43f10c6ae378
|
oid sha256:c1ea06e567eb4549250863c7318003620a852d1144a993fd692500554c53bdb7
|
||||||
size 1281081
|
size 1266526
|
||||||
|
|||||||
Reference in New Issue
Block a user