powerline / fontpatcher

Script to patch arrow and symbol glyphs into fonts for usage with Powerline and other compatible plugins.
Other
364 stars 60 forks source link

Better target_bb selection #3

Open ahti opened 10 years ago

ahti commented 10 years ago

I have found that for the Menlo font, the default way to determine the target_bb gives very bad results (the box drawing characters extend beyond the normal character bounds quite a bit).

Due to this, every patched Menlo i found online looked very bad (at least to me, most others seem not to notice :sweat_smile:).

I have now found a target_bb that looks good to me (at least at 288pt font size and below).

Now that I have gone through this work, I think it would be a shame to just use it for me. But I also dislike the idea of me just publishing this patched Menlo online somewhere. I think a more generic approach would be useful.

Thus I think it would be a good idea to include target bounding boxes for specific fonts in fontpatcher, and fall back to the default way of going through characters if there is no bounding box for the font to be patched.

This way, everyone who uses the patcher with Menlo in the future would get the better target bounding box.

I am not very well versed in python, so I don't know what the best way to keep this data separate from the actual script would be, or I would have set up a pull request, but if you like this idea, here is the target_bb that I have found works well for Menlo: [0, -483 1227, 1936]