-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added 24-bit "truecolor" support, tweaked font paths. #18
Conversation
so it can be modified externally. Also added ~/.local/share/fonts to the search list.
Pressing merge not possible because xterm256 practices need to change. |
Is there anything I can do on my end to resolve this? |
I see your handcrafted scene-era x86 assembly demo written in 2015, and raise you a technical primer for a 1960's era computer presented in 2017. |
I'm a fan of Margaret Hamilton's code. I also like to implement telecom systems so they DDOS NASA when entering a failure state. |
I must confess, I get the first reference (I love this picture, almost as much as I love this clip of Delia Derbyshire beatmatching on washing machine-sized reel-to-reel machines), but the second eludes me... Unless, of course, you're truly saying that you like to implement telecom systems so they DDOS NASA when entering a failure state, in which case I'd have to say you're pretty hardcore |
In all seriousness, though, why is this pull request being rejected? I thought I did a fairly decent job of following the existing code style, and the extent of the changes is pretty small. The only thing I didn't do was implement any sort of check for the COLORTERM environment variable, as it seems not all terminals that support 24-bit color set this variable accordingly. Or is this some sort of "256 colors ought to be enough for everybody" thing? |
I'm happy to accept your work. Thank you for your contribution. Do you know why Travis is failing? Also we all love NASA which is why no one would DDOS a telecommunications system that was known to have such a deterrent in place. It also encourages goofballs such as myself to do the best engineering possible. For example, would trivial NPM projects have 13,000 dependencies if developers knew that the consequences of being lazy could potentially impact the brave young men and women risking their lives to help humanity explore the final frontier? |
As for 256 colors being enough for everyone, I've been mostly crossing my fingers hoping someone will come along and implement something that looks like this: That's probably not as good as the 8088 MPH demo. Making it happen turned out to be exceedingly difficult. It requires a certain degree of mastery over the parts of the photon spectrum that computers are allowed to use: |
Apparently python 2.x doesn't like a thing I was doing with asterisks.... It's not a huge change, I'll push a new revision up now. |
Thank you. I still use Python2 so it's much appreciated. |
There were some other errors I saw in Travis related to sphinx and it no longer supporting python 2.6, but those seem to have gone away. I've been fortunate enough to have been able to make a clean break from python 2.x, for the most part... well, except for GIMP. I had a couple of scripts I wrote in python-fu, and didn't realize until just last week that since that hasn't been migrated to 3.x, Ubuntu basically just plain didn't include support for python-fu. D'oh. |
Here's a gist for doing the above that works under python2 and python3. (Birds not included) https://gist.github.com/jaysonlarose/154b0086f77175b5f422714d77d2b127 |
Now do it with unicode half blocks. Please. |
@jason-green-io — Half blocks for you. Because I like your name ;) https://gist.github.com/jaysonlarose/fc86aa38360910669e7762c5b49c7923 Maybe 2021 is the year @jart accepts my pull request! :D |
that — if it's installed — wcwidth.wcswidth will be used for calculating lengths. Only for python 3.x, though.
Since I've been dealing with some stuff that requires me to calculate the in-terminal width of colored unicode text, I've added in a clause so that the fabulous.color.ColorString base class will use the wcwidth module for determining string lengths, if it's installed. I also added a fix for how ColorString calculates the length of bytes objects under Python 3. I mean, it's bad form to treat bytes objects like they're strings without passing them through .decode() under Python 3 to begin with, but at least you'll get back a length that reflects reality: old behavior: >>> print(len(fabulous.color.fg256("green", b"binary bee")))
10
>>> print(fabulous.color.fg256("green", b"binary bee"))
b'binary bee' corrected behavior: >>> print(len(fabulous.color.fg256("green", b"binary bee")))
13
>>> print(fabulous.color.fg256("green", b"binary bee"))
b'binary bee' All of these changes are specific to Python 3.x. I left behavior under Python 2.x unchanged. |
It's me again! I've added a from fabulous.color import *
l = [
fg256("green", "napster good"),
fg256("red", "fire bad"),
]
print(plain(" ").join(l)) |
Thank you. Let's get this merged and pushed to pypi. |
New release posted here: https://github.com/jart/fabulous/releases/tag/0.4.0 I'm having the darndest time getting it to upload to pypi. I put the appropriate values in
Do you have any idea?
|
IIRC |
I tried installing that and I just couldn't believe that it needed rust as a build-time dependency and that no binary releases were available. Surely there's some other way? |
It's probably the cryptography package where you're hitting the problem. That change (rust) caused a fair bit of controversy on the cryptography project tracker: pyca/cryptography#5771 What they recommend is to first upgrade pip before doing the installation: https://github.com/pyca/cryptography/blob/main/docs/installation.rst The easiest way to upgrade pip is to make a virtualenv and update it in there, rather than trying to update your system pip (I don't know how your python is set up). You should be able to install a binary release, if your system matches one of these wheel specs: https://pypi.org/project/cryptography/#files If there isn't a matching wheel for your system then yeah, it's a hard road. p.s. while I have your attention, just let me say your work on redbean is extraordinary, I am in awe. |
I've done as you recommended. I'm proud to say we now have https://pypi.org/project/fabulous/0.4.0/ Enjoy! That's interesting to hear. I'm saddened this kind of library wouldn't target manylinux1. redbean release binaries run on RHEL5. I'm glad you like it! Seeing how difficult it was to distribute native binaries for tensorflow was one of the reasons why I wrote Cosmopolitan Libc. I want the project to eventually evolve in a direction where it can support Python too. We've managed to port python2.7 so far, which can now run as an APE binary. In the future we'll make it able to build Actually Portable Shared Objects for Python extensions specifically that will reduce much of the toil we've seen. One way you can support these efforts is by becoming a github sponsor. |
Created classes
ColorStringTrue
,fgtrue
,bgtrue
,highlighttrue
, andcomplementtrue
to color.py, in order to support the increasing number of terminals that support full 24-bit color.Also made the following changes to text.py:
roots
font directory search list that was embedded intoget_font_files()
out tofont_roots
, so that it can be modified/monkeypatched externally.~/.local/share/fonts
to the font directory search list.