-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
🙏🏻 Is it possible to "center" glyphs which overlap a single cell by padding them? #1330
Comments
Thanks for the suggestion. Code-wise what you propose seems to be this: index 247c28367..29eeb0fdd 100755
--- a/font-patcher
+++ b/font-patcher
@@ -1448,7 +1448,7 @@ class font_patcher:
x_align_distance = self.font_dim['xmin'] - sym_dim['xmin']
if sym_attr['align'] == 'c':
# Center align
- x_align_distance += (self.font_dim['width'] / 2) - (sym_dim['width'] / 2)
+ x_align_distance += (self.font_dim['width'] * self.get_target_width(stretch) / 2) - (sym_dim['width'] / 2)
elif sym_attr['align'] == 'r':
# Right align
x_align_distance += self.font_dim['width'] * self.get_target_width(stretch) - sym_dim['width'] That is just superficially tested code, the scale rules can be quite complex and the impact on other scale paradigms has to be evaluated. Do you propose an option for self patching people, or a forth variant of pre-patched fonts? The later of course will blow up the release by 1/3 in size 😒
I am not aware of any? One use of the icons in for directory listings, like
The current strategy is to center the icon in one (the left) cell. If it is wider than one cell it is still centered in the left/first cell, but on the other hand it is not allowed to protrude leftward into the previous cell, so in fact it is left aligned when the size is wider than one cell. |
@Finii , thanks for the response. The current strategy of left-alignment for "plus-size" icons looks generally ok; but the precise left-alignment with the slightly ragged right edge is a bit visually jarring (such as between the I'm not sure it can be fixed, but my thought was that centering the "plus-sized" glyphs, or maybe all the glyphs?, within a double-wide space would decrease any visual inconsistency, with symmetry of the horizontal padding. This would be similar to the vertical centerline symmetry present in the rest of the non-glyph "narrow" characters. And I believe the double-wide emojis are similarly centered over two characters widths. But, given the variation in icons and icon widths, I'm not sure that it would actually be a net benefit. It might actually have a similar amount of distracting visual variability. Unfortunately, I'm not currently experienced enough with fonts and font patching to perform the experiments. Ideally, it would be great to be able to pick horizontally-centered "narrow" or "wide" variants, similar to emojis, but, from my reading about unicode, that seems like it might be an impossible task. If done, I would think enabling self-patching would be appropriate if/until it becomes a popular variant. |
Note to self:
This is the key point of this Issue. |
Requirements
Is your feature request related to a problem? Please describe.
When using glyphs which overlap to the next cell, it is difficult to visually align columns. Subsequent lines with vertically aligned glyphs will often seem slightly askew visually.
The vertical size changes to the glyphs in the "FONT_NAME Nerd Font" and "FONT_NAME Nerd Font Propo" seems to have settled into a very aesthetically appealing form.
It just horizontally challenged, especially for table-type alignments.
Describe the solution you'd like
Would it be possible to visually center the glyphs within the two-cell-width space by adding a left padding, essentially treating them as pseudo two-cell-width characters? By forcing the glyph into the center portion of two cells, it would make vertical alignment much more aesthetic.
For compatibility, the characters would still be "narrow", being seen as single cell width, allowing the current usual practice of adding a single space (" ") after the glyph to continue to work for display alignment of other characters.
Possibly name the font variant something like "FONT_NAME Nerd Font Wide"?
This, with some obvious documentation of the difference between default/Mono/Propo/Wide variants, might solve more of the character alignment complaints.
Thanks for the consideration.
The text was updated successfully, but these errors were encountered: