dwarvesf / CodeViewer

A custom code editor SwiftUI view
MIT License
145 stars 18 forks source link

Fix font size and add line height #13

Open gewill opened 1 year ago

gewill commented 1 year ago

What's this PR do?

Here is an example, how set CodeViewer height:

   CodeViewer(content: .constant(code), mode: CodeWebView.Mode(rawValue: configuration.language ?? "") ?? .text, darkTheme: .tomorrow_night_eighties, lightTheme: .tomorrow, isReadOnly: true, fontSize: 14, lineHeight: 1.3)
          .frame(height: CGFloat(code.components(separatedBy: .newlines).count) * 14 * 1.3)