<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTypesetter/hyphenationFactor(forGlyphAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTypesetter(im)hyphenationFactorForGlyphAtIndex:"
  },
  "title" : "hyphenationFactor(forGlyphAt:)"
}
-->

# hyphenationFactor(forGlyphAt:)

Returns the hyphenation factor in effect at a specified location.

```
func hyphenationFactor(forGlyphAt glyphIndex: Int) -> Float
```

## Parameters

`glyphIndex`

The index of the glyph position to examine.

## Return Value

The hyphenation factor in effect at `glyphIndex`. The hyphenation factor is a value ranging from 0.0 to 1.0 that controls when hyphenation is attempted. By default, the value is 0.0, meaning hyphenation is off. A factor of 1.0 causes hyphenation to be attempted always.

## Discussion

The typesetter calls this method with a proposed hyphenation point for a line break to find the hyphenation factor in effect at that time. A subclass can override this method to customize the text layout process.

---

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)