From ca117c8fab58107db71fe948b121c61c1f7edc14 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Fri, 12 Aug 2022 20:04:26 +0000 Subject: [PATCH] Fix sub region parsing issues (#1) Co-authored-by: sigonasr2 --- readers/DDRReader.java | 17 +++++++++++++++-- readers/fonts/Font.java | 2 +- sub.png | Bin 0 -> 9424 bytes 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 sub.png diff --git a/readers/DDRReader.java b/readers/DDRReader.java index 71da7e3..3be68c9 100644 --- a/readers/DDRReader.java +++ b/readers/DDRReader.java @@ -2,6 +2,7 @@ package readers; import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; +import java.io.File; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; @@ -132,13 +133,19 @@ public class DDRReader extends Reader{ Graphics2D g = cutImg.createGraphics(); int currentHeight=0; for (int i=0;i glyphs = Glyph.split(cutImg); + return f.convertGlyphs(glyphs); + } } return ""; } diff --git a/readers/fonts/Font.java b/readers/fonts/Font.java index af63daf..8c5d4e6 100644 --- a/readers/fonts/Font.java +++ b/readers/fonts/Font.java @@ -184,7 +184,7 @@ public class Font { if (score>bestScore) { bestScore=score; bestGlyph=j; - System.out.println("Glyph "+j+" has a score of "+bestScore+"."); + //System.out.println("Glyph "+j+" has a score of "+bestScore+"."); } } sb.append(bestGlyph); diff --git a/sub.png b/sub.png new file mode 100644 index 0000000000000000000000000000000000000000..060b4786cec936c58c4ca0039cbe734866deb052 GIT binary patch literal 9424 zcmV;>Brn^EP)8RY+TGb*NvpuJ(qaio=yYJhnd87l$9*^nWFupn9CUzB z9AFE74oUuCqKFo<5O)M6qa#QlgaROpFbBqG-}!={`~9Bk>YeGHneEwKEK7gL3fr)3Or6S~dF zxRsVkJ1r9kPuLlmG7Tt$xU5V$S((J~DJv_}mLW6TG9Kx;owgCz(5#hnw}_v2a;y0IydB~PUsBUDXl1~aT&@`v4)~Dl#b%R#AFcL!E{)LQV}UZ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