mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-08-04 10:31:12 +00:00
Fix text measurement for non-italic text.
This commit is contained in:
parent
2bffcbbfcf
commit
26af1aa354
|
@ -80,7 +80,8 @@ namespace OpenTK.Graphics.Text
|
||||||
{
|
{
|
||||||
SetTextRenderingOptions(gfx, glyph.Font);
|
SetTextRenderingOptions(gfx, glyph.Font);
|
||||||
|
|
||||||
gfx.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, PointF.Empty, load_glyph_string_format);
|
gfx.DrawString(glyph.Character.ToString(), glyph.Font, Brushes.White, PointF.Empty,
|
||||||
|
glyph.Font.Style == FontStyle.Italic ? load_glyph_string_format : default_string_format);
|
||||||
return bmp.Clone(FindEdges(bmp), System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
return bmp.Clone(FindEdges(bmp), System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,6 +131,10 @@ namespace OpenTK.Graphics.Text
|
||||||
{
|
{
|
||||||
// Todo: Parse layout options:
|
// Todo: Parse layout options:
|
||||||
StringFormat format = default_string_format;
|
StringFormat format = default_string_format;
|
||||||
|
//if (block.Font.Style != FontStyle.Regular)
|
||||||
|
// format = load_glyph_string_format;
|
||||||
|
//else
|
||||||
|
// format = default_string_format;
|
||||||
|
|
||||||
extents.Clear();
|
extents.Clear();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue