Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to add a bullet point in front of each item in a list, such as a black circle. How can I achieve that? #371

Open
dwightwu opened this issue Nov 16, 2023 · 2 comments

Comments

@dwightwu
Copy link

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@johnfercher
Copy link
Owner

I think you can add a custom utf8 font and use the UTF8 code of dots. https://www.fileformat.info/info/charset/UTF-8/list.htm

@Thibault-Van-Win
Copy link

I achieved something similar by using the "•" char. You can then make a row where the first cell only contains this bullet point. Example:

func getBulletPoint() core.Component {
	return text.New("•", props.Text{
		Size:  11,
		Style: fontstyle.Normal,
		Align: align.Right,
		Right: 2,
		Color: getBlackColor(),
	})
}

Next you can use it like this:

row.New(5).Add(
   col.New(1).Add(getBulletPoint()),
   col.New(11).Add(text.New("Hello World"), *getRegularTextStyle())),
)

I know this is kind of a hacky solution but it works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants