mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
3feeeb8d5b
commit
9c6949186c
@ -456,6 +456,7 @@ interface JsExtensions {
|
|||||||
*/
|
*/
|
||||||
fun queryTTF(str: String?): QueryTTF? {
|
fun queryTTF(str: String?): QueryTTF? {
|
||||||
str ?: return null
|
str ?: return null
|
||||||
|
try {
|
||||||
val key = md5Encode16(str)
|
val key = md5Encode16(str)
|
||||||
var qTTF = CacheManager.getQueryTTF(key)
|
var qTTF = CacheManager.getQueryTTF(key)
|
||||||
if (qTTF != null) return qTTF
|
if (qTTF != null) return qTTF
|
||||||
@ -478,6 +479,10 @@ interface JsExtensions {
|
|||||||
qTTF = QueryTTF(font)
|
qTTF = QueryTTF(font)
|
||||||
CacheManager.put(key, qTTF)
|
CacheManager.put(key, qTTF)
|
||||||
return qTTF
|
return qTTF
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Timber.e(e, "获取字体处理类出错")
|
||||||
|
throw e
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user