summaryrefslogtreecommitdiff
path: root/wasp/fonts/__init__.py
blob: a65ada3d469f2df85d72fc2534097ff775039cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright (C) 2020 Daniel Thompson

import fonts.sans24 as sans24
import fonts.sans28 as sans28
import fonts.sans36 as sans36

def height(font):
    return font.height()

def width(font, s):
    w = 0
    for ch in s:
        (_, _, wc) = font.get_ch(ch)
        w += wc + 1

    return w