Ensure large type text is sized based on screen HEIGHT as well as width #733

Merged
merged 3 commits into from Mar 23, 2012

Conversation

Projects
None yet
3 participants
@pjrobertson
Member

pjrobertson commented Feb 25, 2012

Also, change the string name from number to aString. Makes more sense

If you have a string that is really really long, or has many lies, then Quicksilver would previously not set the font size to ensure all the lines are included in the large type display.

e.g. paste this into QS's 1st pane before, and after this fix.

a
b
c
d
e
f
g
h
i
j
k

Ensure large type text is sized based on screen HEIGHT as well as width
Also, change the string name from `number` to `aString`. Makes more sense
@skurfer

This comment has been minimized.

Show comment
Hide comment
@skurfer

skurfer Feb 27, 2012

Member

I like it. I’ll run with it for a while.

Member

skurfer commented Feb 27, 2012

I like it. I’ll run with it for a while.

+ textSize = [aString sizeWithAttributes:[NSDictionary dictionaryWithObject:textFont forKey:NSFontAttributeName]];
+ if (textSize.width > displayWidth+[textFont descender] *2 || (textSize.height > displayHeight+[textFont descender] *2)) {
+ break;
+ } // ***warning * use ascenders to calculate

This comment has been minimized.

@HenningJ

HenningJ Feb 27, 2012

Member

What is this warning? What does it mean? Is it still valid?

@HenningJ

HenningJ Feb 27, 2012

Member

What is this warning? What does it mean? Is it still valid?

NSBeep();
return;
}
float displayWidth = NSWidth(screenRect) *11/12-2*EDGEINSET;
- NSRange fullRange = NSMakeRange(0, [number length]);
- NSMutableAttributedString *formattedNumber = [[NSMutableAttributedString alloc] initWithString:number];
+ float displayHeight = NSHeight(screenRect) * 11/12 - 2*EDGEINSET;

This comment has been minimized.

@HenningJ

HenningJ Feb 27, 2012

Member

Hmm...this calculation is strange. 11/12 of the screen-size...ok, so it doesn't fill the complete screen, only almost the complete screen. But what with - 2*EDGEINSET?

@HenningJ

HenningJ Feb 27, 2012

Member

Hmm...this calculation is strange. 11/12 of the screen-size...ok, so it doesn't fill the complete screen, only almost the complete screen. But what with - 2*EDGEINSET?

@HenningJ

This comment has been minimized.

Show comment
Hide comment
@HenningJ

HenningJ Feb 27, 2012

Member

I like it as well. I just had a few questions about the code. Not really about your changes, but about what was there before...

Member

HenningJ commented Feb 27, 2012

I like it as well. I just had a few questions about the code. Not really about your changes, but about what was there before...

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Feb 27, 2012

Member

I was unsure about that 2*EDGEINSET bit as well, but I considered the 'if
it aint broke leave it' philosophy :)

Perhaps when Rob looks at merging all this into one global method (as he
mentioned in the dev groups) he can look into this? (Hehe - sorry Rob!)

To be perfectly honest, I have no idea what a descender/ascender is (of
course I could find out, so don't bother explaining!)

On 27 February 2012 14:17, Henning Jungkurth <
reply@reply.github.com

wrote:

I like it as well. I just had a few questions about the code. Not really
about your changes, but about what was there before...


Reply to this email directly or view it on GitHub:
#733 (comment)

Member

pjrobertson commented Feb 27, 2012

I was unsure about that 2*EDGEINSET bit as well, but I considered the 'if
it aint broke leave it' philosophy :)

Perhaps when Rob looks at merging all this into one global method (as he
mentioned in the dev groups) he can look into this? (Hehe - sorry Rob!)

To be perfectly honest, I have no idea what a descender/ascender is (of
course I could find out, so don't bother explaining!)

On 27 February 2012 14:17, Henning Jungkurth <
reply@reply.github.com

wrote:

I like it as well. I just had a few questions about the code. Not really
about your changes, but about what was there before...


Reply to this email directly or view it on GitHub:
#733 (comment)

@HenningJ

This comment has been minimized.

Show comment
Hide comment
@HenningJ

HenningJ Feb 27, 2012

Member

I have no idea what a descender/ascender is (of course I could find out, so don't bother explaining!)

I don't have a clue either. :-)

Member

HenningJ commented Feb 27, 2012

I have no idea what a descender/ascender is (of course I could find out, so don't bother explaining!)

I don't have a clue either. :-)

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Mar 17, 2012

Member

Any further problems with this? It's annoying not having the full text when I want to see a song's lyrics... :)

Member

pjrobertson commented Mar 17, 2012

Any further problems with this? It's annoying not having the full text when I want to see a song's lyrics... :)

@skurfer

This comment has been minimized.

Show comment
Hide comment
@skurfer

skurfer Mar 17, 2012

Member

I noticed one small thing. If you have a narrow column of text, the Large Type display is still very wide. For instance, try ls -1 ~ → Run Command in Shell then Large Type the result.

I don’t think that should hold this up, so I’ll merge it as is, but… Just in case you plan to fix it and would prefer to do it on this existing branch, I’ll give you a few hours to speak up before I merge.

Member

skurfer commented Mar 17, 2012

I noticed one small thing. If you have a narrow column of text, the Large Type display is still very wide. For instance, try ls -1 ~ → Run Command in Shell then Large Type the result.

I don’t think that should hold this up, so I’ll merge it as is, but… Just in case you plan to fix it and would prefer to do it on this existing branch, I’ll give you a few hours to speak up before I merge.

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Mar 17, 2012

Member

I am looking into this now, thanks for holding off!

Been busy watching Wales win the Grand Slam - rugby :)

On 17 March 2012 14:49, Rob McBroom <
reply@reply.github.com

wrote:

I noticed one small thing. If you have a narrow column of text, the Large
Type display is still very wide. For instance, try ls -1 ~ → Run Command
in Shell then Large Type the result.

I don’t think that should hold this up, so I’ll merge it as is, but… Just
in case you plan to fix it and would prefer to do it on this existing
branch, I’ll give you a few hours to speak up before I merge.


Reply to this email directly or view it on GitHub:
#733 (comment)

Member

pjrobertson commented Mar 17, 2012

I am looking into this now, thanks for holding off!

Been busy watching Wales win the Grand Slam - rugby :)

