Dokumentation zu: text_width(E)

HR Image


SYNOPSIS
        int text_width(string str)

DESCRIPTION
        Returns the approximate screen width of the given string.

        Normally the width is the same as the string length, but this efun
        takes ANSI escape sequences and wide unicode characters into account.
        Thus the result might be smaller or larger than the string length.

        If the string contains line breaks the width of the widest line
        is returned.

        Note that the actual rendering of unicode strings is entirely
        dependent upon the client's capabilities, regional context and the
        fonts used there. So this efun will only return a guess for the
        displayed width.

EXAMPLES
        text_width("\e[1mHeya!\e[0m") -> 5

HISTORY
        Introduced in LDMud 3.6.2.

SEE ALSO
        sizeof(E)


Start » Magierhandbuch » Docu » Efun » Text_width Letzte Generierung: 25.04.2021, 01:58
Email an: mud@wl.mud.de
Valid HTML 4.01!