[BUG] Problem with localized texts #1

Open
opened 2025-10-14 15:38:50 -06:00 by navan · 0 comments
Owner

Originally created by @yeahsilver on 7/7/2025

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?

Thank you in advance!

Image
*Originally created by @yeahsilver on 7/7/2025* 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? Thank you in advance! <img width="227" alt="Image" src="https://github.com/user-attachments/assets/6d17ac16-559d-45f2-a0a9-abc3985ca8e1" />
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/LaTeXSwiftUI#1
No description provided.