// GetPadding returns the padding.
554119
func (s Style) GetPadding(defaults ...Box) Box {
	if s.Padding.IsZero() {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return Box{}
	}
	return s.Padding
}
1281484
func pad(align int) func(string, string, int) string {
	padFunc := Pad
	switch align {
	case ALIGN_LEFT:
		padFunc = PadRight
	case ALIGN_RIGHT:
		padFunc = PadLeft
	}
	return padFunc
}
920130
func (v *Xtruct) GetStringThing() (o string) {
	if v != nil && v.StringThing != nil {
		return *v.StringThing
	}

	return
}
641190
func (e *TextEditingEvent) GetText() string {
	length := func(buf []byte) int {
		for i := range buf {
			if buf[i] == 0 {
				return i
			}
		}

		return 0
	}(e.Text[:])

	text := e.Text[:length]
	return string(text)
}
639983
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
	padding := blockSize - len(ciphertext)%blockSize
	if padding < 0 {
		padding = 0
	}

	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
	return append(ciphertext, padtext...)
}
1135191
func (s *Session) GetString(key string, def string) string {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(string)
}
199915
func (n *Resource) GetStrID() string {
	if n == nil {
		return ""
	}
	return fmt.Sprintf("%d", n.ID)
}
1113927
func (r Row) GetString(colIdx int) string {
	col := r.c.columns[colIdx]
	start, end := col.offsets[r.idx], col.offsets[r.idx+1]
	str := string(hack.String(col.data[start:end]))
	return str
}
396997
func (rgc *RasterGraphicContext) GetStringBounds(s string) (left, top, right, bottom float64, err error) {
	f := rgc.GetFont()
	if f == nil {
		err = errors.New("No font loaded, cannot continue")
		return
	}
	rgc.recalc()

	left = math.MaxFloat64
	top = math.MaxFloat64

	cursor := 0.0
	prev, hasPrev := truetype.Index(0), false
	for _, rc := range s {
		index := f.Index(rc)
		if hasPrev {
			cursor += fUnitsToFloat64(f.Kern(fixed.Int26_6(rgc.current.Scale), prev, index))
		}

		if err = rgc.glyphBuf.Load(rgc.current.Font, fixed.Int26_6(rgc.current.Scale), index, font.HintingNone); err != nil {
			return
		}
		e0 := 0
		for _, e1 := range rgc.glyphBuf.Ends {
			ps := rgc.glyphBuf.Points[e0:e1]
			for _, p := range ps {
				x, y := pointToF64Point(p)
				top = math.Min(top, y)
				bottom = math.Max(bottom, y)
				left = math.Min(left, x+cursor)
				right = math.Max(right, x+cursor)
			}
			e0 = e1
		}
		cursor += fUnitsToFloat64(f.HMetric(fixed.Int26_6(rgc.current.Scale), index).AdvanceWidth)
		prev, hasPrev = index, true
	}
	return
}
1171466
func GetColors(bitmap C.MMBitmapRef, x, y int) string {
	clo := GetColor(bitmap, x, y)

	return PadHex(clo)
}
833873
func wrapAtLengthWithPadding(s string, pad int) string {
	wrapped := text.Wrap(s, maxLineLength-pad)
	lines := strings.Split(wrapped, "\n")
	for i, line := range lines {
		lines[i] = strings.Repeat(" ", pad) + line
	}
	return strings.Join(lines, "\n")
}
328843
func Padding(size Size) *trees.Style {
	return &trees.Style{Name: "padding", Value: string(size)}
}
790562
func (s *Skin) GetTail() string {
	s.checkDirection()
	if s.currentDirection.Tail == "" {
		return ""
	}

	s.Width()

	tail := s.currentDirection.Tail
	tail = s.adaptWidth(tail)
	return strings.TrimRight(tail, " ")
}
1126284
func padStringArray(arr []string, l int) []string {
	if l <= len(arr) {
		return arr
	}
	return append(arr, make([]string, l-len(arr))...)
}
184346
func (t *Tabulate) getWidths(headers []string, data []*TabulateRow) []int {
	widths := make([]int, len(headers))
	current_max := len(t.EmptyVar)
	for i := 0; i < len(headers); i++ {
		current_max = runewidth.StringWidth(headers[i])
		for _, item := range data {
			if len(item.Elements) > i && len(widths) > i {
				element := item.Elements[i]
				strLength := runewidth.StringWidth(element)
				if strLength > current_max {
					widths[i] = strLength
					current_max = strLength
				} else {
					widths[i] = current_max
				}
			}
		}
	}

	return widths
}
975511
func PadRight(str string, length int, pad byte) string {
	if len(str) >= length {
		return str
	}
	buf := bytes.NewBufferString(str)
	for i := 0; i < length-len(str); i++ {
		buf.WriteByte(pad)
	}
	return buf.String()
}
742725
func (c *PackageFile) GetString(header, tag int) string {
	if c == nil || header >= len(c.Headers) {
		return ""
	}
	return c.Headers[header].Indexes.StringByTag(tag)
}