// StringWidth return width as you can see
2629
func (c *Condition) StringWidth(s string) (width int) {
	if c.ZeroWidthJoiner {
		return c.stringWidthZeroJoiner(s)
	}
	return c.stringWidth(s)
}
1040870
func (s *DetectedProperties) SetWidth(v int64) *DetectedProperties {
	s.Width = &v
	return s
}
1054663
func (c *Label) GetWidth() int {
	if c.width == -1 {
		if c.bordered {
			return len(c.value) + 2
		}
		return len(c.value)
	}
	return c.width
}
547878
func Dimensions(width, height float64) PrintToPDFOption {
	return func(o map[string]interface{}) {
		o["paperWidth"] = width
		o["paperHeight"] = height
	}
}
380313
func (f *SexpField) FieldWidths() []int {
	hash := (*SexpHash)(f)
	wide := []int{}
	for _, key := range hash.KeyOrder {
		val, err := hash.HashGet(nil, key)
		str := ""
		if err == nil {
			switch s := key.(type) {
			case *SexpStr:
				str += s.S + ":"
			case *SexpSymbol:
				str += s.name + ":"
			default:
				str += key.SexpString(nil) + ":"
			}
			wide = append(wide, len(str))
			wide = append(wide, len(val.SexpString(nil))+1)
		} else {
			panic(err)
		}
	}
	return wide
}
448703
func OptionSetWidth(s int) Option {
	return func(p *ProgressBar) {
		p.config.width = s
	}
}
309861
func (gp *GoPdf) SetLineWidth(width float64) {
	gp.curr.lineWidth = gp.UnitsToPoints(width)
	gp.getContent().AppendStreamSetLineWidth(gp.UnitsToPoints(width))
}
1099447
func (s *Skin) SetWidth(width int) error {
	if width < s.Width() {
		s.width = s.Width()
		//return fmt.Errorf("this skin minimum width is '%d'", s.Width())
		return nil
	}
	s.width = width
	return nil
}
1302218
func StringLength(str string) (strlen int) {
	str = vtclean.Clean(str, false)
	for str != "" {
		_, rest, runeWidth := ReadRune(str)
		str = rest
		strlen += runeWidth
	}
	// Alternative:
	// strlen = utf8.RuneCountInString(str)
	// Alternative:
	// var ia norm.Iter
	// ia.InitString(norm.NFKD, str)
	return
}
1231236
func IsVariableWidth(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str)
}
1050349
func ConvertBandwidth(bandwidth string) int64 {
	var rate int64

	const (
		kilobytes = 1024
		megabytes = 1024 * kilobytes
		gigabytes = 1024 * megabytes
	)

	regex := regexp.MustCompile("[0-9]+")
	bw := regex.FindAllString(bandwidth, -1)
	bwParseInt, err := strconv.ParseInt(bw[0], 10, 64)
	if err != nil {
		log.Errorf("error converting bandwidth string to uint64 %+v", err)
	}
	if strings.ContainsAny(bandwidth, "g|G") {
		rate = gigabytes
	} else if strings.ContainsAny(bandwidth, "m|M") {
		rate = megabytes
	} else if strings.ContainsAny(bandwidth, "k|K") {
		rate = kilobytes
	}
	bwInt := bwParseInt * rate
	bwInt = bwInt / 1000

	return bwInt
}
1014726
func (b *Bound) Width() float64 {
	return b.ne.X() - b.sw.X()
}
303342
func (s *VideoMetadata) SetFrameWidth(v int64) *VideoMetadata {
	s.FrameWidth = &v
	return s
}
407179
func (i *ASCIIArt) GetWidth() int {
	// Find the longest line
	var ret int
	for j := range i.contents {
		if len(i.contents[j]) > ret {
			ret = len(i.contents[j])
		}
	}
	return ret
}
518107
func getWidth() int {
	stdoutFd := int(wrappedstreams.Stdout().Fd())
	stderrFd := int(wrappedstreams.Stderr().Fd())

	w := getWidthFd(stdoutFd)
	if w < 0 {
		w = getWidthFd(stderrFd)
	}

	return w
}
273335
func (pb *Bar) SetWidth(width int) *Bar {
	pb.Width = width
	pb.ForceWidth = true
	return pb
}
1079305
func (s *Sheet) SetColWidth(startcol, endcol int, width float64) error {
	if startcol > endcol {
		return fmt.Errorf("Could not set width for range %d-%d: startcol must be less than endcol.", startcol, endcol)
	}
	end := endcol + 1
	s.maybeAddCol(end)
	for ; startcol < end; startcol++ {
		s.Cols[startcol].Width = width
	}

	return nil
}