Core Text - How to know if text is Right to Left

橙三吉。 提交于 2019-12-11 07:45:43

问题


How can we know if the text of a CTRun is right to left? Thanks


回答1:


I do not have practical experience with CTRun, but from the documentation is seems that

 CTRunStatus CTRunGetStatus(CTRunRef run)

returns the information you need, the return value is a bitfield:

enum {
   kCTRunStatusNoStatus = 0,
   kCTRunStatusRightToLeft = (1 << 0),
   kCTRunStatusNonMonotonic = (1 << 1),
   kCTRunStatusHasNonIdentityMatrix = (1 << 2)
};
typedef uint32_t CTRunStatus;


来源:https://stackoverflow.com/questions/18022882/core-text-how-to-know-if-text-is-right-to-left

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