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

Fix getfontname(). #37

Closed
wants to merge 1 commit into from

Conversation

jszakmeister
Copy link
Contributor

getfontname() would incorrectly return strings of the form
"FONTNAME:SIZE", when it should be returning strings of the form
"FONTNAME:hSIZE"--notice the "h" in the last form. However, the
internal font string needs to maintain the first form. So, instead we
cut it up and insert the "h" in the proper location giving it the proper
form.

@jszakmeister
Copy link
Contributor Author

Björn, I'm not sure that this is the proper way to make the fix (there might be a better way to do it). However, it does fix the issue I was seeing. Namely, that MacVim would not work correctly with the Dr. Mike's fontsize plugin. I know there are other hotkeys in MacVim to adjust the font size, but I use Vim on several platforms, so it's helpful to have this work correctly.

BTW, thank you very much for MacVim--it's fantastic!

@b4winckler
Copy link
Owner

Thanks for the patch.

I had a quick look and I believe the "right" fix would instead be to include the "h" in the font name when it is stored internally (it might require some thought/testing). This should be achievable by fixing gui_macvim_font_with_name() in two places ("%@:%d" should be "%@:h%d"), and fixing -[MMBackend setFont:] so that the size component removes the "h" before calling floatValue.

Can you test this and see if it works?

@jszakmeister
Copy link
Contributor Author

Thanks for the feedback Björn. I'll take a look at that approach. I should have some time a little later today, so I'll try and get back to you by then.

getfontname() would incorrectly return strings of the form
"FONTNAME:SIZE", when it should be returning strings of the form
"FONTNAME:hSIZE"--notice the "h" in the last form.

To fix this, we change the internal representation of the font name and
size to include the "h", and peel it off when actually setting the font.
@jszakmeister
Copy link
Contributor Author

So I had some free time waiting for something else to finish. Here's an updated patch with your suggestion. I did try it out and it appears to work correctly.

@b4winckler
Copy link
Owner

Thanks! I think that will do it so I've pushed your patch, but please keep a lookout and let me know if you find any problems.

@b4winckler b4winckler closed this Oct 11, 2013
@jszakmeister
Copy link
Contributor Author

Will do. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants