pull/981/head
gedoor 4 years ago
parent e2e8713bc8
commit 3e237ffb7d
  1. 3
      app/build.gradle
  2. 7
      app/src/main/java/io/legado/app/model/analyzeRule/QueryTTF.java
  3. 3
      build.gradle

@ -97,6 +97,9 @@ android {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
buildToolsVersion '30.0.3' buildToolsVersion '30.0.3'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked"
}
} }
resourcePlaceholders { resourcePlaceholders {

@ -11,7 +11,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@SuppressWarnings({"FieldCanBeLocal", "rawtypes", "StatementWithEmptyBody", "unused"}) @SuppressWarnings({"FieldCanBeLocal", "StatementWithEmptyBody", "unused"})
public class QueryTTF { public class QueryTTF {
private static class Header { private static class Header {
public int majorVersion; public int majorVersion;
@ -223,7 +223,8 @@ 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 Pair[] pps = new Pair[]{ @SuppressWarnings("unchecked")
private final Pair<Integer, Integer>[] pps = new Pair[]{
Pair.of(3, 10), Pair.of(3, 10),
Pair.of(0, 4), Pair.of(0, 4),
Pair.of(3, 1), Pair.of(3, 1),
@ -515,7 +516,7 @@ public class QueryTTF {
private int getGlyfIndex(int code) { private int getGlyfIndex(int code) {
if (code == 0) return 0; if (code == 0) return 0;
int fmtKey = 0; int fmtKey = 0;
for (@SuppressWarnings("unchecked") Pair<Integer, Integer> item : pps) { for (Pair<Integer, Integer> item : pps) {
for (CmapRecord record : Cmap.records) { for (CmapRecord record : Cmap.records) {
if ((item.getLeft() == record.platformID) && (item.getRight() == record.encodingID)) { if ((item.getLeft() == record.platformID) && (item.getRight() == record.encodingID)) {
fmtKey = record.offset; fmtKey = record.offset;

@ -11,6 +11,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.2.0' classpath 'com.android.tools.build:gradle:4.2.0'
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.timfreiheit.resourceplaceholders:placeholders:0.3" classpath "de.timfreiheit.resourceplaceholders:placeholders:0.3"
} }
@ -19,7 +20,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
maven { url 'https://maven.aliyun.com/repository/public/'} maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
maven { url "https://maven.google.com/" } maven { url "https://maven.google.com/" }
} }

Loading…
Cancel
Save