Tweak text sizing slightly

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
Marcus Noble 2022-02-21 16:57:27 +00:00
parent 091f6a455e
commit 7f14289760
Signed by: AverageMarcus
GPG Key ID: B8F2DB8A7AEBAF78
2 changed files with 8 additions and 2 deletions

View File

@ -74,8 +74,8 @@ var charWidths = map[string]float64{
"%": 18.416671752929688,
"^": 9.683334350585938,
"*": 9.683334350585938,
"(": 7,
")": 7,
"(": 7.8,
")": 7.8,
"-": 10.300003051757812,
"_": 9.73333740234375,
"=": 14.333328247070312,

View File

@ -214,6 +214,12 @@ func calculateHeight(tweet anaconda.Tweet) int64 {
lineHeight = 32.0
}
if strings.HasPrefix(word, "\n") {
height += lineHeight
lineWidth = 0
word = strings.TrimPrefix(word, "\n")
}
if strings.Contains(word, "\n") {
height += lineHeight
lineHeight = 28.0