Myanmar Language font changed after iOS 18.4

I am developing iOS App using SwiftUI and I notice that Myanmar font of number text on 18.4 have clipped on top and bottom. Does anyone have this issues and know the fix? I have provided the Screenshot also.

Answered by DTS Engineer in 833250022

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem. Also, please include the information you have provided in this forums post. Please post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

It would help to see the relevant code for this, as it might be that something related to something you've coded has changed between the two versions.

I notice you have 18.2 and 18.4. Is it broken on 18.3, too?

This is my code and I haven't changed it. This is used to run on both 18.2 and 18.4. Also it didn't happened on 18.3. I have provided a screenshot also.

struct PracticeScreen: View {
@EnvironmentObject private var vm: HomeViewModel
@AppStorage("count") private var count = 0
@AppStorage("round") private var round = 0
@State private var showDialog = false
@State private var showComplete = false
private let totalCount = 108
var body: some View {
ZStack {
Color(UIColor.systemGroupedBackground)
.ignoresSafeArea()
if case .active = vm.status, !vm.todayCompleted {
VStack {
Text(vm.currentPrayer?.day.desc ?? "")
.font(.title3)
.fontWeight(.medium)
.foregroundStyle(.accent)
.padding(.bottom, 4)
Text(vm.currentPrayer?.mantra ?? "")
.lineLimit(2, reservesSpace: true)
.multilineTextAlignment(.center)
.font(.system(size: 40, weight: .bold, design: .rounded))
Spacer()
// clipped number text
Text("\(count.toMyanmarDigits())")
.font(.system(size: 40, weight: .bold, design: .rounded))
.monospaced()
.foregroundStyle(.accent)
Button {
addCount()
} label: {
ZStack {
Circle()
.stroke(.accent, lineWidth: 10)
.frame(width: 250, height: 250)
Circle()
.fill(
.accent.opacity(0.5)
)
.frame(width: 230, height: 230)
Text("Count")
.font(.system(size: 36, weight: .bold))
.foregroundStyle(.accent)
}
}
.buttonStyle(PressableButtonStyle())
Spacer()
HStack(spacing: 20) {
Text("အပတ်ရေ: \(round.toMyanmarDigits()) /\((vm.currentPrayer?.rounds ?? 0).toMyanmarDigits())")
.font(.footnote)
.foregroundStyle(.white)
.padding(.horizontal, 10)
.padding(.vertical, 12)
.frame(maxWidth: .infinity)
.background(
Capsule()
.fill(.accent)
)
Button {
showDialog.toggle()
} label: {
Image(systemName: "arrow.clockwise")
.font(.footnote)
.foregroundStyle(.white)
.padding(12)
.background(
Circle()
.fill()
)
}
Text("Count: \(count.toMyanmarDigits()) /\(totalCount.toMyanmarDigits())")
.font(.footnote)
.foregroundStyle(.white)
.padding(.horizontal, 10)
.padding(.vertical, 12)
.frame(maxWidth: .infinity)
.background(
Capsule()
.fill(.accent)
)
}
}
.padding()
.padding(.bottom)
} else {
NoticeCard(status: vm.status)
}
}
.confirmationDialog("အဓိဌာန် အစမှ ပြန်စမလား?", isPresented: $showDialog, titleVisibility: .visible) {
Button("အစမှ ပြန်စမည်။", role: .destructive, action: resetCount)
Button("မလုပ်တော့ပါ", role: .cancel, action: {})
}
.alert("ဒီနေ့ အဓိဌာန် ပြီးဆုံးပါပြီ", isPresented: $showComplete) {
Button("ပြီးဆုံးပါပြီ") {
vm.markTodayComplete()
}
Button("မလုပ်တော့ပါ", role: .destructive, action: {})
}
.navigationTitle("ဒီနေ့ အဓိဌာန်")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
if case .active = vm.status, !vm.todayCompleted {
ToolbarItem(placement: .topBarTrailing) {
Button("ပြီးဆုံးပါပြီ") {
showComplete.toggle()
}
}
}
}
}
}

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem. Also, please include the information you have provided in this forums post. Please post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

What happens if you set the frame height ?

Text("\(count.toMyanmarDigits())")
.frame(height: 50) // or even 60
.font(.system(size: 40, weight: .bold, design: .rounded))
.monospaced()
.foregroundStyle(.accent)

Unfortunately setting the frame height to 60 or may be 100 doesn't fix it. It still clipped the Myanmar's number both on top and bottom.

The problem could come from the baseline offset:

https://stackoverflow.com/questions/69760382/how-do-i-fix-clipped-ascenders-and-descenders-in-a-custom-font

See more here: https://medium.com/mobimeo-technology/what-if-your-designers-want-a-baseline-grid-on-ios-d5234c7b52c0

Here on how to change offset (through attributes): https://developer.apple.com/forums/thread/124799

Why did it change in iOS 18.4 is another question…

Myanmar Language font changed after iOS 18.4
 
 
Q