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

Use Unicode Block Elements? #2

Open
trevorld opened this issue Jun 12, 2022 · 2 comments · Fixed by #3
Open

Use Unicode Block Elements? #2

trevorld opened this issue Jun 12, 2022 · 2 comments · Fixed by #3
Assignees
Labels
enhancement New feature or request

Comments

@trevorld
Copy link

  • FYI: You can compress your Pixel Pals by using the Unicode Block Elements: https://en.wikipedia.org/wiki/Block_Elements (use one color for "foreground" color and another for "background" color which can be done via {crayon})

    • You can "losslessly" use "full", "top half", "bottom half", and space to vertically pack "two pixels" within a single character (instead of "one pixel" horizontally spread across two characters)
    • I think "lossy" alogrithms to compress even further using Unicode Block Elements do exist (as used by terminal image viewers) but perhaps out of scope...
  • The R packages {bittermelon} and {bdftools} both do this for compactly rendering bitmap fonts glyphs in the terminal e.g. bittermelon::bm_compress():

@gdagstn
Copy link
Owner

gdagstn commented Jun 13, 2022

Thank you, this is great advice - I did not know about block elements. I reckon it should be possible to have a pixel pal that is 2X the resolution at the same size combining background and foreground. Will definitely try!

@gdagstn gdagstn added the enhancement New feature or request label Jun 13, 2022
@gdagstn gdagstn self-assigned this Jun 13, 2022
gdagstn added a commit that referenced this issue Jun 13, 2022
as mentioned in issue #2
@gdagstn gdagstn linked a pull request Jun 13, 2022 that will close this issue
@gdagstn gdagstn reopened this Jun 13, 2022
@gdagstn
Copy link
Owner

gdagstn commented Jun 13, 2022

This works mostly, but I still have some issues in some terminals with different line heights and jagged appearance.

In RStudio I was able to modify the CSS of the theme to have a better line height, but in other terminals this is not always possible. Sys.getenv() does not always work well for detecting the type of terminal. Will have to think more about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants