osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Disabling `UseFullGlyphHeight` does not trim top part of sprite text glyphs

Open frenzibyte opened this issue 3 years ago • 0 comments

Currently disabling the property would end up making the sprite text look unaligned instead:

UseFullGlyphHeight = true UseFullGlyphHeight = false
with margin CleanShot 2022-05-10 at 12 51 35@2x CleanShot 2022-05-10 at 12 51 53@2x
without margin CleanShot 2022-05-10 at 12 50 20@2x

As can be seen on the above screenshots, UseFullGlyphHeight = false does not trim the top part of the sprite text glyphs, causing them to look unaligned on UI components.

This property already works well on osu!-side's LegacySpriteTexts as they don't have extra padding on the top like normal fonts do.


Used code for reference:

            AutoSizeAxes = Axes.Both;
            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                new SpriteText
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Font = FontUsage.Default.With(size: 25),
                    // Margin = new MarginPadding(0),
                    // Margin = new MarginPadding(5),
                    Colour = Color4.Black,
                    // UseFullGlyphHeight = false,
                    // UseFullGlyphHeight = true,
                    Text = someText,
                }
            };

frenzibyte avatar May 10 '22 09:05 frenzibyte