RML Example 32: Japanese
日本語は難しいですね!
RML Example 0: Catchforms
日本語は難しいですね!
RML (Report Markup Language) is ReportLab's own language for specifying the appearance of a printed page, which is converted into PDF by the utility rml2pdf.
These RML samples showcase techniques and features for generating various types of ouput and are distributed within our commercial package as test cases. Each should be self explanatory and stand alone.
Japanese Language Tests
This test tries to display Japanese characters in several realistic situations. We'll start with a paragraph:
Basic output and text alignment
says "Hilton Tokyo:" ヒルトン東京
Gatwick Name: ヒルトン・ロンドン・ガトウィック・エアポート
The words below the title at the top should be right-aligned with the frame border.
If not, we've got our string widths wrong. If too far into the page, likelihood is
we are counting bytes not characters. Similar things apply to the paragraph below
whose Japanese portion should be underlined and right-aligned; if the underline is different in length
and text does not run to edge, we goofed.
begin 日本語は難しいですね end
Text wrapping
Gatwick Description: ガトウィック空港と連絡通路で直結されている唯一のホテルである当ホテルは、街の中心部から30分の場所にございます。全客室に高速インターネット環境を完備しております。ファミリールームは5名様までお泊りいただけます。また、エグゼクティブルームのお客様は、エグゼクティブラウンジをご利用いただけます。事前にご予約いただけるタイムトゥフライ・パッケージには、空港の駐車料金が含まれております。
Other contexts
There are some other non-paragraph contexts for text display -
drawing strings directly, and placing strings (not paragraphs) in table cells. The title
at the top should have a ® symbol at the right, and all three should appear in
the table below:
Symbol Name | Displays |
Copyright | © |
Registered | ® |
Trademark | ™ |
Tokyo (as entities) | 東京 |
Tokyo (au naturelle) | 東京 |
Charts
Drawing source should be Nikkei
HeiseiMin-W3
source: 日本経済新聞
This should split over the page break onto page two
ガトウィック空港と連絡通路で直結されている唯一のホテルである当ホテルは、街の中心部から30分の場所にございます。全客室に高速インターネット環境を完備しております。ファミリールームは5名様までお泊りいただけます。また、エグゼクティブルームのお客様は、エグゼクティブラウンジをご利用いただけます。事前にご予約いただけるタイムトゥフライ・パッケージには、空港の駐車料金が含まれております。
Text After
Table