0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【SwiftUI】フォントに関連する修飾子まとめ

Last updated at Posted at 2025-09-06

はじめに

Text()などで指定する.font().fontWeight()、ついでに.fontDesign()について、「結局どれが一番大きいのよ」というのを毎回調べるのが面倒だったので整理しました。
調べれば出てくるものではありますが、内容が古かったり、見たいものとは少し違っていたり・・・とにかく自分が見たいものを記事として残します。

環境

Xcode 16.4
Swift 6

font

font.png

  • 指定しないとbodyと同じサイズになる
  • headlineはサイズだけでなく文字の太さも変わっているように見える

fontWeight

fontWeight.png

  • 指定しないとregularと同じ太さになる

fontDesign + α

fontDesign.png

  • .fontDesign()と、似たような.monospacedDigit()をまとめて比較
  • 指定なしとdefaultnoneの違いがまったく分からない。roundedもよく見れば違うかもレベル

おわりに

  • すべてのフォントを「数字は等幅」で統一してほしいんですけど、そういう人って少数派なんですかね?
  • 個人的には「BIZ UDゴシック」がベスト。Windows標準フォントなので、ほとんどすべての端末で簡単に利用できる汎用性も素晴らしい
  • 「帳票 UDPゴシック」も良いが、システム開発における設計書は文章とコードを併記する場面が多いので、「BIZ UDゴシック」で統一してしまう方がいいかなと思う。プロポーショナルフォントで書かれた設計書の「.」が見えねぇ…

追記

  • 思いついたのでserif + monospaceDigitrounded + monospaceDigitを追加
  • ついでに指定なしを赤文字に変更
0
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?