After this question, I figured out how to vertically align the text of one line:
CGRect boundingBox = CTFontGetBoundingBox(font);
But this code only works for one line context. When a frame generates a line with several lines (with soft or hard line breaks), this code does not work.
source share