beeware / beeware/toga

Small caps support in iOS?

Open
#3,549 1 comment 0 reactions 0 assignees View on GitHub
enhancement iOS
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
9h 45m
Merged PRs (30d)
58

Description

### What is the problem or limitation you are having?

While poking around in the font backends, I noticed that while macOS checks for small caps:

https://github.com/beeware/toga/blob/a4f6b95e1704f711e87f6a63561a074c7c77e976/cocoa/src/toga_cocoa/fonts.py#L110-L123

iOS doesn't:

https://github.com/beeware/toga/blob/a4f6b95e1704f711e87f6a63561a074c7c77e976/iOS/src/toga_iOS/fonts.py#L109-L120

And it's ignored in test probe as well.

https://github.com/beeware/toga/blob/a4f6b95e1704f711e87f6a63561a074c7c77e976/iOS/tests_backend/fonts.py#L38-L49

I see from the docs that there is indeed no corresponding `UIFontDescriptorSmallCaps`. Although there is [`kLowerCaseType`](https://developer.apple.com/documentation/coretext/klowercasetype?language=objc). Is it possible to use that to support small caps?

### Describe the solution you'd like

Ideally, we'd support small caps on every (possible) platform.

### Describe alternatives you've considered

Leave it as is, I suppose.

### Additional context

I don't understand much about the macOS or iOS font systems (yet...), but some [cursory searching](https://stackoverflow.com/questions/12941984/typesetting-a-font-in-small-caps-on-ios) indicates that, at least for fonts that support it, small caps is possible on iOS.

Contributor guide

Open the contributing guide

Research direction

Compare the small-caps handling in cocoa/src/toga_cocoa/fonts.py with iOS/src/toga_iOS/fonts.py, then inspect iOS/tests_backend/fonts.py and the linked CoreText documentation. Determine whether kLowerCaseType can provide the requested behavior on iOS, and update the backend and font test probe if it can. Done means iOS supports small caps where possible and the probe covers the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, macos, python
Domain
desktop-dev, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.