mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 05:37:48 +02:00
fix(core/message_exporter): update font path
This commit is contained in:
@ -205,28 +205,28 @@ class MessageExporter(
|
|||||||
runCatching {
|
runCatching {
|
||||||
ZipFile(context.bridgeClient.getApplicationApkPath()).use { apkFile ->
|
ZipFile(context.bridgeClient.getApplicationApkPath()).use { apkFile ->
|
||||||
//export rawinflate.js
|
//export rawinflate.js
|
||||||
apkFile.getEntry("assets/web/rawinflate.js").let { entry ->
|
apkFile.getEntry("assets/web/rawinflate.js")?.let { entry ->
|
||||||
output.write("<script>".toByteArray())
|
output.write("<script>".toByteArray())
|
||||||
apkFile.getInputStream(entry).copyTo(output)
|
apkFile.getInputStream(entry).copyTo(output)
|
||||||
output.write("</script>\n".toByteArray())
|
output.write("</script>\n".toByteArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
//export avenir next font
|
//export avenir next font
|
||||||
apkFile.getEntry("res/font/avenir_next_medium.ttf").let { entry ->
|
apkFile.getEntry("assets/web/avenir_next_medium.ttf")?.let { entry ->
|
||||||
val encodedFontData = Base64.Default.encode(apkFile.getInputStream(entry).readBytes())
|
val encodedFontData = Base64.Default.encode(apkFile.getInputStream(entry).readBytes())
|
||||||
output.write("""
|
output.write("""
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Avenir Next';
|
font-family: 'Avenir Next';
|
||||||
src: url('data:font/truetype;charset=utf-8;base64, $encodedFontData');
|
src: url('data:font/truetype;charset=utf-8;base64, $encodedFontData');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
""".trimIndent().toByteArray())
|
""".trimIndent().toByteArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
apkFile.getEntry("assets/web/export_template.html").let { entry ->
|
apkFile.getEntry("assets/web/export_template.html")?.let { entry ->
|
||||||
apkFile.getInputStream(entry).copyTo(output)
|
apkFile.getInputStream(entry).copyTo(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user