Better sizes (with outline Style)
Fix of ScreenOptionsRecord for new font sizes. Other have to follow!
This commit is contained in:
1 parent
1216a2d0c2
commit
55a466559b
3 files changed
+31
-28
No files matched your search
@@ -160,11 +160,11 @@
|
||||
<Text1>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>640</X>
|
||||
<Y>48</Y>
|
||||
<Y>53</Y>
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -189,11 +189,11 @@
|
||||
<Text2>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>75</X>
|
||||
<Y>105</Y>
|
||||
<Y>104</Y>
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -222,7 +222,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -251,7 +251,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -280,7 +280,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -309,7 +309,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>0,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<MaxW>970</MaxW>
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
@@ -339,7 +339,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>-1,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -368,7 +368,7 @@
|
||||
<!--<Z>: Text position-->
|
||||
<Z>-1,00</Z>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
<!--or <R>, <G>, <B>, <A> (lower priority)-->
|
||||
@@ -410,9 +410,9 @@
|
||||
<Text>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>75</X>
|
||||
<Y>10</Y>
|
||||
<Y>14</Y>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<MaxW>142</MaxW>
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
@@ -467,9 +467,9 @@
|
||||
<Text>
|
||||
<!--<X>, <Y>: Text position-->
|
||||
<X>75</X>
|
||||
<Y>10</Y>
|
||||
<Y>14</Y>
|
||||
<!--<H>: Text height-->
|
||||
<H>32</H>
|
||||
<H>27</H>
|
||||
<!--<MaxW>: Maximum text width (if exists)-->
|
||||
<MaxW>142</MaxW>
|
||||
<!--<Color>: Text color from ColorScheme (high priority)-->
|
||||
@@ -559,7 +559,7 @@
|
||||
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
|
||||
<TextSColor>TextSColor</TextSColor>
|
||||
<!--<TextH>: Text height-->
|
||||
<TextH>32,00</TextH>
|
||||
<TextH>27</TextH>
|
||||
<!--<TextRelativeX>: Text relative x-position-->
|
||||
<!--<TextRelativeY>: Text relative y-position-->
|
||||
<!--<TextMaxW>: Maximum text width (if exists)-->
|
||||
@@ -626,7 +626,7 @@
|
||||
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
|
||||
<TextSColor>TextSColor</TextSColor>
|
||||
<!--<TextH>: Text height-->
|
||||
<TextH>32,00</TextH>
|
||||
<TextH>27</TextH>
|
||||
<!--<TextRelativeX>: Text relative x-position-->
|
||||
<!--<TextRelativeY>: Text relative y-position-->
|
||||
<!--<TextMaxW>: Maximum text width (if exists)-->
|
||||
@@ -693,7 +693,7 @@
|
||||
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
|
||||
<TextSColor>TextSColor</TextSColor>
|
||||
<!--<TextH>: Text height-->
|
||||
<TextH>32,00</TextH>
|
||||
<TextH>27</TextH>
|
||||
<!--<TextRelativeX>: Text relative x-position-->
|
||||
<!--<TextRelativeY>: Text relative y-position-->
|
||||
<!--<TextMaxW>: Maximum text width (if exists)-->
|
||||
@@ -760,7 +760,7 @@
|
||||
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
|
||||
<TextSColor>TextSColor</TextSColor>
|
||||
<!--<TextH>: Text height-->
|
||||
<TextH>32,00</TextH>
|
||||
<TextH>27</TextH>
|
||||
<!--<TextRelativeX>: Text relative x-position-->
|
||||
<!--<TextRelativeY>: Text relative y-position-->
|
||||
<!--<TextMaxW>: Maximum text width (if exists)-->
|
||||
|
||||
@@ -52,29 +52,30 @@ namespace Vocaluxe.Base.Fonts
|
||||
float outlineSize = outline * maxHeight;
|
||||
string chrString = chr.ToString();
|
||||
|
||||
CFonts.Height = maxHeight; // *factor;
|
||||
//float factor = _GetFactor(chr, flags);
|
||||
CFonts.Height = maxHeight;
|
||||
Font fo = CFonts.GetFont();
|
||||
SizeF fullSize;
|
||||
Size bmpSize;
|
||||
using (Graphics g = Graphics.FromHwnd(IntPtr.Zero))
|
||||
{
|
||||
fullSize = g.MeasureString(chrString, fo);
|
||||
fullSize.Width += outlineSize;
|
||||
if (chr != ' ')
|
||||
{
|
||||
//Gets exact height and width for drawing more than 1 char. But width is to small to draw char on bitmap as e.g. italic chars will get cropped
|
||||
_BoundingBox = g.MeasureString(chrString, fo, -1, new StringFormat(StringFormat.GenericTypographic));
|
||||
_BoundingBox.Width += outlineSize;
|
||||
// ReSharper disable CompareOfFloatsByEqualityOperator
|
||||
if (_BoundingBox.Height == 0)
|
||||
// ReSharper restore CompareOfFloatsByEqualityOperator
|
||||
_BoundingBox.Height = fullSize.Height - outlineSize;
|
||||
_BoundingBox.Height = fullSize.Height;
|
||||
_BoundingBox.Width += outlineSize / 2;
|
||||
_BoundingBox.Height += outlineSize;
|
||||
fullSize.Width += outlineSize;
|
||||
bmpSize = new Size((int)fullSize.Width, (int)Math.Round(_BoundingBox.Height));
|
||||
}
|
||||
else
|
||||
{
|
||||
_BoundingBox = fullSize;
|
||||
_BoundingBox.Height += outlineSize;
|
||||
bmpSize = new Size(1, 1);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +87,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
if (chr == ' ')
|
||||
{
|
||||
_Texture = CDraw.AddTexture(bmp);
|
||||
_DrawBounding = new RectangleF(0, 0, 1, 1);
|
||||
_DrawBounding = new RectangleF(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -119,6 +120,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
_DrawBounding.Y *= _Texture.Width / _DrawBounding.Width;
|
||||
_DrawBounding.Width = _Texture.Width;
|
||||
_DrawBounding.Height = _Texture.Height;*/
|
||||
#pragma warning disable 162
|
||||
if (false)
|
||||
{
|
||||
if (outline > 0)
|
||||
@@ -126,6 +128,7 @@ namespace Vocaluxe.Base.Fonts
|
||||
else
|
||||
bmpCropped.Save("font/" + chr + CFonts.Style + "2.png", ImageFormat.Png);
|
||||
}
|
||||
#pragma warning restore 162
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Vocaluxe.Screens
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
const string test = " ÖÄÜabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890";
|
||||
const string test = "Ö ÄÜabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPGRSTUVWGXZ1234567890";
|
||||
SColorF color = new SColorF(1, 0, 0, 1);
|
||||
CText text = new CText(10, 50, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Normal", color, "jÄNormal Text" + test, -1, 26, 0);
|
||||
_AddText(text);
|
||||
@@ -47,11 +47,11 @@ namespace Vocaluxe.Screens
|
||||
_AddText(text);
|
||||
text = new CText(10, 130, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Normal", color, "jÄItalic Text" + test, -1, 26, 0);
|
||||
_AddText(text);
|
||||
text = new CText(10, 170, 1, 100, 0, EAlignment.Left, EStyle.Normal, "Outline", color, "jÄNormal Text" + test, -1, 50, 0);
|
||||
text = new CText(10, 170, 1, 32, 0, EAlignment.Left, EStyle.Normal, "Outline", color, "jÄNormal Text" + test, -1, 50, 0);
|
||||
_AddText(text);
|
||||
text = new CText(10, 210, 1, 200, 0, EAlignment.Left, EStyle.Bold, "Outline", color, "jÄBold Text" + test, -1, 100, 0);
|
||||
text = new CText(10, 210, 1, 32, 0, EAlignment.Left, EStyle.Bold, "Outline", color, "jÄBold Text" + test, -1, 100, 0);
|
||||
_AddText(text);
|
||||
text = new CText(10, 250, 1, 300, 0, EAlignment.Left, EStyle.Italic, "Outline", color, "jÄItalic Text" + test, -1, 150, 0);
|
||||
text = new CText(10, 250, 1, 32, 0, EAlignment.Left, EStyle.Italic, "Outline", color, "jÄItalic Text" + test, -1, 150, 0);
|
||||
_AddText(text);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user