[iOS] Text and TextInput clip descenders and add extra space below the selection with fontFamily "Hiragino Sans"
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- ios, objective-c, react-native, swift
調査の方向性
Start by comparing iOS text layout for Text and single-line and multiline TextInput with Hiragino Sans against the system font, using the linked reproducer and the listed simulator steps. Investigate the iOS text layout implementation; the issue does not name specific source files or tests. Done means descenders are no longer clipped and multiline selection height matches the glyphs without changing system-font behavior.
索引モデルが issue の本文から書いたものです。
説明
Description
When fontFamily: 'Hiragino Sans' is used on iOS, text layout height appears to be too small for the font's descenders:
- Single-line
TextInput(both value and placeholder) clips descenders such asj,p,q,g,yat the bottom edge. Textclips descenders in the same way.- In a multiline
TextInput, the selection highlight extends well below the glyphs (each highlighted line is about 1.25x taller than with the system font).
None of these happen with the default system font (San Francisco).
This is a follow-up to #56123, which was closed automatically for missing version info. This report reproduces it on the latest stable release (0.88.1) with a reproducer based on the community template.
Steps to reproduce
- Clone the reproducer and run it on an iOS simulator (
npm install,cd ios && bundle install && bundle exec pod install,npx react-native run-ios). - The screen shows a single-line TextInput (value), a single-line TextInput (placeholder), a Text, and a focused multiline TextInput with all text selected, all using
fontFamily: 'Hiragino Sans'andfontSize: 16. - Observe that descenders are clipped in the single-line TextInputs and the Text, and that the selection highlight in the multiline TextInput extends below the glyphs.
- Tap "Switch to System" to compare with the default font. Neither problem occurs.
React Native Version
0.88.1
Affected Platforms
Runtime - iOS, Build - MacOS
Output of npx @react-native-community/cli info
System:
OS: macOS 26.6.1
CPU: (8) arm64 Apple M2
Memory: 134.11 MB / 24.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 26.0.0
path: /Users/matsumotoryouta/.anyenv/envs/nodenv/versions/26.0.0/bin/node
Yarn:
version: 1.22.22
path: /Users/matsumotoryouta/.anyenv/envs/nodenv/versions/26.0.0/bin/yarn
npm:
version: 11.12.1
path: /Users/matsumotoryouta/.anyenv/envs/nodenv/versions/26.0.0/bin/npm
Watchman:
version: 2024.06.24.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.5
- iOS 26.5
- macOS 26.5
- tvOS 26.5
- visionOS 26.5
- watchOS 26.5
Android SDK:
API Levels:
- "28"
- "31"
- "33"
- "34"
- "35"
- "36"
Build Tools:
- 30.0.2
- 30.0.3
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 35.0.0
- 36.0.0
System Images:
- android-31 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9862592
Xcode:
version: 26.6/17F113
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.11
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /Users/matsumotoryouta/.anyenv/envs/rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.2.0
wanted: 20.2.0
react:
installed: 19.3.0
wanted: 19.3.0
react-native:
installed: 0.88.1
wanted: 0.88.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
N/A. This is a visual layout issue and no error or warning is logged.
MANDATORY Reproducer
https://github.com/ryota0222/rn-hiragino-repro
Screenshots and Videos
Tested on iPhone 15 Pro Max (iOS 18.1) and iPhone 17 Pro (iOS 26.5) simulators.
| Hiragino Sans | System font |
|---|---|
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.5k
- 平均マージ
- 3日 18時間
- マージ済み PR(30日)
- 188
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
react/react-native のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
react/react-native#59945 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
react/react-native#59944 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
react/react-native#59942 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
react/react-native#59939 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
react/react-native#59929 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
react/react-native の issue をすべて見る
似ている issue
-
backlog
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EchoTools/nevr-runtime#2385 ·
メンテナーはふだん 1 日以内に返信
-
type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
tensorflow/tflite-micro#3995 ·
メンテナーはふだん 1 日以内に返信
-
CPU update 1.31xオープンspeed-report
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
mw00/project-maya#961 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
not for AI lovers
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信