runescape-client: Fix broken glyphs
This commit is contained in:
@@ -30,7 +30,6 @@ import java.awt.AWTException;
|
|||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Cursor;
|
import java.awt.Cursor;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
|
||||||
import java.awt.Frame;
|
import java.awt.Frame;
|
||||||
import java.awt.SystemTray;
|
import java.awt.SystemTray;
|
||||||
import java.awt.TrayIcon;
|
import java.awt.TrayIcon;
|
||||||
@@ -55,7 +54,6 @@ import javax.swing.ToolTipManager;
|
|||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
import javax.swing.text.StyleContext;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -123,8 +121,7 @@ public class ClientUI extends JFrame
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use custom UI font
|
// Use custom UI font
|
||||||
setUIFont(new FontUIResource(StyleContext.getDefaultStyleContext()
|
setUIFont(new FontUIResource(FontManager.getRunescapeFont()));
|
||||||
.getFont(FontManager.getRunescapeFont().getName(), Font.PLAIN, 16)));
|
|
||||||
|
|
||||||
return new ClientUI(properties, client);
|
return new ClientUI(properties, client);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.ui;
|
package net.runelite.client.ui;
|
||||||
|
|
||||||
|
import javax.swing.text.StyleContext;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.FontFormatException;
|
import java.awt.FontFormatException;
|
||||||
import java.awt.GraphicsEnvironment;
|
import java.awt.GraphicsEnvironment;
|
||||||
@@ -40,14 +41,22 @@ public class FontManager
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
runescapeFont = Font.createFont(Font.TRUETYPE_FONT,
|
Font font = Font.createFont(Font.TRUETYPE_FONT,
|
||||||
FontManager.class.getResourceAsStream("runescape.ttf"))
|
FontManager.class.getResourceAsStream("runescape.ttf"))
|
||||||
.deriveFont(Font.PLAIN, 16);
|
.deriveFont(Font.PLAIN, 16);
|
||||||
|
ge.registerFont(font);
|
||||||
|
|
||||||
|
runescapeFont = StyleContext.getDefaultStyleContext()
|
||||||
|
.getFont(font.getName(), Font.PLAIN, 16);
|
||||||
ge.registerFont(runescapeFont);
|
ge.registerFont(runescapeFont);
|
||||||
|
|
||||||
runescapeSmallFont = Font.createFont(Font.TRUETYPE_FONT,
|
Font smallFont = Font.createFont(Font.TRUETYPE_FONT,
|
||||||
FontManager.class.getResourceAsStream("runescape_small.ttf"))
|
FontManager.class.getResourceAsStream("runescape_small.ttf"))
|
||||||
.deriveFont(Font.PLAIN, 16);
|
.deriveFont(Font.PLAIN, 16);
|
||||||
|
ge.registerFont(smallFont);
|
||||||
|
|
||||||
|
runescapeSmallFont = StyleContext.getDefaultStyleContext()
|
||||||
|
.getFont(smallFont.getName(), Font.PLAIN, 16);
|
||||||
ge.registerFont(runescapeSmallFont);
|
ge.registerFont(runescapeSmallFont);
|
||||||
}
|
}
|
||||||
catch (FontFormatException ex)
|
catch (FontFormatException ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user