请问如何配置Emacs打印中文
- code vampire
- 帖子: 193
- 注册时间: 2010-06-19 12:50
- 系统: AIX、UBUNTU
- 联系:
请问如何配置Emacs打印中文
直接给配置就好,print和ps-print的设置都没有整出中文,打印时还是方块。不知道该怎么办了。
- code vampire
- 帖子: 193
- 注册时间: 2010-06-19 12:50
- 系统: AIX、UBUNTU
- 联系:
Re: 请问如何配置Emacs打印中文
不会吧,没人配过?
- careone
- 帖子: 839
- 注册时间: 2007-12-17 21:41
Re: 请问如何配置Emacs打印中文
EMACS 版本,文件编码,UBUNTU版本。
请提供案例,错误信息和截图。
请提供案例,错误信息和截图。
魁拔不死,天下不宁。
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
- careone
- 帖子: 839
- 注册时间: 2007-12-17 21:41
Re: 请问如何配置Emacs打印中文
EMACS 版本,文件编码,UBUNTU版本。
请提供案例,错误信息和截图。
请提供案例,错误信息和截图。
魁拔不死,天下不宁。
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
-
- 帖子: 237
- 注册时间: 2011-10-11 10:16
Re: 请问如何配置Emacs打印中文
可能是gb2312 格式,,,这个我一直搞不定。
- code vampire
- 帖子: 193
- 注册时间: 2010-06-19 12:50
- 系统: AIX、UBUNTU
- 联系:
Re: 请问如何配置Emacs打印中文
系统是UBUNTU10.04,Emacs24自己编译的。
配置中关于编码,字体的部分,我的是这样的。
(set-default-font "WenQuanYi Micro Hei Mono-15")
(set-language-environment 'UTF-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
关于打印的配置
(require 'ps-print)
(setq ps-paper-type 'a4
ps-font-size 8.25
ps-print-header nil
ps-landscape-mode nil)
(require 'ps-mule)
(setq ps-multibyte-buffer 'bdf-font)
(setq bdf-directory-list '("/home/codevampire/.emacs.d/fonts"))
(setq ps-mule-font-info-database-bdf '((chinese-gb2312 (normal bdf "gb24st.bdf.bdf") (bold bdf "gb24st.bdf.bdf") (italic bdf "gb24st.bdf.bdf") (bold-italic bdf "gb24st.bdf.bdf"))))
打印输出,中文时为?
;; This buffer is for notes you don’t want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C−x C−f,
;; then enter the text in that file’s own buffer.
?????
配置中关于编码,字体的部分,我的是这样的。
(set-default-font "WenQuanYi Micro Hei Mono-15")
(set-language-environment 'UTF-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
关于打印的配置
(require 'ps-print)
(setq ps-paper-type 'a4
ps-font-size 8.25
ps-print-header nil
ps-landscape-mode nil)
(require 'ps-mule)
(setq ps-multibyte-buffer 'bdf-font)
(setq bdf-directory-list '("/home/codevampire/.emacs.d/fonts"))
(setq ps-mule-font-info-database-bdf '((chinese-gb2312 (normal bdf "gb24st.bdf.bdf") (bold bdf "gb24st.bdf.bdf") (italic bdf "gb24st.bdf.bdf") (bold-italic bdf "gb24st.bdf.bdf"))))
打印输出,中文时为?
;; This buffer is for notes you don’t want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C−x C−f,
;; then enter the text in that file’s own buffer.
?????
- careone
- 帖子: 839
- 注册时间: 2007-12-17 21:41
Re: 请问如何配置Emacs打印中文
主程序文件编码指定为 UTF-8,PS打印驱动字体为GB2312,编码不统一,当然乱码。code vampire 写了:系统是UBUNTU10.04,Emacs24自己编译的。
配置中关于编码,字体的部分,我的是这样的。
(set-default-font "WenQuanYi Micro Hei Mono-15")
(set-language-environment 'UTF-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
关于打印的配置
(require 'ps-print)
(setq ps-paper-type 'a4
ps-font-size 8.25
ps-print-header nil
ps-landscape-mode nil)
(require 'ps-mule)
(setq ps-multibyte-buffer 'bdf-font)
(setq bdf-directory-list '("/home/codevampire/.emacs.d/fonts"))
(setq ps-mule-font-info-database-bdf '((chinese-gb2312 (normal bdf "gb24st.bdf.bdf") (bold bdf "gb24st.bdf.bdf") (italic bdf "gb24st.bdf.bdf") (bold-italic bdf "gb24st.bdf.bdf"))))
打印输出,中文时为?
;; This buffer is for notes you don’t want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C−x C−f,
;; then enter the text in that file’s own buffer.
?????
试着统一改为 UTF-8或 GB2312(从字体库判断,建议把文件编码改为GB2312可行性高点),再试试
魁拔不死,天下不宁。
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
魁拔既死,天下不平。
--------------
Careone <emacslocale^126.com>
https://sourceforge.net/projects/emacslocale/files/
- code vampire
- 帖子: 193
- 注册时间: 2010-06-19 12:50
- 系统: AIX、UBUNTU
- 联系:
Re: 请问如何配置Emacs打印中文
careone 写了:主程序文件编码指定为 UTF-8,PS打印驱动字体为GB2312,编码不统一,当然乱码。code vampire 写了:系统是UBUNTU10.04,Emacs24自己编译的。
配置中关于编码,字体的部分,我的是这样的。
(set-default-font "WenQuanYi Micro Hei Mono-15")
(set-language-environment 'UTF-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)
(setq default-process-coding-system '(utf-8 . utf-8))
(setq-default pathname-coding-system 'utf-8)
关于打印的配置
(require 'ps-print)
(setq ps-paper-type 'a4
ps-font-size 8.25
ps-print-header nil
ps-landscape-mode nil)
(require 'ps-mule)
(setq ps-multibyte-buffer 'bdf-font)
(setq bdf-directory-list '("/home/codevampire/.emacs.d/fonts"))
(setq ps-mule-font-info-database-bdf '((chinese-gb2312 (normal bdf "gb24st.bdf.bdf") (bold bdf "gb24st.bdf.bdf") (italic bdf "gb24st.bdf.bdf") (bold-italic bdf "gb24st.bdf.bdf"))))
打印输出,中文时为?
;; This buffer is for notes you don’t want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C−x C−f,
;; then enter the text in that file’s own buffer.
?????
试着统一改为 UTF-8或 GB2312(从字体库判断,建议把文件编码改为GB2312可行性高点),再试试
全改成gb2312也不行,根本就不支持中文打印的样子。显示的编码跟打印的编码完全是两套体系,没什么关系。Emacs的两个包,printing和ps-print一样的完蛋,怎么配都出不来,都是乱码。
如果你的可以打印中文正常,那么贴出.emacs看看,要不然就先配着试试再说。
-
- 帖子: 3
- 注册时间: 2011-09-02 12:29
Re: 请问如何配置Emacs打印中文
代码: 全选
;; print setting
(setq ps-multibyte-buffer 'bdf-font-except-latin)
;; sudo apt-get install emacs-intl-fonts
;; 在 ubuntu 里字体的位置不是默认的
;; /usr/local/share/emacs/fonts/bdf
;; 而是
;; /usr/share/emacs/fonts/bdf
(add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf")
(setq ps-paper-type 'a4 ;; default lettle
ps-font-family 'Courier ;; default Courier
ps-font-size 8.8 ;; default 8.5
ps-print-header nil ;; default t
ps-header-lines 2 ;; default 2
ps-landscape-mode nil) ;; default nil
打印中英文混排的 buffer 时,英文与中文行之间的行间距比较小。我直接设
置了 ~ps-font-info-database~ 这个变量里面的 ~Courier~ 的 Line Height
原来是 10.55 ,改为 11 。看起来好多了。
* 以前写的,不小心看到了这个帖子。贴出来,也许会有点帮助。
其实也就是 Emacs info page 里面的东西
=====================================
Emacs24.3.1
Ubuntu12.04