https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextAttributes/Concepts/AboutTextAttributes.html#//apple_ref/doc/uid/20001804-BBCFEBHA
Temporary Attributes
で指定して
drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:
で描画するコードを書く
かな

Cocoaブリッジを使って〜とかなんで自分でやらなきゃならない&どこまでCCocoaなのかわからんけど