Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for lineBreakMode #111

Closed
tettoffensive opened this issue Mar 7, 2016 · 9 comments
Closed

No support for lineBreakMode #111

tettoffensive opened this issue Mar 7, 2016 · 9 comments

Comments

@tettoffensive
Copy link
Contributor

It doesn't appear that BonMot has support for lineBreakMode so that you can set truncation to be ... among other options. Unless I am missing something. I can't find that this option is exposed.

@ZevEisenberg
Copy link
Collaborator

@tettoffensive good catch! This is an accidental omission. If you're up for submitting a pull request, the changes from #101 and #104 are essentially the same as what would need to change to support lineBreakMode.

@tettoffensive
Copy link
Contributor Author

Thanks. I'm up for it, but don't know if I'll get to it today.

@ZevEisenberg
Copy link
Collaborator

No rush on my end. You're the first person who's requested it. Let me know if you're not going to be able to get to it; otherwise, I look forward to your PR 😄

@ZevEisenberg
Copy link
Collaborator

Hey @tettoffensive, is this still something you're interested in? I'm prepping for a 3.0 release that includes some breaking changes. It would be cool to get this in, if you're interested in working on it soon. If not, It doesn't introduce new breaking changes, so it could always go in later as a point release.

@tettoffensive
Copy link
Contributor Author

@ZevEisenberg I'll try to get this in!

@tettoffensive
Copy link
Contributor Author

@ZevEisenberg I made a PR here: #128

On another note, do you have a trick in xcode for your indentation with the BonChains? Where each . indents on a newline?

@ZevEisenberg
Copy link
Collaborator

@tettoffensive thanks for the PR - I'll check it out!

As for indentation, Xcode gives me this for Swift:

attributedString = BONChain()
    .string("Hello, testing world")
    .font(UIFont.preferredFontForTextStyle(UIFontTextStyleBody))
    .textColor(UIColor.redColor())
    .attributedString

And this for Objective-C:

attributedString = BONChain.new
.string(@"Hello, testing world")
.font([UIFont preferredFontForTextStyle:UIFontTextStyleBody])
.textColor([UIColor redColor])
.attributedString;

So, no, my README indentations are lies, damned lies, I tell you! Sorry 😞

@ZevEisenberg
Copy link
Collaborator

@tettoffensive oops, forgot a wrinkle: for my Objective-C code, I use clang-format as outlined at the bottom of this project's README. It's what gives me the nice indentation like this:

NSAttributedString *attributedString =
    BONChain.new
        .string(@"1234")
        .fontNameAndSize(kBONEBGaramond, kBONPointSize)
        .figureSpacing(BONFigureSpacingTabular)
        .attributedString;

I have it set to fail commits unless my format is correct, and it auto-generates a patch that I can use to format the code automatically.

@ZevEisenberg
Copy link
Collaborator

Fixed in #128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants