File: codepoint_width.h

package info (click to toggle)
mpv 0.41.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,404 kB
  • sloc: ansic: 155,875; python: 1,235; sh: 643; javascript: 612; cpp: 468; objc: 302; pascal: 49; xml: 29; makefile: 18
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);