ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: UTF8 problems with Hangul Syllables
Date: Wed, 18 Dec 2002 14:39:38 +0100	[thread overview]
Message-ID: <5.1.0.14.1.20021218143635.0231c0b0@server-1> (raw)
In-Reply-To: <3DFFFE50.BBC4099A@ktug.or.kr>

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

At 01:49 PM 12/18/2002 +0900, you wrote:
>Here is my comment and question on the new feature of ConTeXt supporting
>the UTF8 encoding.
>
>Actually I tried to test the following short ConTeXt document containing
>two Korean characters. At the second line I used the Bitstream Cyberbit
>font and the corresponding TFM files were generated by ttf2tfm with 
>Unicode.sfd
>(the same way as the UTF8 support in CJK-LaTeX).
>
>\enableregime [utf]
>\definefontsynonym [UnicodeRegular] [cyberb]
>\chardef\utfunihashmode=1
>\starttext
>^^eb^^bf^^a1
>^^ec^^80^^80
>\stoptext
>
>Here, ^^eb^^bf^^a1 = U+BFE1 and ^^ec^^80^^80 = U+C000.
>
>1. Without the third line (\chardef\utfunihashmode=1), I could not see
>    any characters. Why?
>
>2. After enabling \utfunihashmode, I could see the first character. But
>    not the second character. The difference was that the value of \unidiv
>    were 191 for the first character and 192 for the second character.
>    In fact, all characters with \unidiv >= 192 and \unidiv <= 223
>    (from U+C000 to U+DFFF; half of Hangul Syllables) were not shown
>    correctly. Why?

I'll work this out asap; this is what i use as test file (unfortunately 
this font does not show chars, so i have do download a proper font first); 
i attached a script that i apply to a ttf file ( ttftfmxx.pl htfs.ttf 0 255 )


\chardef\utfunihashmode=1

\pdfmapfile{+htfsxx.map}

\definefontsynonym [TestRegular] [htfs]

\defineunicodefont [SomeFont] [Test]

\SomeFont \enableregime[utf] % todo: autoutf, else problem

\starttekst

%^^eb^^bf^^a1
%^^ec^^80^^80
\utfunifontglyph{\numexpr("BFE1)}
\utfunifontglyph{\numexpr("C000)}

\stoptekst

[-- Attachment #2: TTFTFMXX.PL --]
[-- Type: text/plain, Size: 1149 bytes --]

# author : Hans Hagen / PRAGMA-ADE / www.pragma-ade.com / 07-12-2003
# script : splits ttf file into series pfb's using ttf2pt1 & afm2tfm 
# usage  : ttftfmxx filename.ttf [from plane] [to plane] 

unless ($ARGV[0]) 
  { print "provide ttf filename\n" ; exit } 

($filename,$filetype) = split(/\./, $ARGV[0]) ;  

$filetype = 'ttf' unless $filetype ;

unless (lc $filetype eq 'ttf') 
  { print "provide ttf filename\n" ; exit } 

$mapfile = $filename . "xx.map" ;

$from = $ARGV[1] ; 
$to   = $ARGV[2] ; 

if ($from eq '') 
  { $from = 0 ; $to = 2 } 
elsif ($to eq '') 
  { $to = $from ; $from = 0 }  

$from = 255 if ($from>255) ; 
$to   = 255 if ($to  >255) ;

open(MAP,">$mapfile") ;

for ($i=$from;$i<=$to;$i++)
  { $str = sprintf("%02x",$i) ;
    $splitname = "$filename$str" ; 
    system("ttf2pt1 -l plane+0x$str -W 0 -b $filename.$filetype $splitname") ; 
    system("afm2tfm $splitname.afm $splitname.tfm") ; 
    unlink "$splitname.afm" ; 
    print MAP "$splitname <$splitname.pfb\n" }

close(MAP) ;

print "ttffile : $filename.$filetype\n" ; 
print "tfmfile : $filename$from.tfm .. $filename$to.tfm\n" ; 
print "mapfile : $mapfile\n" ; 

[-- Attachment #3: Type: text/plain, Size: 597 bytes --]

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

  reply	other threads:[~2002-12-18 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18  4:49 Cho, Jin-Hwan
2002-12-18 13:39 ` Hans Hagen [this message]
2002-12-19  1:53   ` Cho, Jin-Hwan
2002-12-19  9:16     ` Hans Hagen
2002-12-20  8:18       ` Cho, Jin-Hwan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.1.20021218143635.0231c0b0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).