Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Implement CTRunGetTextMatrix and CTRunGetStatus - #1985

Merged
Allen Ballway (aballway) merged 3 commits into
microsoft:developfrom
aballway:develop
Feb 17, 2017
Merged

Allen Ballway (aballway) merged 3 commits into
microsoft:developfrom
aballway:develop

Conversation

@aballway

@aballway Allen Ballway (aballway) commented Feb 16, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #1982

@ms-jihua

Copy link
Copy Markdown
Contributor

When/how would a run's matrix ever become non-identity?

@aballway

Copy link
Copy Markdown
Contributor Author

I'm not certain. The documentation doesn't specify and I wasn't able to make a run with non-identity text matrix


In reply to: 280432102 [](ancestors = 280432102)

@ms-jihua

Copy link
Copy Markdown
Contributor

Hmm, could you try to dig a little bit more? I'm not super concerned but I am vaguely curious.

@aballway

Copy link
Copy Markdown
Contributor Author

The text matrix will be non-identity if the run's font has a non-identity matrix. Changing CTRun to support this is in #1987

@ms-jihua ms-jihua left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would add some more detail to that caveat comment, otherwise fine.

Comment thread Frameworks/CoreText/CTRun.mm Outdated
@Status Stub
@Notes
@Status Caveat
@Notes Only support identity matrix

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "supports"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it to mean "We only support identity matrix," though it could also be interpreted as "CTRun only supports identity matrix." I suppose I should use complete sentences.

@aballway

Copy link
Copy Markdown
Contributor Author

Rebased on top of recent develop changes, will merge when tests pass.

CFAttributedStringRef string = (__bridge CFAttributedStringRef)getString(@"foobar");
auto line = woc::MakeAutoCF<CTLineRef>(CTLineCreateWithAttributedString(string));
CFArrayRef runsArray = CTLineGetGlyphRuns(line);
CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runsArray, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: c style casts!

@aballway
Allen Ballway (aballway) merged commit 9b071a3 into microsoft:develop Feb 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants