sudipshil9862 / whichfont

Querying fontconfig for certain code point
GNU General Public License v3.0
1 stars 1 forks source link

add option to print utf8 hex sequence #2

Closed juhp closed 1 year ago

juhp commented 1 year ago
$ whichfont ' '
Character:  
NuosuSIL-Regular.ttf: "Nuosu SIL" "Regular"

It would be useful here to know the utf8 hex sequence for the character

juhp commented 1 year ago

Searching it seems in this case the character is U+3000 (Ideographic Space)

sudipshil9862 commented 1 year ago

adding -u to print unicode

sudipshil9862 commented 1 year ago

feature added

sudipshil9862 commented 1 year ago

example:1

$ ./run.sh অA input_char: অA

Character: অ Lohit-Bengali.ttf: "Lohit Bengali" "Regular"

Character: A NotoSans[wght].ttf: "Noto Sans" "Regular"


example:2

$ ./run.sh -u অA ninja: no work to do. input_char: অA

Character: অ unicode: U+0041 Lohit-Bengali.ttf: "Lohit Bengali" "Regular"

Character: A unicode: U+0041 NotoSans[wght].ttf: "Noto Sans" "Regular"

juhp commented 1 year ago
$ whichfont অA
:
Character: অ
unicode: U+0041
:

clearly incorrect, though it works for single character

juhp commented 1 year ago

Also I think it would be okay to write the character and codepoint on the same line.

sudipshil9862 commented 1 year ago

understood the problem

sudipshil9862 commented 1 year ago

it was a problem of printing wrong unicode.