On 17 March 2012 14:49, Rob McBroom <
reply@reply.github.com

wrote:

I noticed one small thing. If you have a narrow column of text, the Large
Type display is still very wide. For instance, try ls -1 ~ → Run Command
in Shell then Large Type the result.

I don’t think that should hold this up, so I’ll merge it as is, but… Just
in case you plan to fix it and would prefer to do it on this existing
branch, I’ll give you a few hours to speak up before I merge.


Reply to this email directly or view it on GitHub:
#733 (comment)

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Mar 18, 2012

Member

OK @skurfer
Take a look at the change I've made :-)

Member

pjrobertson commented Mar 18, 2012

OK @skurfer
Take a look at the change I've made :-)

@skurfer

This comment has been minimized.

Show comment
Hide comment
@skurfer

skurfer Mar 18, 2012

Member

Definitely better for narrow columns, but now I see other weirdness.

The shadow for some taller characters looks like it’s getting cut off at the bottom (You may have to look at it full size. See the ]; at the end in particular):

Truncated Shadow

If the text being displayed has some leading whitespace, the position gets weird:

Leading Whitespace

This message would have been much easier to put together with a Dropbox plug-in to grab those links for me. ;-)

Member

skurfer commented Mar 18, 2012

Definitely better for narrow columns, but now I see other weirdness.

The shadow for some taller characters looks like it’s getting cut off at the bottom (You may have to look at it full size. See the ]; at the end in particular):

Truncated Shadow

If the text being displayed has some leading whitespace, the position gets weird:

Leading Whitespace

This message would have been much easier to put together with a Dropbox plug-in to grab those links for me. ;-)

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Mar 18, 2012

Member

Hmm... OK, I was worried there might be some problems.
I think I might just revert the commit and then let you merge it.

Member

pjrobertson commented Mar 18, 2012

Hmm... OK, I was worried there might be some problems.
I think I might just revert the commit and then let you merge it.

@skurfer

This comment has been minimized.

Show comment
Hide comment
@skurfer

skurfer Mar 22, 2012

Member

I think I might just revert the commit and then let you merge it.

Sounds fine.

Member

skurfer commented Mar 22, 2012

I think I might just revert the commit and then let you merge it.

Sounds fine.

@pjrobertson

This comment has been minimized.

Show comment
Hide comment
@pjrobertson

pjrobertson Mar 22, 2012

Member

OK I've reverted.

On 22 March 2012 13:19, Rob McBroom <
reply@reply.github.com

wrote:

I think I might just revert the commit and then let you merge it.

Sounds fine.


Reply to this email directly or view it on GitHub:
#733 (comment)

Member

pjrobertson commented Mar 22, 2012

OK I've reverted.

On 22 March 2012 13:19, Rob McBroom <
reply@reply.github.com

wrote:

I think I might just revert the commit and then let you merge it.

Sounds fine.


Reply to this email directly or view it on GitHub:
#733 (comment)

skurfer added a commit that referenced this pull request Mar 23, 2012

Merge pull request #733 from pjrobertson/largeType
Ensure large type text is sized based on screen HEIGHT as well as width

@skurfer skurfer merged commit 63f456d into quicksilver:master Mar 23, 2012

@skurfer

This comment has been minimized.

Show comment
Hide comment
@skurfer

skurfer Mar 23, 2012

Member

Merged

Member

skurfer commented Mar 23, 2012

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment