Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Typography: Inconsistent Ligature Rendering #2545

Open
coston opened this issue Nov 19, 2024 · 2 comments
Open

iOS Typography: Inconsistent Ligature Rendering #2545

coston opened this issue Nov 19, 2024 · 2 comments

Comments

@coston
Copy link

coston commented Nov 19, 2024

Description

Screenshot 2024-11-19 at 14 58 30

Behavior: react-native-svg Text components render undesired ligatures in iOS, but does not in Android or Web.
Expected behavior: Text renders the text passed to it and is the same across iOS, Android, and Web.

Steps to reproduce

  1. Use a font that has good ligatures support, such as Roboto.
  2. Render svg Text キロ, メートル coston in iOS, web, and Android
  3. 🎯 Notice that in iOS, the japanese text is collapsed into a combined character, and in Coston, the s and t are combined. These are not the correct values.

Snack or a link to a repository

https://github.com/coston/react-native-svg-victory-2912

SVG version

15.9.0

React Native version

0.76.2

Platforms

iOS

Workflow

Expo Dev Client

Device

iOS simulator

Device model

iPhone SE (3rd Generation) iOS 18.1

Acknowledgements

Yes

@coston
Copy link
Author

coston commented Nov 19, 2024

This issue was first seen in FormidableLabs/victory#2912

@coston
Copy link
Author

coston commented Nov 21, 2024

The goal is for iOS to not show discretionary ligatures, by default, which is the normal iOS setting. Android is not showing discretionary ligatures.

For some reason, setting the iOS NSLigatureAttributeName value to 1 in react-native-svg code still renders discretionary ligatures (2). I'm not sure what i'm overlooking in this case.

For anyone following along, I have a demo of how the NSLigatureAttributeName values render ligatures here: https://github.com/coston/NSLigatureAttributeName-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant