Created
May 8, 2020 16:39
-
-
Save Koze/e32b833b2150313f4637414b2b76da0d to your computer and use it in GitHub Desktop.
Japanese font without Japanese character causes the clip at the bottom. A quick workaround.
This file contains hidden or 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
import SwiftUI | |
struct SmapleView: View { | |
let font = Font.custom("HiraginoSans-W3", size: 50) | |
let uiFont = UIFont(name: "HiraginoSans-W3", size: 50)! | |
let borderColor = Color(.systemBlue) | |
var body: some View { | |
HStack(spacing: 10) { | |
Text("Copy") | |
.font(font) | |
.border(borderColor) | |
Text("Copy") | |
.font(font) | |
.baselineOffset(-uiFont.descender) | |
.border(borderColor) | |
} | |
} | |
} | |
struct SmapleView_Previews: PreviewProvider { | |
static var previews: some View { | |
SmapleView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/Koze/6a987981ae2d68a1d71d9d21cf77b0e6
https://gist.github.com/Koze/17050bcdab3e578aff993f193e27a45a
https://gist.github.com/Koze/e32b833b2150313f4637414b2b76da0d ←
https://gist.github.com/Koze/52e7cce4dac069592fbcfdeca4d2ec97
https://gist.github.com/Koze/376b0ff231107569f073f026eac2e688
https://gist.github.com/Koze/bd1285ab6471528e3e22cd8de3d64804