apple-text-core-text

Expose Core Text APIs for glyph-level rendering and hit-testing on iOS and macOS.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sitapix/apple-text --skill apple-text-core-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-text-core-text
Source: https://github.com/sitapix/apple-text/tree/main/skills/apple-text-core-text
Command: npx skills add https://github.com/sitapix/apple-text --skill apple-text-core-text

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides direct access to Core Text APIs for glyph-level control when TextKit 2 lacks glyph APIs, enabling custom typesetting, font table inspection, per-glyph rendering, and robust hit-testing across Apple platforms.

Core Features & Use Cases

  • Access and inspect glyph metrics, positions, and bounds using CTLine, CTRun, and related APIs for fine-grained rendering.
  • Retrieve font metrics, OpenType features, and font tables via CTFont for custom typography pipelines.
  • Implement advanced layout and hit-testing with Core Text in scenarios where TextKit 2 APIs are insufficient.
  • Bridge font interoperability between UIFont/NSFont and CTFont on iOS/macOS.

Quick Start

Ask it to show how to compute per-glyph positions using CTLine and CTRun for an attributed string.

Frequently Asked Questions about apple-text-core-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get glyph-level metrics and positions when TextKit 2 lacks glyph APIs?

To get glyph-level metrics and positions when TextKit 2 lacks glyph APIs, use Core Text APIs like CTLine and CTRun. These allow you to inspect per-glyph bounds and compute precise positions for an attributed string during custom typesetting.

Can I access OpenType features and font tables using CTFont on iOS and macOS?

Yes, you can access OpenType features and font tables using CTFont on iOS and macOS. Core Text allows you to retrieve detailed font metrics and inspect font tables directly for custom typography pipelines, bridging with UIFont or NSFont as needed.

What's the best way to implement precise hit-testing for custom text layouts?

The best way to implement precise hit-testing for custom text layouts is by applying Core Text APIs. Using CTFrame, CTLine, and CTRun provides robust hit-testing capabilities across Apple platforms where TextKit 2 APIs are insufficient.

When do I need Core Text instead of TextKit 2 for custom typesetting?

You need Core Text instead of TextKit 2 for custom typesetting when you require direct access to glyph-level rendering, font table inspection, or per-glyph positioning. Core Text exposes these low-level APIs which TextKit 2 does not provide.

How do I bridge UIFont or NSFont to CTFont for custom rendering?

To bridge UIFont or NSFont to CTFont for custom rendering, you utilize Core Text interoperability functions. This bridging allows you to pass standard UIKit or AppKit font objects into Core Text pipelines to maintain consistent font metrics across iOS and macOS.

Does Core Text support per-glyph rendering across iOS and macOS?

Yes, Core Text supports per-glyph rendering across iOS and macOS. By leveraging CTLine, CTRun, and CTFrame, you can achieve fine-grained rendering control and inspect individual glyph bounds for your custom text rendering scenarios.