diff --git a/res/DroidSansFallback.ttf b/res/DroidSansFallback.ttf new file mode 100644 index 00000000..2b751139 Binary files /dev/null and b/res/DroidSansFallback.ttf differ diff --git a/res/kochi-gothic.ttf b/res/kochi-gothic.ttf deleted file mode 100644 index 68c9ac85..00000000 Binary files a/res/kochi-gothic.ttf and /dev/null differ diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index 5fd49caf..effad0f1 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -823,13 +823,12 @@ public class GameData { g.setColor(Utils.COLOR_BLACK_ALPHA); g.fillRect(0, 0, width, 100 * uiScale); rankingTitle.draw((width * 0.97f) - rankingTitle.getWidth(), 0); - float c = width * 0.01f; - Utils.FONT_LARGE.drawString(c, c, + float marginX = width * 0.01f, marginY = height * 0.002f; + Utils.FONT_LARGE.drawString(marginX, marginY, String.format("%s - %s [%s]", osu.getArtist(), osu.getTitle(), osu.version), Color.white); - Utils.FONT_MEDIUM.drawString(c, c + Utils.FONT_LARGE.getLineHeight() - 6, + Utils.FONT_MEDIUM.drawString(marginX, marginY + Utils.FONT_LARGE.getLineHeight() - 6, String.format("Beatmap by %s", osu.creator), Color.white); - Utils.FONT_MEDIUM.drawString( - c, c + Utils.FONT_LARGE.getLineHeight() + Utils.FONT_MEDIUM.getLineHeight() - 10, + Utils.FONT_MEDIUM.drawString(marginX, marginY + Utils.FONT_LARGE.getLineHeight() + Utils.FONT_MEDIUM.getLineHeight() - 10, String.format("Played on %s.", scoreData.getTimeString()), Color.white); // mod icons diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index d208d585..28a8f2a6 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -69,7 +69,7 @@ public class Options { public static final File SCORE_DB = new File(DATA_DIR, ".opsu_scores.db"); /** Font file name. */ - public static final String FONT_NAME = "kochi-gothic.ttf"; + public static final String FONT_NAME = "DroidSansFallback.ttf"; /** Version file name. */ public static final String VERSION_FILE = "version"; diff --git a/src/itdelatrisu/opsu/OsuGroupNode.java b/src/itdelatrisu/opsu/OsuGroupNode.java index 9988f1de..721f58d8 100644 --- a/src/itdelatrisu/opsu/OsuGroupNode.java +++ b/src/itdelatrisu/opsu/OsuGroupNode.java @@ -80,7 +80,7 @@ public class OsuGroupNode { } bg.draw(x, y, bgColor); - float cx = x + (bg.getWidth() * 0.05f); + float cx = x + (bg.getWidth() * 0.043f); float cy = y + (bg.getHeight() * 0.2f) - 3; // draw grade @@ -96,10 +96,10 @@ public class OsuGroupNode { Utils.loadGlyphs(Utils.FONT_DEFAULT, null, osu.artistUnicode); } Utils.FONT_MEDIUM.drawString(cx, cy, osu.getTitle(), textColor); - Utils.FONT_DEFAULT.drawString(cx, cy + Utils.FONT_MEDIUM.getLineHeight() - 4, + Utils.FONT_DEFAULT.drawString(cx, cy + Utils.FONT_MEDIUM.getLineHeight() - 2, String.format("%s // %s", osu.getArtist(), osu.creator), textColor); if (expanded || osuFiles.size() == 1) - Utils.FONT_BOLD.drawString(cx, cy + Utils.FONT_MEDIUM.getLineHeight() + Utils.FONT_DEFAULT.getLineHeight() - 8, + Utils.FONT_BOLD.drawString(cx, cy + Utils.FONT_MEDIUM.getLineHeight() + Utils.FONT_DEFAULT.getLineHeight() - 4, osu.version, textColor); } diff --git a/src/itdelatrisu/opsu/UI.java b/src/itdelatrisu/opsu/UI.java index b5a2e95c..fd5c5792 100644 --- a/src/itdelatrisu/opsu/UI.java +++ b/src/itdelatrisu/opsu/UI.java @@ -193,7 +193,7 @@ public class UI { public static void drawTab(float x, float y, String text, boolean selected, boolean isHover) { Image tabImage = GameImage.MENU_TAB.getImage(); float tabTextX = x - (Utils.FONT_MEDIUM.getWidth(text) / 2); - float tabTextY = y - (tabImage.getHeight() / 2.5f); + float tabTextY = y - (tabImage.getHeight() / 2); Color filter, textColor; if (selected) { filter = Color.white; diff --git a/src/itdelatrisu/opsu/Utils.java b/src/itdelatrisu/opsu/Utils.java index bdf9b6be..bfa75efe 100644 --- a/src/itdelatrisu/opsu/Utils.java +++ b/src/itdelatrisu/opsu/Utils.java @@ -167,12 +167,12 @@ public class Utils { FONT_MEDIUM = new UnicodeFont(font.deriveFont(fontBase * 3 / 2)); FONT_SMALL = new UnicodeFont(font.deriveFont(fontBase)); ColorEffect colorEffect = new ColorEffect(); - loadFont(FONT_DEFAULT, 2, colorEffect); - loadFont(FONT_BOLD, 2, colorEffect); - loadFont(FONT_XLARGE, 4, colorEffect); - loadFont(FONT_LARGE, 4, colorEffect); - loadFont(FONT_MEDIUM, 3, colorEffect); - loadFont(FONT_SMALL, 1, colorEffect); + loadFont(FONT_DEFAULT, colorEffect); + loadFont(FONT_BOLD, colorEffect); + loadFont(FONT_XLARGE, colorEffect); + loadFont(FONT_LARGE, colorEffect); + loadFont(FONT_MEDIUM, colorEffect); + loadFont(FONT_SMALL, colorEffect); } catch (Exception e) { ErrorHandler.error("Failed to load fonts.", e, true); } @@ -340,15 +340,11 @@ public class Utils { /** * Loads a Unicode font. * @param font the font to load - * @param padding the top and bottom padding * @param effect the font effect * @throws SlickException */ @SuppressWarnings("unchecked") - private static void loadFont(UnicodeFont font, int padding, - Effect effect) throws SlickException { - font.setPaddingTop(padding); - font.setPaddingBottom(padding); + private static void loadFont(UnicodeFont font, Effect effect) throws SlickException { font.addAsciiGlyphs(); font.getEffects().add(effect); font.loadGlyphs(); diff --git a/src/itdelatrisu/opsu/downloads/DownloadNode.java b/src/itdelatrisu/opsu/downloads/DownloadNode.java index f13668f5..5ec1cffe 100644 --- a/src/itdelatrisu/opsu/downloads/DownloadNode.java +++ b/src/itdelatrisu/opsu/downloads/DownloadNode.java @@ -86,7 +86,7 @@ public class DownloadNode { buttonBaseX = width * 0.024f; buttonBaseY = height * 0.2f; buttonWidth = width * 0.7f; - buttonHeight = Utils.FONT_MEDIUM.getLineHeight() * 2f; + buttonHeight = Utils.FONT_MEDIUM.getLineHeight() * 2.1f; buttonOffset = buttonHeight * 1.1f; // download info diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 999b4420..37348bfd 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -270,25 +270,25 @@ public class MainMenu extends BasicGameState { } // draw text - float marginX = width * 0.015f, marginY = height * 0.015f; + float marginX = width * 0.015f, topMarginY = height * 0.01f, bottomMarginY = height * 0.015f; g.setFont(Utils.FONT_MEDIUM); - int lineHeight = Utils.FONT_MEDIUM.getLineHeight() * 9 / 10; + float lineHeight = Utils.FONT_MEDIUM.getLineHeight() * 0.925f; g.drawString(String.format("Loaded %d songs and %d beatmaps.", - OsuGroupList.get().getMapSetCount(), OsuGroupList.get().getMapCount()), marginX, marginY); + OsuGroupList.get().getMapSetCount(), OsuGroupList.get().getMapCount()), marginX, topMarginY); if (MusicController.isTrackLoading()) - g.drawString("Track loading...", marginX, marginY + lineHeight); + g.drawString("Track loading...", marginX, topMarginY + lineHeight); else if (MusicController.trackExists()) { if (Options.useUnicodeMetadata()) // load glyphs Utils.loadGlyphs(Utils.FONT_MEDIUM, osu.titleUnicode, osu.artistUnicode); - g.drawString((MusicController.isPlaying()) ? "Now Playing:" : "Paused:", marginX, marginY + lineHeight); - g.drawString(String.format("%s: %s", osu.getArtist(), osu.getTitle()), marginX + 25, marginY + (lineHeight * 2)); + g.drawString((MusicController.isPlaying()) ? "Now Playing:" : "Paused:", marginX, topMarginY + lineHeight); + g.drawString(String.format("%s: %s", osu.getArtist(), osu.getTitle()), marginX + 25, topMarginY + (lineHeight * 2)); } g.drawString(String.format("opsu! has been running for %s.", Utils.getTimeString((int) (System.currentTimeMillis() - osuStartTime) / 1000)), - marginX, height - marginY - (lineHeight * 2)); + marginX, height - bottomMarginY - (lineHeight * 2)); g.drawString(String.format("It is currently %s.", new SimpleDateFormat("h:mm a").format(new Date())), - marginX, height - marginY - lineHeight); + marginX, height - bottomMarginY - lineHeight); UI.draw(g); } diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 03b23627..70808077 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -344,9 +344,9 @@ public class SongMenu extends BasicGameState { } } marginX += 5; - float headerTextY = marginY; + float headerTextY = marginY * 0.2f; Utils.FONT_LARGE.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[0], Color.white); - headerTextY += Utils.FONT_LARGE.getLineHeight() - 8; + headerTextY += Utils.FONT_LARGE.getLineHeight() - 4; Utils.FONT_DEFAULT.drawString(marginX + iconWidth * 1.05f, headerTextY, songInfo[1], Color.white); headerTextY += Utils.FONT_DEFAULT.getLineHeight() - 2; float speedModifier = GameMod.getSpeedMultiplier();