You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! firstly, thank you for sharing this useful library.
I’m using this library to render LaTeX formulas in SwiftUI, and it’s working great overall. However, I’ve encountered an issue when rendering localized text (korean for me) text alongside formulas.
For example, when rendering something like Text("키를 입력하세요") (which means “Please enter height”) followed by a rendered LaTeX SVG image, the Korean text gets partially overlapped or clipped by the formula image.
After investigating, I suspect this might be due to how SVGGeometry handles the viewBox or vertical-align styles. It seems to work fine with Latin fonts, but Korean fonts typically have a larger x-height or vertical spacing, which results in the formula being rendered too low and interfering with the text.
Is there a recommended way to adjust for this — for example, by modifying the baseline offset when rendering SVGs next to languages like Korean that require more vertical space?
I've added two ways of addressing this with the v2.0.0 update:
If you include the prescriptive text in the LaTeX view like LaTeX("키를 입력하세요: $BMI=$") then you can use the .script(.cjk) modifier to properly adjust height in respect to baseline.
If you want to continue using a separate leading Text view, then you can use the .script(.custom(0.77)) to specify what multiple is applied to xHeight when drawing the view to match the text in adjacent view.
I hope this helps!! If there's anything that might work better please let me know.
Activity
Andrew-Jang commentedon Oct 21, 2025
Same problem
colinc86 commentedon Apr 3, 2026
I've added two ways of addressing this with the v2.0.0 update:
LaTeX("키를 입력하세요: $BMI=$")then you can use the.script(.cjk)modifier to properly adjust height in respect to baseline.Textview, then you can use the.script(.custom(0.77))to specify what multiple is applied to xHeight when drawing the view to match the text in adjacent view.I hope this helps!! If there's anything that might work better please let me know.