File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -65,16 +65,20 @@ struct MonospacedText: View {
6565 init ( _ text: String ) { self . text = text }
6666
6767 var body : some View {
68- let renderer = ImageRenderer (
69- content: Text ( text)
70- . font ( . system( . largeTitle, design: . monospaced) )
71- . foregroundStyle ( colorScheme == . light ? Color . black : Color . white)
72- )
73- if let cgImage = renderer. cgImage {
74- // Using scale: 1 results in a blurry image for unknown reasons
75- Image ( cgImage, scale: 2 , label: Text ( text) )
68+ if #available( macOS 14 , * ) { // https://github.com/nikitabobko/AeroSpace/issues/1122
69+ let renderer = ImageRenderer (
70+ content: Text ( text)
71+ . font ( . system( . largeTitle, design: . monospaced) )
72+ . foregroundStyle ( colorScheme == . light ? Color . black : Color . white)
73+ )
74+ if let cgImage = renderer. cgImage {
75+ // Using scale: 1 results in a blurry image for unknown reasons
76+ Image ( cgImage, scale: 2 , label: Text ( text) )
77+ } else {
78+ // In case image can't be rendered fallback to plain text
79+ Text ( text)
80+ }
7681 } else {
77- // In case image can't be rendered fallback to plain text
7882 Text ( text)
7983 }
8084 }
You can’t perform that action at this time.
0 commit comments