FB10978412 Demo App (SwiftUI)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// FB10978412: Since macOS 11 Big Sur, CTFontCreateUIFontForLanguage cannot | |
/// distinguish zh-Hans and zh-Hant with correct adoptation of proper PingFang SC/TC variants. | |
import SwiftUI | |
@main | |
struct FB10978412App: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
} | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
List { | |
Group { | |
Text("骨 zh-Hans").font(.init(CTFontCreateUIFontForLanguage(.system, 18, "zh-Hans" as CFString)!)) | |
Text("骨 zh-Hant").font(.init(CTFontCreateUIFontForLanguage(.system, 18, "zh-Hant" as CFString)!)) | |
Text("骨 ja").font(.init(CTFontCreateUIFontForLanguage(.system, 18, "ja" as CFString)!)) | |
} | |
} | |
} | |
.padding() | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment