Hi,
This software is fantastic! I'm totally new to sdaps, latex and python. But
since coming across sdaps, I've been doing my best to make it work for a
survey totally in Japanese, and also to produce reports in Japanese. It will
be a major time-saver for me, and eventually a useful tool for my school.

I have one final problem I can't track down: I can't get Japanese text to
show up in the section headings of the questionnaire. It's probable an easy
fix, but I just can't find it.

Below is a log of all (I think) the changes I made so far.

Many thanks for any help on this last fix.


My Change Log
How to get SDAPS to work for Japanese surveys and reports
----------------------------

1. In /usr/lib/python2.7/dist-packages/sdaps/defs.py

At the bottom of the file,
Change 
latex_engine = "pdflatex"
To
latex_engine = "xelatex" # make sure to install this engine on your system
----------------------------

2. In <YourSurvey>.tex
Change
\usepackage[utf8]{inputenc}
To
\usepackage{xeCJK}
\setmainfont{TakaoExGothic} % or any other Japanese font on your system
----------------------------

3. In /usr/lib/python2.7/dist-packages/sdaps/template.py
3.1 At the top, under the section;
from reportlab import platypus
from reportlab.lib import styles
from reportlab.lib import units
from reportlab.lib import pagesizes

Add;
# Start for Japanese
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.cidfonts import UnicodeCIDFont
fontname = "HeiseiMin-W3" # or "HeiseiKakuGo-W5"
pdfmetrics.registerFont(UnicodeCIDFont(fontname))
# End for Japanese

3.2 Around line 89
Change
canvas.setFont('Times-Bold', 14)
To
canvas.setFont('HeiseiMin-W3', 14)  # report coverpage top title

3.3 Around line 127
Change
stylesheet['Normal'] = styles.ParagraphStyle(
    'Normal',
    fontName='Times-Roman',   

To
stylesheet['Normal'] = styles.ParagraphStyle(
    'Normal',
    fontName='HeiseiMin-W3',  #fixes report coverpage "Author" section for
Japanese plus elsewhere I think...
----------------------------

4. In /usr/lib/python2.7/dist-packages/sdaps/report/buddies.py
Around line 56
Change
fontName='Times-Bold',

To
fontName='HeiseiMin-W3',  #fixes Japanese in sub-sub-headings eg. 1.2.1 xxxxx
----------------------------
5. How to get the Japanese to show in the Section headings of the
questionnaire!?





-- 
To unsubscribe, send mail to [email protected].

Reply via email to