[Gambas-user] How to print Greek

Doriano Blengino doriano.blengino at ...1909...
Sat Feb 13 10:07:04 CET 2010


Dimitris Anogiatis ha scritto:
> Vassili,
> You might have to convert the Greek Unicode characters into ANSI or ASCII
> (not sure how your printer works I haven't
> used a parallel printer in a while) in order to see some Greek characters
> printed out.
>
> if you can verify that the printer is setup correctly and an ascii plain
> text with Greek characters prints out fine from your linux box then
> it should be just a matter of unicode to ASCII conversion
>
> Hope this helps
> Regards,
> Dimitris
>
> On Fri, Feb 12, 2010 at 12:45 PM, Vassilis K <vkan53 at ...2300...> wrote:
>
>   
>> I am using a parallel printer Panasonic KX-P1150 (dot printer).
>>
>> The printer is at /dev/lp0 and prints very well in English.
>>
>> In Greek it only shows some strange characters like "road crossings" and
>> crosses with other symbols.
>> I have tried to use all the font options of the printer that can be
>> adjusted from the front panel:
>>
>> 0.PROGRAM
>> 1.Courier
>> 2.Roman
>> 3.Bold PS
>> 4.Sans Serif
>>
>> The 1st of them is probably for the Program and the other are as
>> described !
>>
>> All of the options print the strange crossings in Greek and everything
>> OK in English.
>> Is there any solution?
>>
>> Last year I used the same printer with a Visual Basic Program and it
>> didn't print Greek at all (the same road crossings).
>>
>> The printing code is:
>>
>> hPrinter = OPEN "/dev/lp0" FOR OUTPUT
>>          hPrinter.EndOfLine = gb.Windows
>>          PRINT #hPrinter, "Afixi" &  prosorinoAA & " " &
>> tEpitheto.Text
>>     
The problems are two. First, you should check the manual of the printer 
- you will find all the characters the printer can print (its character 
set, or its character sets); but it is unlikely that that printer can 
print all the greek characters,

If you don't have the manual you can test the characters by the 
following code:

    for i = 33 to 255
       print #hPrinter, chr$(i)
    next
    ' never use chr$(27), unless you know what you are doing

Provided that the printer *has* in its fonts the characters you need, 
you can print them with, for example, chr$(230) or chr$(145). Probably 
all the fonts have the same characters, only with different appearance. 
If you are lucky, those characters are arranged in predetermined order, 
like an old IBM codepage. If so, you could translate your strings from 
your current locale or UTF-8 to the codepage of the printer. But I see a 
lot of problems. Perhaps you should set up your own conversion routine.

Or, you can use the graphic capabilities of the printer using CUPS. It 
will print with fidelity everything you want, even in different sizes, 
but don't expect a pretty output.

Regards,

-- 
Doriano Blengino

"Listen twice before you speak.
This is why we have two ears, but only one mouth."





More information about the User mailing list