mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Add send/recv/render support for text stories.
This commit is contained in:
committed by
Cody Henthorne
parent
3a2e8b9b19
commit
ff8d7fa6c2
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.fonts
|
||||
import android.graphics.Typeface
|
||||
import androidx.annotation.DrawableRes
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.StoryTextPost
|
||||
|
||||
/**
|
||||
* Describes which font the user wishes to render content in.
|
||||
@@ -13,4 +14,18 @@ enum class TextFont(@DrawableRes val icon: Int, val fallbackFamily: String, val
|
||||
SERIF(R.drawable.ic_font_serif, "serif", Typeface.NORMAL, false),
|
||||
SCRIPT(R.drawable.ic_font_script, "serif", Typeface.BOLD, false),
|
||||
CONDENSED(R.drawable.ic_font_condensed, "sans-serif", Typeface.BOLD, true);
|
||||
|
||||
companion object {
|
||||
fun fromStyle(style: StoryTextPost.Style): TextFont {
|
||||
return when (style) {
|
||||
StoryTextPost.Style.DEFAULT -> REGULAR
|
||||
StoryTextPost.Style.REGULAR -> REGULAR
|
||||
StoryTextPost.Style.BOLD -> BOLD
|
||||
StoryTextPost.Style.SERIF -> SERIF
|
||||
StoryTextPost.Style.SCRIPT -> SCRIPT
|
||||
StoryTextPost.Style.CONDENSED -> CONDENSED
|
||||
StoryTextPost.Style.UNRECOGNIZED -> REGULAR
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user