From 859b49e84842d274841c4c1387d92be4776c7bd4 Mon Sep 17 00:00:00 2001 From: bashbunni <15822994+bashbunni@users.noreply.github.com> Date: Tue, 23 May 2023 11:58:52 -0700 Subject: [PATCH] docs: add FAQ (#189) * docs: add FAQ * chore(docs): update encoding/locale answer in FAQ * chore(docs): update color profile disclaimer * chore(docs): faq copyedits * chore(docs): additional faq copy edits * fix(docs): add missing closing code block in faq --------- Co-authored-by: Christian Rocha --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index a071564e..0fc51bdc 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,45 @@ You can also style the whitespace. For details, see [the docs][docs]. *** +## FAQ + +
+ +Why are things misaligning? Why are borders at the wrong widths? + +

This is most likely due to your locale and encoding, particularly with +regard to Chinese, Japanese, and Korean (for example, zh_CN.UTF-8 +or ja_JP.UTF-8). The most direct way to fix this is to set +RUNEWIDTH_EASTASIAN=0 in your environment.

+ +

For details see https://github.com/charmbracelet/lipgloss/issues/40.

+
+ +
+ +Why isn't Lip Gloss displaying colors? + +

Lip Gloss automatically degrades colors to the best available option in the +given terminal, and if output's not a TTY it will remove color output entirely. +This is common when running tests, CI, or when piping output elsewhere.

+ +

If necessary, you can force a color profile in your tests with +SetColorProfile.

+ +```go +import ( + "github.com/charmbracelet/lipgloss" + "github.com/muesli/termenv" +) + +lipgloss.SetColorProfile(termenv.TrueColor) +``` + +*Note:* this option limits the flexibility of your application and can cause +ANSI escape codes to be output in cases where that might not be desired. Take +careful note of your use case and environment before choosing to force a color +profile. +
## What about [Bubble Tea][tea]?