Chinese formatting

@aaronlee29 it seems default document formatter for windows printer does that wrapping. I’ve changed your sample template as follows for better formatting.

[LAYOUT]
-- General layout
<div style="font-family:NSimSun;text-align:left">
<L00>Date:{TICKET DATE}
<L00>Time:{TIME}
{ENTITIES}
<F>-
{ORDERS}
<F>=
<EB>
{DISCOUNTS}
{TAXES}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
<J00>Total:|{TICKET TOTAL}
{PAYMENTS}
<DB>
<F>=
-- <C10>多謝! Thank you, please come again!
</div>

[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

[ORDERS]
-- Default format for orders
<span>
<J00:2>{QUANTITY} {NAME}|{TOTAL PRICE}
</span>

{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**

{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

[TAXES]
-- <L00>{TAX NAME}
-- <L00> Taxable Amount: {TAXABLE AMOUNT}
<J00>HST (13%)| {TAX AMOUNT}
<F>-

However that does not solve aligning wrapped prices to right issue. I’ll also try to find a solution for that… Until that using smaller fonts for order lines might work.

Thanks for that emre!!!

<xct>28,112,1,48

[LAYOUT]
-- General layout
<div style="font-family:NSimsun;text-align:left">
<C10>1st Floor,No:29,Salim,Sibu
<J00>Tel: 0165795829 |  Email: foodtimecafe@gmail.com
<J00>Date:{TICKET DATE}|Time:{TIME} 
<J00>Table:{ENTITY NAME:Table}| Ticket No:{TICKET NO}
<F>-
{ORDERS}
<F>=
<EB>
{DISCOUNTS}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
<J10>Total:|{TICKET TOTAL}
{PAYMENTS}
<DB>
<F>=
<C10>T H A N K   Y O U
</div>

[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
<J00>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}

[ORDERS]
-- Default format for orders
<span>
<J00:2>{QUANTITY}Nos {NAME}|{TOTAL PRICE}
</span>
{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}

first item been cut off, eg taiwainese pork rice, it printed taiwanese only, the second item above works ok

i printed in english format only

it still the same, the word of first item is incomplete, otherwise fine.
if i remove the span, all line show incomplete word.

help pls,

Dear aaronlee29,

I need same solution for Lao Language. My bill printout is still shown as attached below:

How to adjust column of price to be perfectly position.

My parameters:
SambaPOS: 4.1.8
Printer Type: HTML
Character Set: 857
Line Character Set: 29

Best Regards,
Phoxaysy

You need to use fixed width (monospace) fonts to format lines properly.

Fixed width fonts uses fixed character width for all letters so line formats works fine.
For example…

Lines with 10 i characters are shorter than 10 0 characters so prices does not align.

iiiiiiiiii $10
0000000000 $10

When fixed width fonts used line lengths becomes same and prices aligns fine.

iiiiiiiiii $10
0000000000 $10

2 Likes

Hi Emre,

Thank you for your reply. If i understand correctly i’ve try to download front “Cousine” and “BPmono” also try with Tahoma which is monospace font but nothing affect for good result. And then i changed to “Phetsarath_OT” result looks fixed width font but result still same. Here is my template code:

[LAYOUT]
-- General layout

<div style="font-size:14px; font-family:'Phetsarath_OT';text-align:center">
ໃບແຈ້ງລາຄາ
</div>

<div style="font-size:12px; font-family:'Phetsarath_OT'">
<L00>DEV Restaurant    ເບີໂທ:11111  
<L00>ວັນທີ:{TICKET DATE}     ເວລາ:{TIME}
<J10>|{TICKET TAG:Guest Count}
{ENTITIES}
<L00>Ticket No:{TICKET NO}
</div>
<F>-
<div style="font-size:12px; font-family:'Phetsarath_OT'">
{ORDERS}
</div>
<F>=
<EB>
{DISCOUNTS}
{TAXES}
[<J10>Total Gift:|{ORDER STATE TOTAL:Gift}]
{SERVICES}
<J10>Sub Total:|[=F(TN('{TICKET TOTAL}')-TN('{TAX TOTAL}'))]
<J10>Tax:|{TAX TOTAL}
<J10>Total:|{TICKET TOTAL}
<J00>Total in USD:                     [=F(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:USD}'),'#,##0.## $')]
<J00>Total in THB:                     [=F(TN('{TICKET TOTAL}')/TN('{EXCHANGE RATE:BATH}'),'#,##0.## THB')]

{PAYMENTS}
<F> 

[DISCOUNTS]
<J00>{CALCULATION NAME} %{CALCULATION AMOUNT}|{CALCULATION TOTAL}

[SERVICES]
<J00>{CALCULATION NAME}|{CALCULATION TOTAL}

[PAYMENTS]
<J00>{PAYMENT NAME}|{PAYMENT AMOUNT}
[ORDERS]
-- Default format for orders
<J00>- {QUANTITY} {NAME}|{TOTAL PRICE}
{ORDER TAGS}

[ORDERS:Gift]
-- Format for gifted orders
<J00>- {QUANTITY} {NAME}|**GIFT**
{ORDER TAGS}

[ORDERS:Void]
-- Nothing will print for void lines

[ORDER TAGS]
-- Format for order tags
<J00> * {ORDER TAG NAME} | {ORDER TAG PRICE}

[ENTITIES:Table]
-- Table entity format
<L00>Table: {ENTITY NAME}

[ENTITIES:Customer]
-- Customer entity format
<J00>Customer: {ENTITY NAME} | {ENTITY DATA:Phone}
[TAXES]
<L00>Tax : {TAX NAME}
<F>-

I count number of character it might cause for spacing adjustment but i think it is not problem

Please help to do Lao language display properly on bill.
Best regards,

You havent used a fixed width font, your 16 characters is shorter than your 10. If it was a fixed width font the first 10 characters of each would line up with an additional 6 on your 16 character

1 Like

Hi,
Sorry to reply late. I just comeback. I’ve used font monospace “Consolas” It looks work well for English Menu Item but for Lao Menu Item, spacing is not adjust correctly as we want yet.

Please see example of printouts:

Mix Menu Items:

English Menu Items:

Please advise. Thanks

Best Regards,
Phoxaysy

The answer has been given to you many times. The font has to be fixed width font this means your products must be named with a fixed width font as well or its not going to show correctly.

Hi Kendash,
I tried with several monospace font. And i found font “Monaco” it works better for my language.

Thank you

1 Like