naver / d2codingfont

D2 Coding 글꼴
1.93k stars 201 forks source link

X11에서의 metadata issue 와 xterm 에서의 kerning issue #76

Open clayjar opened 5 years ago

clayjar commented 5 years ago

RE: D2Coding-Ver1.3.2-20180524

GNU/Linux 에서 D2Coding 폰트를 설치하고 xterm 에서 적용하게 되면 글씨 간격이 조금 크게 보입니다. (Similar to https://github.com/naver/d2codingfont/issues/72 ?) 어떤 방법으로도 kerning 조절이 되지 않는 것 같고요. 윈도우의 putty, OS X 에서의 iTerm 에서와 X11+KDE의 Konsole 에서는 바르게 보이지만 X11의 xterm 에서 사용시 글씨 간격이 조금 크게 나오고 있습니다. Fira Code 나 PragmataPro 같은 다른 코딩을 위해 만들어진 폰트들은 이런 문제가 없어 보입니다.

Environment

[mhan@chara ~]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:prin
Distributor ID: CentOS
Description:    CentOS Linux release 7.5.1804 (Core) 
Release:        7.5.1804
Codename:       Core
[mhan@chara ~]$ uname -a
Linux chara 4.17.9-1.el7.elrepo.x86_64 #1 SMP Sun Jul 22 11:57:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
[mhan@chara ~]$ xdpyinfo|grep -i version
version number:    11.0
X.Org version: 1.19.5
[mhan@chara ~]$ echo $XDG_CURRENT_DESKTOP - $GDMSESSION
i3 - i3

Metadata issue

다음과 같은 방법으로 목록을 불러오면 설치된 폰트들은 다 바로 나오는데 D2Coding 만 목록에서 보이지 않는 것으로 보아 제 생각으로는 폰트 자체적인 meta 정보의 부족으로 시스템에 바르게 적용이 바로 되고 있지 않는 것 같습니다.

$ fc-list :scalable=true:spacing=mono: family
Andale Mono
Webdings
Fira Code
DejaVu Sans Mono
Fira Code,Fira Code Retina
Envy Code R for Powerline
Fira Mono
Fira Code,Fira Code Medium
Fira Mono,Fira Mono Medium
Liberation Mono
PragmataPro
Consolas
Fira Code,Fira Code Light
Courier New
FreeMono

Konsole 에서도 사실 Monospace 폰트 목록에서 보이지 않아 편집기를 이용해 직접 삽입하는 방법으로 사용이 가능한 것을 확인하였습니다.

metadata를 쿼리해보면 딱히 큰 차이는 없어 보입니다. fc-query를 통해 PragmataPro 와 비교해 보면...

$ fc-query PragmataPro.ttf
Pattern has 23 elts (size 32)
        family: "PragmataPro"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "PragmataPro"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(i)(s)
        width: 100(i)(s)
        spacing: 100(i)(s)
        foundry: "unknown"(s)
        file: "PragmataPro.ttf"(s)
        index: 0(i)(s)
        outline: True(s)
        scalable: True(s)
        charset:
        0000: 00002001 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff ffefffff bbfffbff ffffffff ffffffff
        .... (생략)
        lang: aa|af|av|ay|be|bg|bi|br|bs|ca|ce|ch|co|cs|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|ga|gd|gl|gv|he|ho|hr|hu|ia|id|ie|ik|io|is|it|ki|kl|kum|kw|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sco|se|sel|sk|sl|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tk|tl|tn|tr|ts|uk|uz|vo|vot|wa|wen|wo|xh|yap|yi|zu|an|crh|csb|fil|hsb|ht|jv|kj|kr|ku-tr|kwm|lg|li|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za(s)
        fontversion: 524(i)(s)
        capability: "otlayout:cyrl otlayout:grek otlayout:latn"(s)
        fontformat: "TrueType"(s)
        decorative: False(s)
        hash: "sha256:0b2081b24d6a0515a5cb7cebcaaf238e9a7e4ba713dd59ad93b946d4f936afb9"(s)
        postscriptname: "PragmataPro"(s)

다음은 D2Coding 입니다.

$ fc-query D2Coding.ttf
Pattern has 22 elts (size 32)
        family: "D2Coding"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "D2Coding"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(i)(s)
        width: 100(i)(s)
        spacing: 90(i)(s)
        foundry: "unknown"(s)
        file: "D2Coding.ttf"(s)
        index: 0(i)(s)
        outline: True(s)
        scalable: True(s)
        charset:
        0000: ffffffff ffffffff ffffffff ffffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 00000000 00000000
        ... (생략)
        lang: aa|af|av|ay|be|bg|bi|br|bs|bua|ca|ce|ch|chm|co|cs|cv|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|haw|ho|hr|hu|ia|id|ie|ik|io|is|it|kaa|ki|kk|kl|ko|ku-am|kum|kv|ky|la|lb|lez|lt|lv|mg|
mh|mk|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|sah|se|sel|shs|sk|sl|sm|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tk|tl|tn|to|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr
|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|qu|quz|rn|rw|sc|sg|sn|su|ty|za(s)
        fontversion: 65667(i)(s)
        fontformat: "TrueType"(s)
        decorative: False(s)
        hash: "sha256:8b1b23e5de4dff652fb0b938528150d2f531edfda281d3944618b655711aba84"(s)
        postscriptname: "D2Coding"(s)

제가 보기에는 D2Coding 에는 capability field 가 없다는 것 과 fontversion 의 가치수가 매우 높다는 것 뿐입니다. Kerning 문제를 일으킬만한 요소들 같지는 않습니다만 문제를 파악하는데 있어 도움이 될까해서 올렸습니다.

Kerning issue in xterm

~/.Xresources 파일에는 이런 식으로 들어가 있습니다.

xterm*faceName: D2Coding
xterm*faceSize: 12

참고로 (1) xterm/PragmataPro, (2) konsole/D2Coding, (3) xterm/D2Coding 올립니다. 다 같은 window dimension 으로 screen capture 하여 올립니다. 2018-08-20_231732_684615293 2018-08-20_232137_816463840 2018-08-20_231949_454591898

Screwtapello commented 5 years ago
$ fc-query D2Coding.ttf
Pattern has 22 elts (size 32)
        family: "D2Coding"(s)
        ...
        spacing: 90(i)(s)

spacing: 90 = spacing: dual

spacing: 100 = spacing: mono

Therefore fc-list :spacing=mono will not find D2Coding.

clayjar commented 5 years ago
$ fc-query D2Coding.ttf
Pattern has 22 elts (size 32)
        family: "D2Coding"(s)
        ...
        spacing: 90(i)(s)

spacing: 90 = spacing: dual

spacing: 100 = spacing: mono

Therefore fc-list :spacing=mono will not find D2Coding.

Using the same logic, PragmataPro shouldn't be listed as well, so I think fc-list is filtering on something else. Besides, I could care less about D2Coding getting listed. I just want it to display properly when I use it in my dev environment. Seeing how inactive this thread is, I'm guessing others don't use Linux for their dev work. I'll probably move onto using some other font as this font isn't very usable in my env, although it seems to work well under Windows or OS X. I wish more Korean devs would use Linux for their dev work because there's a severe lack of updated Korean IME for it too.