1717
1818package com.lambda.graphics.renderer.gui.font.glyph
1919
20+ import com.github.kittinunf.fuel.Fuel
21+ import com.github.kittinunf.fuel.core.FuelManager
22+ import com.github.kittinunf.fuel.core.Method
23+ import com.github.kittinunf.fuel.core.await
24+ import com.github.kittinunf.fuel.core.awaitResponse
25+ import com.github.kittinunf.fuel.core.awaitUnit
26+ import com.github.kittinunf.fuel.core.responseUnit
2027import com.google.common.math.IntMath.pow
2128import com.lambda.Lambda.LOG
2229import com.lambda.graphics.texture.MipmapTexture
23- import com.lambda.http.Method
24- import com.lambda.http.request
2530import com.lambda.module.modules.client.RenderSettings
31+ import com.lambda.util.FolderRegister.cache
2632import com.lambda.util.math.Vec2d
2733import java.awt.Color
2834import java.awt.Graphics2D
@@ -33,7 +39,6 @@ import javax.imageio.ImageIO
3339import kotlin.math.ceil
3440import kotlin.math.log2
3541import kotlin.math.sqrt
36- import kotlin.time.Duration.Companion.days
3742
3843class EmojiGlyphs (zipUrl : String ) {
3944 private val emojiMap = mutableMapOf<String , GlyphInfo >()
@@ -54,9 +59,11 @@ class EmojiGlyphs(zipUrl: String) {
5459 }
5560
5661 private fun downloadAndProcessZip (zipUrl : String ) {
57- val file = request(zipUrl) {
58- method(Method .GET )
59- }.maybeDownload(" emojis.zip" , maxAge = 30 .days)
62+ val file = cache.resolve(" emojis.zip" ).toFile()
63+
64+ Fuel .download(zipUrl, Method .GET )
65+ .fileDestination { _, _ -> file }
66+ .responseUnit()
6067
6168 fontTexture = MipmapTexture (processZip(file))
6269 }
0 commit comments