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

Inverse Powerline Triangle evolution #1747

Open
Finii opened this issue Nov 20, 2024 · 4 comments
Open

Inverse Powerline Triangle evolution #1747

Finii opened this issue Nov 20, 2024 · 4 comments

Comments

@Finii
Copy link
Collaborator

Finii commented Nov 20, 2024

          > also noticed that the inverse + regular don't line up correctly such that they form a perfect arrow

That problem is already mentioned right in the top of this thread/PR, with a possible fix given in #1490 (comment) above (I sketched exactly that image on paper there ;)

The culprit are the 'landing platforms' on the left resp right that help avoid the vertical colored lines problem.
Are these adjacent triangular things a common setup?

I'll add the new patched font into this comment in a minute...

Edit:

FiraCodeNerdFont-Regular.zip

Green is the new outline:

image

--- a/font-patcher
+++ b/font-patcher
@@ -853,8 +853,8 @@ class font_patcher:
                 box_enabled = False # Cowardly not scaling existing glyphs, although the code would allow this
 
         # Stretch 'xz' or 'pa' (preserve aspect ratio)
-        # Supported params: overlap | careful | xy-ratio | dont_copy | ypadding
-        # Overlap value is used horizontally but vertically limited to 0.01
+        # Supported params: overlap | voverlap | careful | xy-ratio | dont_copy | ypadding
+        # Overlap value is used horizontally but vertically limited to 0.01 (or specified by voverlap)
         # Careful does not overwrite/modify existing glyphs
         # The xy-ratio limits the x-scale for a given y-scale to make the ratio <= this value (to prevent over-wide glyphs)
         # '1' means occupu 1 cell (default for 'xy')
@@ -878,8 +878,8 @@ class font_patcher:
             0xe0b3: {'align': 'r', 'valign': 'c', 'stretch': '^xy', 'params': {'xy-ratio': 0.7}},
 
             # Inverse arrow tips
-            0xe0d6: {'align': 'l', 'valign': 'c', 'stretch': '^xy', 'params': {'overlap': 0.05, 'xy-ratio': 0.7}},
-            0xe0d7: {'align': 'r', 'valign': 'c', 'stretch': '^xy', 'params': {'overlap': 0.05, 'xy-ratio': 0.7}},
+            0xe0d6: {'align': 'l', 'valign': 'c', 'stretch': '^xy', 'params': {'overlap': 0.05, 'xy-ratio': 0.7, 'voverlap': 0.0}},
+            0xe0d7: {'align': 'r', 'valign': 'c', 'stretch': '^xy', 'params': {'overlap': 0.05, 'xy-ratio': 0.7, 'voverlap': 0.0}},
 
             # Rounded arcs
             0xe0b4: {'align': 'l', 'valign': 'c', 'stretch': '^xy', 'params': {'overlap': 0.06, 'xy-ratio': 0.59}},
@@ -1502,8 +1502,9 @@ class font_patcher:
                 logger.critical("Conflicting params: overlap and ypadding")
                 sys.exit(1)
             if overlap:
+                voverlap = sym_attr['params'].get('voverlap')
                 scale_ratio_x *= 1.0 + (self.font_dim['width'] / (sym_dim['width'] * scale_ratio_x)) * overlap
-                y_overlap = min(0.01, overlap) # never aggressive vertical overlap
+                y_overlap = voverlap if voverlap is not None else min(0.01, overlap) # never aggressive vertical overlap
                 scale_ratio_y *= 1.0 + (self.font_dim['height'] / (sym_dim['height'] * scale_ratio_y)) * y_overlap
 
             # Size in x to size in y ratio limit (to prevent over-wide glyphs)

(Took actually not 'a minute' but 40 😬 )

Originally posted by @Finii in #1490 (comment)

@Finii
Copy link
Collaborator Author

Finii commented Nov 20, 2024

Thoughts

  • This glyphs are probably only used for clients with transparency, so optimise for that
  • We could also shift the inner corner one-landing-platform-width to the inside

@awebeer256
Copy link

Would this be a good place to post screenshots of how these inverse triangles look on my machine?

@Finii
Copy link
Collaborator Author

Finii commented Feb 10, 2025

@awebeer256 Yes please 👍

@awebeer256
Copy link

My terminal is Konsole 24.08.3.

Here's the patched font from the first post of this issue on the left, followed by the unpatched version (from the 3.3.0 release) on the right.
Image Image
The same screenshots blown up 4x:
Image Image
The glyph doesn't extend far enough upward or downward, and the patched version is worse on top.

But now look at Monaspice Neon Light (MonaspiceNeNerdFont-Light.otf from 3.3.0):

Image
Image

Here, it again doesn't extend far enough downward, but it extends more than a pixel too far upward!

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

No branches or pull requests

2 participants