2012년 10월 19일 금요일

Trac wikiprint 한글글꼴 설정.

아래 링크를 참조하여 한글이 포함된 trac 페이지도 wikiprint 로 PDF 문서를 잘 생성해서 쓰고 있었는데 어느때인가? ubuntu 를 업그레이드하면서 한글이 깨지기 시작했다.
http://kldp.org/node/109178

오늘 ubuntu 12.10 으로 업그레이드하면서 다시 확인해봤는데 역시나~~
이것저것 삽질하다 보니 짜안 한글이 TT_TT..
/usr/share/pyshared/wikipiprint/defaults.py 를 아래와 같이 수정.
  • 원본..
"""
Author: Alvaro Iradier
"""

#Default CSS to use for xhtml2pdf
CSS = """
html {
    font-family: Helvetica;
    font-size: 10px;
    font-weight: normal;
    color: #000000;
    background-color: transparent;
  • 수정본
"""
Author: Alvaro Iradier
"""

#Default CSS to use for xhtml2pdf
CSS = """
@font-face {
    font-family: NanumGothic;
    src: url(file:///usr/share/fonts/truetype/nanum/NanumGothic.ttf);
    }
html {
    font-family: NanumGothic;
    font-size: 10px;
    font-weight: normal;
    color: #000000;
    background-color: transparent;

2012년 10월 18일 목요일

리눅스배포판 정보 얻기

$ lsb_release -rd
Description:    Ubuntu 12.10
Release:    12.10

파이썬에서 r"\x30" 디코딩하기.


>>> r"\x30".decode("string_escape")
'0'