Closed nost17 closed 2 years ago
Those glyphs are computed based on the font metrics by this code: https://github.com/wez/wezterm/blob/main/wezterm-gui/src/customglyph.rs#L3491-L3540 it sounds like those quadratic bezier curves could do with some tweaking to improve the shape.
In the meantime, you could try setting https://wezfurlong.org/wezterm/config/lua/config/custom_block_glyphs.html to false
to use glyphs from your available fonts instead, but note that you may be trading a slightly wonky shape for glyphs that don't properly line up due to a freetype hinting bug.
(note for easy testing, semicircle chars are
).
Hello!
I've managed to mostly fix them with with the following diff:
diff --git a/wezterm-gui/src/customglyph.rs b/wezterm-gui/src/customglyph.rs
index 168451b4..e6001e3b 100644
--- a/wezterm-gui/src/customglyph.rs
+++ b/wezterm-gui/src/customglyph.rs
@@ -3491,11 +3491,15 @@ impl BlockKey {
// [] Powerline filled left semicircle
0xe0b4 => Self::Poly(&[Poly {
path: &[
PolyCommand::MoveTo(BlockCoord::Zero, BlockCoord::Zero),
PolyCommand::QuadTo {
- control: (BlockCoord::Frac(6, 3), BlockCoord::Frac(1, 2)),
+ control: (BlockCoord::One, BlockCoord::Zero),
+ to: (BlockCoord::One, BlockCoord::Frac(1, 2)),
+ },
+ PolyCommand::QuadTo {
+ control: (BlockCoord::One, BlockCoord::One),
to: (BlockCoord::Zero, BlockCoord::One),
},
PolyCommand::Close,
],
intensity: BlockAlpha::Full,
@@ -3504,11 +3508,15 @@ impl BlockKey {
// [] Powerline outline left semicircle
0xe0b5 => Self::Poly(&[Poly {
path: &[
PolyCommand::MoveTo(BlockCoord::Zero, BlockCoord::Zero),
PolyCommand::QuadTo {
- control: (BlockCoord::Frac(6, 3), BlockCoord::Frac(1, 2)),
+ control: (BlockCoord::One, BlockCoord::Zero),
+ to: (BlockCoord::One, BlockCoord::Frac(1, 2)),
+ },
+ PolyCommand::QuadTo {
+ control: (BlockCoord::One, BlockCoord::One),
to: (BlockCoord::Zero, BlockCoord::One),
},
],
intensity: BlockAlpha::Full,
style: PolyStyle::Outline,
@@ -3516,11 +3524,15 @@ impl BlockKey {
// [] Powerline filled right semicircle
0xe0b6 => Self::Poly(&[Poly {
path: &[
PolyCommand::MoveTo(BlockCoord::One, BlockCoord::Zero),
PolyCommand::QuadTo {
- control: (BlockCoord::Frac(-3, 3), BlockCoord::Frac(1, 2)),
+ control: (BlockCoord::Zero, BlockCoord::Zero),
+ to: (BlockCoord::Zero, BlockCoord::Frac(1, 2)),
+ },
+ PolyCommand::QuadTo {
+ control: (BlockCoord::Zero, BlockCoord::One),
to: (BlockCoord::One, BlockCoord::One),
},
PolyCommand::Close,
],
intensity: BlockAlpha::Full,
@@ -3529,11 +3541,15 @@ impl BlockKey {
// [] Powerline outline right semicircle
0xe0b7 => Self::Poly(&[Poly {
path: &[
PolyCommand::MoveTo(BlockCoord::One, BlockCoord::Zero),
PolyCommand::QuadTo {
- control: (BlockCoord::Frac(-3, 3), BlockCoord::Frac(1, 2)),
+ control: (BlockCoord::Zero, BlockCoord::Zero),
+ to: (BlockCoord::Zero, BlockCoord::Frac(1, 2)),
+ },
+ PolyCommand::QuadTo {
+ control: (BlockCoord::Zero, BlockCoord::One),
to: (BlockCoord::One, BlockCoord::One),
},
],
intensity: BlockAlpha::Full,
style: PolyStyle::Outline,
Which gives a perfect :sparkles: result for the filled semicircles, but is not so great for the stroke ones:
Here zoomed to better show the problem: :point_right: The issue here is that the stroke is drawn at the limits of the cell
I'm still working on a possible fix, but at least wanted to share this :smiley:
For the strokes, I think you want to try FracWithOffset
:
https://github.com/wez/wezterm/blob/main/wezterm-gui/src/customglyph.rs#L91-L101
Hmm I don't think I can represent BlockCoord::Zero
with FracWithOffset
?
Maybe I can introduce a BlockCoord::WithOffset(LineScale, BlockCoord)
(not sure for the order of args) as a generic replacement for FracWithOffset
?
Edit: except it won't allow me to embed a BlockCoord
in a BlockCoord
:confused:
Any other idea?
:point_right: I'm going for ZeroWithOffset
& OneWithOffset
for now
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
sorry if the wording is strange, I'm using google translator. I have a problem with the zsh prompt with the theme of powerlevel10k, the semicircle shaped sides are "weird" more pointed than they appear in other terminals
left Tilix / right Wezterm both terminals with the same source
Do you know of any solution? , beyond that I have not had another problem, I am liking the terminal a lot, it has everything I am looking for