File: codepoint_width.h

package info (click to toggle)
mpv 0.40.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,676 kB
  • sloc: ansic: 152,062; python: 1,228; sh: 646; javascript: 612; cpp: 461; objc: 302; pascal: 49; xml: 29; makefile: 19
file content (14 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include "misc/bstr.h"

/**
 * @brief Determines the number of columns required to display a given string.
 *
 * @param str Sequence of UTF-8 chars
 * @param max_width Maximum allowed width of string
 * @param cut_pos If max_width is exceeded, this will be initialized to last
 *                full printable character before width limit.
 * @return int width of the string
 */
int term_disp_width(bstr str, int max_width, const unsigned char **cut_pos);