rayzr522 / now-clocking

a conky widget that shows now playing information when music is playing or a clock when music is not playing
49 stars 14 forks source link

Support for Japanese characters #2

Open jgabriel98 opened 4 years ago

jgabriel98 commented 4 years ago

The current fonts does not provide suppor for japanese characters. So in some songs the now-clocking looks like this (squares when on song name, and nothing on artist name):

Captura de tela de 2020-09-17 00-45-04 Captura de tela de 2020-09-17 00-47-00

I am no expert with conky configuration neither with lua, but these where my ideias for solutions:

  1. Use a fallback font (that have japanese characters), so this way the current font looks won't change in most cases, only when it would fail. So in other words: same lookin when everythin is okay, and correct characters instead of squares.

  2. Merge two fonts into one: get the missing japanese characteres from another font, and add to the current missing ones.

I have no ideia how to get font fallback working in conky, so if you could tell me how, i could gadly implement it and open a pull request.

rayzr522 commented 4 years ago

a quick google search turned up no useful results about fallback fonts in conky. I'll have to double check the conky wiki but I'm pretty sure it's just not supported. since there's already a script to download the fonts necessary for this, maybe we could improve this even further by also then patching these fonts with something like Noto Sans CJK chars for Japanese stuff? probably wouldn't look fantastic but it would be better than nothing.

however, patching it on the system would likely be nearly impossible without tons of system dependencies, so I'm thinking maybe we should just patch it once (provide the script to do so if it's ever necessary to do it again), but then just plop it on github so it can simply be downloaded directly and installed like the fonts script currently does now.

some more research is definitely merited, but I think the biggest questions at hand are actually just:

  1. how do we patch two fonts together to create a pseudo-fallback?
  2. what is a good looking font with Japanese character support which we can legally use for this? then again, not sure that we're legally using Montserrat and Gotham Book to begin with...
jgabriel98 commented 4 years ago

Sorry for the wait.

Answering (most of) your two biggest questions:

  1. this superuser post tells how to do it, it uses font forge. I didn't tried yet.
  2. I really don't know, font styles are not my thing. And as a developer i'm not an expert about font legalities. But i don't think that fonts would cause some legal issue, given that this is a "small repository".
jgabriel98 commented 4 years ago

I can try to help with the font merging. Not not now, since i am very busy with my college graduation. And without near free time hopes.

DestroyerAce commented 1 year ago

Thanks for recommending font merging It works like charm

jgabriel98 commented 1 year ago

Happy to help @DestroyerAce ! I actually didn't tried myself, and just forgot about this, because was too busy at the time, haha.