Reduce code block font point sizes by 10% on the new attributed string builder.

This commit is contained in:
Stefan Ceriu
2025-09-16 12:34:40 +03:00
committed by Stefan Ceriu
parent f8cca30164
commit cf9df8a8e1
5 changed files with 11 additions and 8 deletions
@@ -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))
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bbe5650088750690bb31a4aaedbbee8e087222f86bf563fd3cb57e1a82f31e5e
size 1106686
oid sha256:c5597aa7bd2475300acdbf32ff6bc5c0781ef773a4ccc9f50c93fed3f4d67378
size 1112093
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bbe5650088750690bb31a4aaedbbee8e087222f86bf563fd3cb57e1a82f31e5e
size 1106686
oid sha256:c5597aa7bd2475300acdbf32ff6bc5c0781ef773a4ccc9f50c93fed3f4d67378
size 1112093
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:52ad9c6b5db4c5e876ef28aa019a3a75395c00d606daf56b961a43f10c6ae378
size 1281081
oid sha256:c1ea06e567eb4549250863c7318003620a852d1144a993fd692500554c53bdb7
size 1266526
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:52ad9c6b5db4c5e876ef28aa019a3a75395c00d606daf56b961a43f10c6ae378
size 1281081
oid sha256:c1ea06e567eb4549250863c7318003620a852d1144a993fd692500554c53bdb7
size 1266526