清理无用代码

pull/496/head
Antecer 4 years ago
parent afe9083532
commit a3edc6e25c
  1. 15
      app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java

@ -1,15 +1,12 @@
package io.legado.app.model.analyzeRule; package io.legado.app.model.analyzeRule;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -170,18 +167,10 @@ public class QueryTTF {
return ReadUIntX(8); return ReadUIntX(8);
} }
public long ReadInt64() {
return ReadUIntX(8);
}
public int ReadUInt32() { public int ReadUInt32() {
return (int) ReadUIntX(4); return (int) ReadUIntX(4);
} }
public int ReadInt32() {
return (int) ReadUIntX(4);
}
public int ReadUInt16() { public int ReadUInt16() {
return (int) ReadUIntX(2); return (int) ReadUIntX(2);
} }
@ -233,7 +222,6 @@ public class QueryTTF {
private final List<Integer> Loca = new LinkedList<>(); private final List<Integer> Loca = new LinkedList<>();
private final CmapLayout Cmap = new CmapLayout(); private final CmapLayout Cmap = new CmapLayout();
private final List<GlyfLayout> Glyf = new LinkedList<>(); private final List<GlyfLayout> Glyf = new LinkedList<>();
private final Map<Integer, short[]> UnicodeMap = new LinkedHashMap<>();
private final Pair<Integer, Integer>[] pps = new Pair[]{ private final Pair<Integer, Integer>[] pps = new Pair[]{
Pair.of(3, 10), Pair.of(3, 10),
Pair.of(0, 4), Pair.of(0, 4),
@ -483,11 +471,12 @@ public class QueryTTF {
int gid = GetGlyfIndex(key); int gid = GetGlyfIndex(key);
if (gid == 0) continue; if (gid == 0) continue;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
// 字型数据转String,方便存HashMap
for (short b : Glyf.get(gid).xCoordinates) sb.append(b); for (short b : Glyf.get(gid).xCoordinates) sb.append(b);
for (short b : Glyf.get(gid).yCoordinates) sb.append(b); for (short b : Glyf.get(gid).yCoordinates) sb.append(b);
String val = sb.toString(); String val = sb.toString();
CodeToGlyph.put(key, val); CodeToGlyph.put(key, val);
if(GlyphToCode.containsKey(val)) continue; if (GlyphToCode.containsKey(val)) continue;
GlyphToCode.put(val, key); GlyphToCode.put(val, key);
} }
} }

Loading…
Cancel
Save