<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTRubyAnnotationCreate(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTRubyAnnotationCreate"
  },
  "title" : "CTRubyAnnotationCreate(_:_:_:_:)"
}
-->

# CTRubyAnnotationCreate(_:_:_:_:)

Creates an immutable ruby annotation object.

```
func CTRubyAnnotationCreate(_ alignment: CTRubyAlignment, _ overhang: CTRubyOverhang, _ sizeFactor: CGFloat, _ text: UnsafeMutablePointer<Unmanaged<CFString>?>) -> CTRubyAnnotation
```

## Parameters

`alignment`

An alignment value that specifies how the ruby text and the base text align relative to each other.

`overhang`

An overhang value that specifies how the ruby text overhangs adjacent characters.

`sizeFactor`

A size factor that specifies the annotation text size as a percentage of the base text size.

`text`

An array of <doc://com.apple.documentation/documentation/CoreFoundation/CFString> objects, indexed by [`CTRubyPosition`](/documentation/CoreText/CTRubyPosition). Pass in `NULL` for any unused positions.

## Return Value

A reference to a [`CTRubyAnnotation`](/documentation/CoreText/CTRubyAnnotation) object.

## Discussion

Use this function to create a ruby annotation object in the most straightforward and efficient way.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)