2

NSAttributedString の iOS カテゴリには、次のものがあります。

CTLineRef line = CTLineCreateWithAttributedString((CFAttributedStringRef)self);
CGFloat ascent;
CGFloat descent;
double length = CTLineGetTypographicBounds(line, &ascent, &descent, NULL);
    // at this point, ascent and descent always come back as zero.

ドキュメントによると、これらはラインの上昇と下降であるように思われます。しかし、そうではありません。

幅はゼロを返しません。

そうは言っても、線を引くと、うまく描画されます。

何か不足していますか?

4

0 に答える 0