Is there a line break mode on mac so that a word never breaks, even if the word is bigger than a single line?

Currently using CTLineBreakMode.kCTLineBreakByWordWrapping but this breaks the word if the word does not fit on a single line. https://developer.apple.com/documentation/coretext/ctlinebreakmode/kctlinebreakbywordwrapping?language=objc


Is there a way to prevent the word from breaking?

Is there a line break mode on mac so that a word never breaks, even if the word is bigger than a single line?


I sure hope not. Wouldn't that be a text layout mode that runs in an infinite layout loop?

Probably I am not clear. I am a long time Windows developer new to Mac/Apple ecosystem.


See https://docs.microsoft.com/en-us/windows/win32/api/dwrite/ne-dwrite-dwrite_word_wrapping

I am looking for an equivalent of "DWRITE_WORD_WRAPPING_WHOLE_WORD" property on Mac.

There aren't necessarily any equivalents. I don't know of any "emergency wrapping" on Apple platforms. It sounds like you would want either kCTLineBreakByCharWrapping or kCTLineBreakByClipping. If you don't want default wrapping, there are only so many ways not to do it.

Please explain your use case. Where is the text being used? Label? Button? Alert? Logo? ...?

Is there a line break mode on mac so that a word never breaks, even if the word is bigger than a single line?
 
 
Q