mirror of
https://github.com/crazy-max/diun.git
synced 2025-01-12 19:48:12 +00:00
24 lines
489 B
Go
24 lines
489 B
Go
package text
|
|
|
|
// Direction defines the overall flow of text. Similar to bidi.Direction, but
|
|
// simplified and specific to this package.
|
|
type Direction int
|
|
|
|
// Available Directions.
|
|
const (
|
|
Default Direction = iota
|
|
LeftToRight
|
|
RightToLeft
|
|
)
|
|
|
|
// Modifier returns a character to force the given direction for the text that
|
|
// follows the modifier.
|
|
func (d Direction) Modifier() string {
|
|
switch d {
|
|
case LeftToRight:
|
|
return "\u202a"
|
|
case RightToLeft:
|
|
return "\u202b"
|
|
}
|
|
return ""
|
|
}
|