---
title: "CTRubyAnnotationCreateWithAttributes(_:_:_:_:_:)"
framework: Core Text
role: symbol
role_heading: Function
platforms: [iOS 10.0+, iPadOS 10.0+, Mac Catalyst 13.1+, macOS 10.12+, tvOS 10.0+, visionOS 1.0+, watchOS 3.0+]
path: "coretext/ctrubyannotationcreatewithattributes(_:_:_:_:_:)"
---

# CTRubyAnnotationCreateWithAttributes(_:_:_:_:_:)

Creates an immutable ruby annotation object with the specified attributes.

## Declaration

```swift
func CTRubyAnnotationCreateWithAttributes(_ alignment: CTRubyAlignment, _ overhang: CTRubyOverhang, _ position: CTRubyPosition, _ string: CFString, _ attributes: CFDictionary) -> 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.
- `position`: The position of the annotation text.
- `string`: An unformatted string whose attributes derive from the attributes parameter.
- `attributes`: An attribute dictionary to combine with string. If you don’t specify doc://com.apple.coretext/documentation/CoreText/kCTFontAttributeName, the system deduces the ruby annotation’s font from the base text and uses a size factor of the doc://com.apple.documentation/documentation/CoreFoundation/CFNumber value keyed by doc://com.apple.coretext/documentation/CoreText/kCTRubyAnnotationSizeFactorAttributeName.

## Return Value

Return Value A reference to a CTRubyAnnotation object.

## Discussion

Discussion Use this function to create a ruby annotation object with more precise control of the annotation text.

## See Also

### Functions

- [CTFontDescriptorMatchFontDescriptorsWithProgressHandler(_:_:_:)](coretext/ctfontdescriptormatchfontdescriptorswithprogresshandler(_:_:_:).md)
- [CTFontManagerCompareFontFamilyNames(_:_:_:)](coretext/ctfontmanagercomparefontfamilynames(_:_:_:).md)
- [CTFontManagerCopyAvailableFontFamilyNames()](coretext/ctfontmanagercopyavailablefontfamilynames().md)
- [CTFontManagerCopyAvailableFontURLs()](coretext/ctfontmanagercopyavailablefonturls().md)
- [CTFontManagerCopyAvailablePostScriptNames()](coretext/ctfontmanagercopyavailablepostscriptnames().md)
- [CTFontManagerCreateFontDescriptorFromData(_:)](coretext/ctfontmanagercreatefontdescriptorfromdata(_:).md)
- [CTFontManagerCreateFontDescriptorsFromURL(_:)](coretext/ctfontmanagercreatefontdescriptorsfromurl(_:).md)
- [CTFontManagerCreateFontRequestRunLoopSource(_:_:)](coretext/ctfontmanagercreatefontrequestrunloopsource(_:_:).md)
- [CTFontManagerEnableFontDescriptors(_:_:)](coretext/ctfontmanagerenablefontdescriptors(_:_:).md)
- [CTFontManagerGetAutoActivationSetting(_:)](coretext/ctfontmanagergetautoactivationsetting(_:).md)
- [CTFontManagerGetScopeForURL(_:)](coretext/ctfontmanagergetscopeforurl(_:).md)
- [CTFontManagerIsSupportedFont(_:)](coretext/ctfontmanagerissupportedfont(_:).md)
- [CTFontManagerRegisterFontsForURL(_:_:_:)](coretext/ctfontmanagerregisterfontsforurl(_:_:_:).md)
- [CTFontManagerRegisterFontsForURLs(_:_:_:)](coretext/ctfontmanagerregisterfontsforurls(_:_:_:).md)
- [CTFontManagerRegisterGraphicsFont(_:_:)](coretext/ctfontmanagerregistergraphicsfont(_:_:).md)
