GlyphLayout: justify text option(s)
Initial implementation of adding layout support on GlyphLayout for justified text.
|
Which lines to justify:
How to expand:
Additional parameter on |
|
Note: some constant names were changed, but the ordinals should still match.
It looks well done!
I don't like setText having so many parameters, but what's one more at this point.
The impact on code paths that don't use justify seems minimal.
@StartsMercury Why are GlyphRun wrapState and the constants protected? If they are truly useful outside of GlyphLayout then public may be a better choice, with the constants as an enum. Everything else looks OK, I think we can merge after that question.
Why are GlyphRun
wrapStateand the constants protected? If they are truly useful outside of GlyphLayout then public may be a better choice, with the constants as an enum.
My thought was that it's currently internal to justify, though it is open to change to public. Users might find wrapState useful, thinking back now, so changing it (back) to public access may be a good idea. I do agree that the constants be an enum. Should a WrapState enum be contained in GlyphLayout, along with GlyphRun?
Yeah, I think it's good to put the enum in GlyphLayout.
I just noticed, should GlyphRun.wrapState be included in GlyphRun.toString()?
Sure, it could. The toString mainly for debugging.