ใช้ xterm กับงานภาษาไทย

เทอร์มินัลของ GNOME ดือ gnome-terminal ยังใช้งานภาษาไทยกับ vim ได้ไม่ดีนัก คือการเลื่อนเคอร์เซอร์ไม่ถูกตำแหน่ง และการคัดลอกข้อความด้วยเมาส์ก็ยังคัดลอกแบบผิด ๆ

การนี้ XTerm ใช้งานได้ดีกว่า แต่หน้าตาโบราณไปหน่อย และสีอักษรบนพื้นดำดูยากสักนิด เลยทดลองปรับแต่งดูครับ

สำหรับเดเบียนติดตั้งด้วย

$ sudo aptitude install xterm xfonts-thai xfonts-thai-nectec \
xfonts-thai-poonlap xfonts-thai-vor

สำหรับผม ปรับแต่งให้เป็นพื้นขาว เลียนแบบ gnome-terminal และปรับแต่งตัวหนังสือให้ใหญ่ขึ้น และสีเข้มขึ้นเล็กน้อย

$ vi ~/.Xdefaults
!FONT
*VT100.utf8Fonts.font: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1

!COLOR
*VT100*foreground: grey10
*VT100*background: grey98

*VT100*color0: black
*VT100*color1: red2
*VT100*color2: green4
*VT100*color3: yellow3
*VT100*color4: blue4
*VT100*color5: magenta4
*VT100*color6: cyan4
*VT100*color7: gray90
*VT100*color8: gray50
*VT100*color9: red1
*VT100*color10: green3
*VT100*color11: yellow2
*VT100*color12: rgb:5c/5c/ff
*VT100*color13: magenta
*VT100*color14: cyan3
*VT100*color15: white

ให้ระบบรับรู้ค่าใหม่ของเรา

$ xrdb .Xdefaults

เสร็จแล้ว เรียกใช้ด้วยคำสั่ง

$ xterm

ใช้งานภาษาไทยได้ดีแล้ว

หมายเหตุ

  • ดูชื่อสี ได้จากไฟล์ /etc/X11/rgb.txt
  • ดูตัวอย่างพารามิเตอร์การปรับตั้งได้ที่ /etc/X11/apt-defaults/ ในไฟล์ XTerm และ XTerm-color

เอามาจาก - Xterm Terminal Emulator Options

จากการทดลองพบว่า ยังใช้กับ Truetype Font ไม่ดีคือไม่พิมพ์สระให้ เลยใช้งานกับ Fixed Font แบบโบราณ จึงยังดูไม่สวยเท่า gnome-terminal

Re: ใช้ xterm กับงานภาษาไทย

ขออนุญาตเคลียร์นิดหน่อยนะครับ xfonts-thai* ทั้งหลาย เป็นฟอนต์ TIS-620 นะครับ ส่วนฟอนต์ยูนิโค้ด -misc-fixed-...-iso10646-1 ที่ใช้ในตัวอย่างนั้น มีมากับ xorg เลย อยู่ในแพกเกจ xfonts-base ครับผม

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <blockquote> <img> <h3> <h4> <h5>
  • Lines and paragraphs break automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.