WINDOWS용 EMACS에서 한글,영문 글꼴 달리쓰기

bluecafe의 이미지

안녕하세요 EMACS 왕초보 입니다.

Emacs-22.0.50.1-Cvs051209-emacsw32-0.98.exe 파일을 설치한 후
cinsk 님의 etheme를 설치하는데 까지는 성공했습니다.
(cinsk님 감사합니다. :oops: )

영문폰트는 Bitstream Vera Sans Mon 를 사용하고, 한글 폰트는 돋움체나 굴림체 등을
사용하고 싶어서 나름대로 설정해 보았는데 전혀 바뀌는 것 같지가 않네요..

아래는 제 .emacs파일의 내용입니다. 확실한 차이를 보기 위해서 한글폰트는 궁서체로 해
보려고 했습니다.

EMACS 고수님들의 많은 조언 부탁 드립니다.
그럼..

(setq load-path (cons (expand-file-name "~/.emacs.d/") load-path))
(require 'etheme)
(etheme-set-theme "desert")

; C mode Settings
(add-hook 'c-mode-hook
	  '(lambda()
	     (c-set-style "K&R")))
; tab settings.
(setq-default c-basic-offset 4
      tab-wdth 4
      indent-tabs-mode t)

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(c-basic-offset 4 t)
 '(cua-mode nil)
 '(display-battery-mode nil)
 '(display-time-mode nil)
 '(face-font-family-alternatives (quote (("Bitstream Vera Sans Mono" "fixed") ("굴림체" "helvetica" "arial" "fixed"))))
 '(show-paren-mode nil))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(cursor ((t nil)) t))


;(setq default-frame-alist
;      (append
;       '((font . (create-fontset-from-ascii-font
;		  "-outline-Bitstream Vera Sans-normal-i-normal-normal-*-*-96-96-p-*-iso8859-15")))
;       default-frame-alise))

(create-fontset-from-fontset-spec
 "-outline-Bitstream Vera Sans-normal-i-normal-normal-*-*-96-96-p-fontset-default,
  korean-ksc5601:-outline-궁서체-normal-r-normal-normal-*-*-96-96-c-*-iso8859-4" t)
bluecafe의 이미지

아래의 사이트에서 이런 것을 찾았습니다.
http://emacs.kldp.org/wiki/doku.php?id=qanda

Quote:

Q) 윈도우즈에서 GNU Emacs 사용시 몇가지 문제점을 해결하고자 합니다.

폰트가 매우 보기 안좋은데 윈도우즈 환경에서 폰트설정은 어떻게 해야 하나요? 그리고 윈도우즈 환경에서 특화된 Emacs 설정파일을 구할순 없을까요? 윈도우즈 환경에서 emacs를 사용하시는 분들의 많은 조언을 부탁드립니다.

A) 가장 간단한 방법은

