On 6/6/06, Hans Hagen wrote:
Mojca Miklavec wrote:
> On 6/6/06, Hans Hagen wrote:
>
>> hm, i didn't try that fc stuff yet
>>
>
> One of the most important things about XeTeX :(
>
>
but i'm not in that hurry to use the platform fonts -)
> While talking about fonts: do you have any suggestions about (old)
> Type1 (ec-encoded) fonts? The problem is that XeTeX handles them as if
> they were Latin1/Unicode-encoded (if you type in Yen, you'll get
> whatever glyphy is present at that slot independint of font encoding),
> so the only way to get other characters from EC encoding is to:
> a) "redefine" (make active) some parts of Unicode (\defč{\ccaron})
>
isn't that what \enableregime[ec] does?

No, it doesn't (and it would be a magic if it would), but what exactly
is its purpose anyway?

\ccaron works perfect, but writing č (ccaron) literally doesn't. XeTeX
doesn't know what to do with character "010C" (ccaron) since the font
only contains glyphs from 0 to 255. But well, the pound sign (£ or
^^a3) will become ccaron eventually since A3 (Unicode slot for a
pound) is ccaron in EC fonts.


What would be needed is a list of (something less than) 256 mappings
from Unicode to named glyphs (or perhaps the whole latin repertoair).

> b) extend XeTeX, so that it knows which glyph is "hidden" on which slot
> c) forget about support for Type1 fonts
>
> Another thing to adapt is (again :) the \enableregime macro (see
> http://wiki.contextgarden.net/Encodings_and_Regimes_in_XeTeX for some
> notes about that), so that regimes will work with XeTeX as well. Two
> possibilities are:
> a) \XeTeXinputencoding "somename" for native XeTeX handling, but with
> the same problems with EC fonts as above
> b) \XeTeXinputencoding "bytes" + loading the regime definitions with
> exactly the same behaviour as in pdfTeX, but without the support for
> non-latin regimes
>
well, if you prepare a test file (including font defs and a recepi) i can have 
a look,

I can prepare extensive tests, but the attached file (csz.tex) should
be enough for basic testing. No other font definitions are needed
since EC is the default font anyway, but you can try with
\font\A='Arial' \A or something similar.

Recipe nr. 1
----------
In \enableregime: if XeTeX is used, do \XeTeXinputencoding "bytes"
before reading the regime file.
Pros:
* exactly the same behaviour as in pdfTeX
* accented characters will work OK with EC font
* both regimes and ec fonts will become obsolete one day: this
approach works OK for both of those 'to-become-obsolete' stuff
Cons:
* \font\A='some unicode font' \A might not work out-of-the-box (uc
encoding has to be specified for the font): not so convenient, but
high-level macros can be used
* no support for some exotic regimes yet (Hewbrew, Arabic, ...): not
so serious since they probably use Unicode anyway and they can be
added if needed

Recipe nr. 2
----------
In \enableregime: if XeTeX is used, do \XeTeXinputencoding "argument
of enableregime" and don't read regime file.
Pros:
* support for exotic regimes out-of-the-box (those regimes most
probably need OpenType fonts anyway)
* works perfect with unicode fonts
Cons:
* most probably doesn't work with EC fonts without additional tweaking

here i get the right characters when i say:

I don't have XeTeX on this computer, but ...

\starttext
    \XeTeXinputencoding "utf8"

I never tried it, but isn't this the default one?

    It works! [\eacute][\rawcharacter{233}][Ã(c)]
    \yen

\yen is OK. It's literal ¥ (or ^^a5) the one that results in "random
glyph" (ie. the one that is located under a5 in the current font
encoding). I don't know what happens with the last one, but from the
experience I would guess that it would be left blank.

    \XeTeXinputencoding "bytes" % \enableregime[ec]
    It works! [\eacute][\rawcharacter{233}][é]

This works under assumption that one is using EC input encoding (which
is never the case). But yes, \XeTeXinputencoding "bytes"
\enableregime[cp1250] would be almost OK.

Mojca

Attachment: ccaron-xetex.tex
Description: TeX document

Attachment: csz.tex
Description: TeX document

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to