• Re: pdf4tcl and Chinese characters

    From Harald Oehlmann@wortkarg3@yahoo.com to comp.lang.tcl on Wed Feb 28 13:38:41 2024
    From Newsgroup: comp.lang.tcl

    Dear team,

    please allow me to give a status on this.
    I looked into tclfpdf, great stuff.
    Specially the Error routine to call "exit" is quite wiered.
    But now, this issue is solved using PDF4TCL as described at the very end of: https://wiki.tcl-lang.org/page/pdf4tcl

    It is quite manual and an automated process like in tclfpdf would be
    great. The pdf4tcl ticket tracked GOT 6 new tickets.

    bUT ANYWAY; THANK YOU ALL AND TAKE CARE;
    hARALD


    Am 25.01.2024 um 08:44 schrieb Harald Oehlmann:
    Muchas gracias, Alejandro,
    looks promissing,
    Harald

    Am 25.01.2024 um 00:27 schrieb lamuzz...@gmail.com:
    Harald,
    take a look to tclfpdf (https://github.com/lamuzzachiodi/tclfpdf).
    There are an example (utf8.tcl, pasted below) with chinese characters
    using font simhei.ttf.
    May be this help you.
    Saludos,

    Alejandro

    #--- utf8.tcl -----------
    package require tclfpdf
    namespace import  ::tclfpdf::*

    Init;
    AddPage;
    # Add a Unicode font (uses UTF-8)
    AddFont "DejaVu" "" "DejaVuSansCondensed.ttf" 1;
    SetFont "DejaVu" "" 14;
    Write 8 "        -----
    English: Hello World
    Greek: Γειά σου κόσμος
    Polish: Witaj świecie
    Portuguese: Olá mundo
    Spanish: Hola mundo
    Russian: Здравствулте мир
    Vietnamese: Xin chào thế giới
            ------";
    Ln 10;
    AddFont "simhei" "" "simhei.ttf" 1;
    SetFont "simhei" "" 20;
    Write 10 "Chinese: 你好世界";
    #Select a standard font (uses windows-1252)
    SetFont  "Arial" "" 14;
    Ln 10;
    Write 5 "The file size of this PDF is only 16 KB.";
    Output "utf8.pdf";


    --- Synchronet 3.20a-Linux NewsLink 1.114