(set-face-font 'default "글꼴_이름")

입니다. 가장 간단한 방법이지만 문제가 하나 있습니다. 바로 Emacs 실행된 후에 글꼴을 바꿀 수 없다는 것이지요.


또한 아래의 사이트에는 이런 글이 있더군요.

http://www.emacswiki.org/cgi-bin/wiki/FontSets

Quote:

If you are content with Emacs' default fonts and just want to change the font for a particular character set; you can use the predifined fontset "fontset-standard" and change only that character set from Lisp:

;; Use the predefined fontset "fontset-standard"
(set-face-font 'default "fontset-standard")

;; In "fontset-standard" use "misc fixed" for the charset
;; `mule-unicode-0100-24ff'
(set-fontset-font "fontset-standard"
'mule-unicode-0100-24ff
"-*-fixed-medium-r-*-*-11-*-*-*-*-*-iso10646-1")


그래서 이렇게 한번 해 보았습니다만 한글이 전부 깨져 버리네요..
    (set-fontset-font "fontset-standard"
                      'korean-ksc5601
                      "-*-Gulim-normal-r-*-*-12-*-*-*-c-*-ksc5601-*")

한글이 깨지는 원인이 아래 사이트에서 제가 찾은 내용과 관련이 있는 것인지 궁금합니다. 잘 아시는 분의 조언 부탁 드릴께요..
( 당분간은 굴림체, 9 로 만족해야 겠네요.. :wink: )

Quote:
http://www.gnu.org/software/emacs/windows/big.html#multibyte-fontset
If you require support for a number of languages, you should use `create-fontset-from-fontset-spec'. Note that installing more than one of the East Asian language packs is not supported by Microsoft, and does not work on Windows 95 at least. It is very difficult to get your system stable again after trying, so it is recommended that you only install the one that you will use the most, and use BDF fonts for the other languages
cinsk의 이미지

안타깝게도. 전 emacs를 Windows에서 쓴 경험이 거의 없습니다. :oops:

보통 UNIX에서 fontset을 만드는 것은 X resource를 쓰는 방법을 많이 쓰는데, 질문하신 것처럼 코드에서 create-fontset-from-fontset-spec을 써서 만들 수 있습니다. 질문하신 것처럼, 영문 폰트와 한글 폰트를 따로 지정하는 것도 가능합니다.

첫째, fontset 이름은, 폰트 spec의 맨 마지막 두 필드(charset-registry)를 제거하고 fontset-xxxx 형태로 이름을 짓습니다. 그리고, 영문 폰트 charset 이름은 ascii, 한글 폰트 charset 이름은 korean-ksc5601로 합니다. 예를 들면 다음과 같습니다:

(create-fontset-from-fontset-spec "-*-terminus-*-*-*-*-16-*-*-*-*-*-fontset-term16,
  ascii:-*-terminus-*-*-*--16-*-*-*-*-*-*-*,
 korean-ksc5601:-*-gulim-*-*-*--16-*-*-*-*-*-ksx1001.1998-*")

그리고 나서 다음과 같이 현재 font를 바꿔줍니다:

(set-face-font 'default "fontset-term16")

현재 프레임에만 적용할려면 세번째 optional 인자에 프레임 정보를 주면 됩니다. 예를 들어서 M-x new-frame 등으로 frame을 여러 개 띄운 경우, 현재 프레임의 폰트만을 바꾸려면 다음과 같이 합니다:

(set-face-font 'default "fontset-term16" (selected-frame))
bluecafe의 이미지

감사합니다.
하지만 역시 아래와 같은 코드로도 한글만 다 깨져서 나오네요..
C-s 를 이용한 찾기에도 한글이 인식되는것 같기는 하나 화면에서는 여전히 깨져서 나옵니다.

(create-fontset-from-fontset-spec
 "-*-Bitstream Vera Sans Mono-normal-r-*-*-12-*-*-*-c-*-fontset-bluecafe,
  ascii:-outline-Bitstream Vera Sans Mono-normal-*-normal-normal-*-*-96-96-c-*-*,
korean-ksc5601:-outline-굴림체-normal-r-normal-normal-12-*-96-96-c-*-ksc5601.1987")

(set-face-font 'default "fontset-bluecafe")

;(set-face-font 'default "-*-돋움체-normal-r-*-*-12-*-*-*-c-*-ksc5601-*")   ;응급 복구용
cinsk의 이미지

지금 제게 Windows machine이 없어서 테스트할 수가 없군요. 회사 가서 한 번 더 해보겠습니다.

익명사용자의 이미지

cinsk님의 답변을 보고

(create-fontset-from-fontset-spec "-*-Courier new-*-*-*-*-16-*-*-*-*-*-fontset-term16,
ascii:-*-Courier new-normal-r-normal-*-16-*-*-*-*-*-*-*,
korean-ksc5601:-*-굴림체-normal-r-normal-normal-16-*-96-96-c-*-ksc5601.1987-*")
 
(set-face-font 'default "fontset-term16")

이렇게 했더니 잘 됩니다.

korean-ksc5601:-*-굴림체-normal-r-normal-normal-16-*-96-96-c-*-ksc5601.1987-*")

이 라인의 맨 끝에 -*를 안 붙이면 글자가 다 깨져서 나오는군요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.