(93b920f3f) Fixed Chinese text wrapping (can't wrap based on spaces because there's no spaces)

This commit is contained in:
Joonas Rikkonen
2019-05-06 11:36:38 +03:00
parent e0ddeef023
commit 8e53c38461
7 changed files with 87 additions and 245 deletions
@@ -151,32 +151,6 @@ namespace Barotrauma
return style;
}
private ScalableFont LoadFont(XElement element, GraphicsDevice graphicsDevice)
{
string file = element.GetAttributeString("file", "");
uint size = GetFontSize(element);
return new ScalableFont(file, size, graphicsDevice);
}
private uint GetFontSize(XElement element)
{
foreach (XElement subElement in element.Elements())
{
Point maxResolution = subElement.GetAttributePoint("maxresolution", new Point(int.MaxValue, int.MaxValue));
if (GameMain.GraphicsWidth <= maxResolution.X && GameMain.GraphicsHeight <= maxResolution.Y)
{
return (uint)subElement.GetAttributeInt("size", 14);
}
}
return 14;
}
public GUIComponentStyle GetComponentStyle(string name)
{
componentStyles.TryGetValue(name.ToLowerInvariant(), out GUIComponentStyle style);
return style;
}
public void Apply(GUIComponent targetComponent, string styleName = "", GUIComponent parent = null)
{
GUIComponentStyle componentStyle = null;