Aligning multiple sized text vertical center instead of baseline with Core Text in iOS

≡放荡痞女 提交于 2019-12-01 01:48:12

The run delegate methods getAscent and getDescent are, in fact, called (it is working in my own code). Of course, it makes sense that this doesn't change the baseline (and thus change how the text is displayed relative to other text on the line), as the ascent and descent are relative to the baseline.

It would be handy to have maybe a getBaselineOffset but, unfortunately, that doesn't exist.

My suggestion is to use the run delegate callbacks to reserve space for your differently-baselined text and then in a second pass, draw the other text with the different baseline.

It was impossible still now. I'm regarding this is not possible for current version of Core Text.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!