Hey list, I need to sprinkle my book with a few Sanskrit words written in the Devanagari script. I don't need to write complete paragraphs in it, but just a word or two inline. Can anyone show me the ConTeXt source to do such a thing, with, say "तरीकिन"? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Wed, Jun 22, 2011 at 03:51:56PM -0700, Kip Warner wrote:
Hey list,
I need to sprinkle my book with a few Sanskrit words written in the Devanagari script. I don't need to write complete paragraphs in it, but just a word or two inline.
Can anyone show me the ConTeXt source to do such a thing, with, say "तरीकिन"?
ConTeXt MkIV (assuming it is what you use) has no proper support for Devanagari or other Indic scripts. Since you need only few words, you can produce them externally (say ConTeXt MkII with XeTeX or Inkscape) and include the resultant PDF as inline figure. Regards, Khaled -- Khaled Hosny Egyptian Arab
On Thu, Jun 23, 2011 at 06:36, Khaled Hosny wrote:
On Wed, Jun 22, 2011 at 03:51:56PM -0700, Kip Warner wrote:
Can anyone show me the ConTeXt source to do such a thing, with, say "तरीकिन"?
ConTeXt MkIV (assuming it is what you use) has no proper support for Devanagari or other Indic scripts. Since you need only few words, you can produce them externally (say ConTeXt MkII with XeTeX or Inkscape) and include the resultant PDF as inline figure.
Or produce the whole document with ConTeXt + XeTeX :) I don't know to what extent the support is missing (how complex are the typographical rules apart from just sticking the letters close enough together and use ligatures), but there is also a chance that the features are added if that is simple enough. Mojca
On Thu, Jun 23, 2011 at 07:58:38AM +0200, Mojca Miklavec wrote:
On Thu, Jun 23, 2011 at 06:36, Khaled Hosny wrote:
I don't know to what extent the support is missing (how complex are the typographical rules apart from just sticking the letters close enough together and use ligatures), but there is also a chance that the features are added if that is simple enough.
AFAIK, Indic is the biggest OpenType mysteries and no one seems to get it right, apart from MS who wrote the spec (there is even two incompatible specs, abandoned one that is supported by FOSS implementations and a new one that only MS implements.) Regards, Khaled -- Khaled Hosny Egyptian Arab
On 23-6-2011 8:06, Khaled Hosny wrote:
On Thu, Jun 23, 2011 at 07:58:38AM +0200, Mojca Miklavec wrote:
On Thu, Jun 23, 2011 at 06:36, Khaled Hosny wrote:
I don't know to what extent the support is missing (how complex are the typographical rules apart from just sticking the letters close enough together and use ligatures), but there is also a chance that the features are added if that is simple enough.
AFAIK, Indic is the biggest OpenType mysteries and no one seems to get it right, apart from MS who wrote the spec (there is even two incompatible specs, abandoned one that is supported by FOSS implementations and a new one that only MS implements.)
Indeed, and I even played with it for a while but as it needs additional coding (the font is just part of the game) I decided that it only made sense to spend time on it if there is real demand for it (plus enough info). It could make a pet project for winter evenings. it's unlikely that I need it in a project so that doesn't help either. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
I was planning to spend some time on at least typesetting Devanagari with ConTeXt in the foreseenable future. I'll come back with this in a couple of weeks. Greetings, Daniel Stender On 23.06.2011 09:38, Hans Hagen wrote:
On 23-6-2011 8:06, Khaled Hosny wrote:
On Thu, Jun 23, 2011 at 07:58:38AM +0200, Mojca Miklavec wrote:
On Thu, Jun 23, 2011 at 06:36, Khaled Hosny wrote:
I don't know to what extent the support is missing (how complex are the typographical rules apart from just sticking the letters close enough together and use ligatures), but there is also a chance that the features are added if that is simple enough.
AFAIK, Indic is the biggest OpenType mysteries and no one seems to get it right, apart from MS who wrote the spec (there is even two incompatible specs, abandoned one that is supported by FOSS implementations and a new one that only MS implements.)
Indeed, and I even played with it for a while but as it needs additional coding (the font is just part of the game) I decided that it only made sense to spend time on it if there is real demand for it (plus enough info). It could make a pet project for winter evenings. it's unlikely that I need it in a project so that doesn't help either.
Hans
-- http://www.danielstender.com/granthinam/ GPG key ID: 1654BD9C
On Thu, 2011-06-23 at 14:05 +0200, Daniel Stender wrote:
I was planning to spend some time on at least typesetting Devanagari with ConTeXt in the foreseenable future. I'll come back with this in a couple of weeks.
Greetings, Daniel Stender
Thanks Daniel. If you need a sample project to try it on, mine is of course available. Take care, -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Thu, 2011-06-23 at 07:58 +0200, Mojca Miklavec wrote:
Or produce the whole document with ConTeXt + XeTeX :)
I would, but getting ConTeXt alone up and running has taken weeks.
I don't know to what extent the support is missing (how complex are the typographical rules apart from just sticking the letters close enough together and use ligatures), but there is also a chance that the features are added if that is simple enough.
Mojca
You'd think it would just be something really simple like \switchfont[devangari] तरीकिन \unswitchfont It's very hard to find anything simple to do in ConTeXt. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Sun, Jun 26, 2011 at 02:22, Kip Warner wrote:
On Thu, 2011-06-23 at 07:58 +0200, Mojca Miklavec wrote:
Or produce the whole document with ConTeXt + XeTeX :)
I would, but getting ConTeXt alone up and running has taken weeks.
If you have it up and running, you can use it now also for XeTeX. The only difference is that you have to run "texexec --xtx filename" as opposed to "context filename".
You'd think it would just be something really simple like \switchfont[devangari] तरीकिन \unswitchfont
With ConTeXt+XeTeX it boils down to: % this is plain xetex font switch; see next example \font\devanagari="Devanagari MT:script=Deva" \starttext {\devanagari तरीकिन} \stoptext Or the following one that could work in both XeTeX and LuaTeX with MKIV: \definefontfeature[devanagari][script=deva] \definefontsynonym[devanagari][name:Devanagari MT][features=devanagari] \starttext {\definedfont[devanagari] तरीकिन} \stoptext See attachments. XeTeX should work fine for you, the only question is whether you need any MKIV features or not. If you do need them, you could use Aditya's approach to insert snipets compiled with XeTeX (it will happen automatically), if you don't need them you just take XeTeX and you are done. The example that you sent also works fine in ConTeXt MKIV, but as soon as it comes to slightly more complex ligatures, LuaTeX won't render them properly without writing some additional support. Mojca
On Sun, Jun 26, 2011 at 08:50, Aditya Mahajan wrote:
On Sun, 26 Jun 2011, Mojca Miklavec wrote:
The example that you sent also works fine in ConTeXt MKIV,
They don't. Some of the vowels are combined incorrectly.
Ah, ok, sorry, I overlooked that. The first one was ok and the second one wasn't. (The one I copied from another source and attached in PDF was obviously wrong, but I didn't spot the other error.) Anyway, I never claimed that MKIV was usable. I only showed that it is easy to switch do devanagari script :) Mojca
On 26-6-2011 8:50, Aditya Mahajan wrote:
On Sun, 26 Jun 2011, Mojca Miklavec wrote:
The example that you sent also works fine in ConTeXt MKIV,
They don't. Some of the vowels are combined incorrectly.
I think that the engine is supposed to do some character juggling beforehand (not encoded in the font). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sun, 2011-06-26 at 08:44 +0200, Mojca Miklavec wrote:
On Sun, Jun 26, 2011 at 02:22, Kip Warner wrote:
On Thu, 2011-06-23 at 07:58 +0200, Mojca Miklavec wrote:
Or produce the whole document with ConTeXt + XeTeX :)
I would, but getting ConTeXt alone up and running has taken weeks.
If you have it up and running, you can use it now also for XeTeX.
The only difference is that you have to run "texexec --xtx filename" as opposed to "context filename".
You'd think it would just be something really simple like \switchfont[devangari] तरीकिन \unswitchfont
With ConTeXt+XeTeX it boils down to:
% this is plain xetex font switch; see next example \font\devanagari="Devanagari MT:script=Deva" \starttext {\devanagari तरीकिन} \stoptext
Or the following one that could work in both XeTeX and LuaTeX with MKIV:
\definefontfeature[devanagari][script=deva] \definefontsynonym[devanagari][name:Devanagari MT][features=devanagari]
\starttext {\definedfont[devanagari] तरीकिन} \stoptext
See attachments. XeTeX should work fine for you, the only question is whether you need any MKIV features or not. If you do need them, you could use Aditya's approach to insert snipets compiled with XeTeX (it will happen automatically), if you don't need them you just take XeTeX and you are done. The example that you sent also works fine in ConTeXt MKIV, but as soon as it comes to slightly more complex ligatures, LuaTeX won't render them properly without writing some additional support.
Mojca
Thanks Mojca. The problem is it looks like XeTeX may not fully support some of the features I need like mathematical characters and such yet. Although I have no doubt it probably will eventually. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Mon, 2011-06-27 at 09:35 +0200, Mojca Miklavec wrote:
On Mon, Jun 27, 2011 at 04:10, Kip Warner wrote:
The problem is it looks like XeTeX may not fully support some of the features I need like mathematical characters and such yet.
What mathematical characters do you miss?
Mojca
I actually haven't tried yet, but just read that it is lacking full support for that. I am wary to use XeTeX because every new small task with ConTeXt always ends up taking hours and hours to get working from putting a simple picture on a page to changing a colour of something. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Tue, Jun 28, 2011 at 03:39, Kip Warner wrote:
On Mon, 2011-06-27 at 09:35 +0200, Mojca Miklavec wrote:
On Mon, Jun 27, 2011 at 04:10, Kip Warner wrote:
The problem is it looks like XeTeX may not fully support some of the features I need like mathematical characters and such yet.
What mathematical characters do you miss?
I actually haven't tried yet, but just read that it is lacking full support for that.
Eeeeem. This used to be the case in early days of XeTeX. At the moment it is true that ConTeXt has no OpenType Math implemented for XeTeX, but this means that math should work equally well as in pdfTeX. XeTeX also has bugs in OpenType Math, but for the reason just told, this should not affect you. On the other hand if you need other MKIV features that might indeed be a problem.
I am wary to use XeTeX because every new small task with ConTeXt always ends up taking hours and hours to get working from putting a simple picture on a page to changing a colour of something.
Did you ever try to change a colour of title and background in LaTeX? :) :) :) Mojca
On Tue, 2011-06-28 at 03:51 +0200, Mojca Miklavec wrote:
On the other hand if you need other MKIV features that might indeed be a problem.
Indeed. =(
Did you ever try to change a colour of title and background in LaTeX? :) :) :)
I can only imagine ;) -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Thu, 2011-06-23 at 06:36 +0200, Khaled Hosny wrote:
ConTeXt MkIV (assuming it is what you use) has no proper support for Devanagari or other Indic scripts. Since you need only few words, you can produce them externally (say ConTeXt MkII with XeTeX or Inkscape) and include the resultant PDF as inline figure.
Regards, Khaled
Hey Khaled, It's an inelegant, albeit workable solution - but perhaps the only way. Thanks for your help. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Thu, 23 Jun 2011, Kip Warner wrote:
On Thu, 2011-06-23 at 06:36 +0200, Khaled Hosny wrote:
ConTeXt MkIV (assuming it is what you use) has no proper support for Devanagari or other Indic scripts. Since you need only few words, you can produce them externally (say ConTeXt MkII with XeTeX or Inkscape) and include the resultant PDF as inline figure.
It's an inelegant, albeit workable solution - but perhaps the only way. Thanks for your help.
If you really have to do it this way .... the dev version of the filter module [1] supports pre and postambles (@Mojca: you needed these for gnuplot module). You can use: \usemodule[filter] \defineexternalfilter[mkii] [filter={texexec --xtx --result=\externalfilteroutputfile }, output=\externalfilterbasefile.pdf, directory=output, continue=yes, readcommand=\readMKII] \define[1]\readMKII {\dontleavehmode\externalfigure[#1][location=lohi]} \startmkiipreamble \enableregime[utf-8] % I don't know how to setup typescripts with xetex % The rending is wrong. I think that one needs to enable % some language specific ligatures \font\devnagari="Lohit-Hindi" at 12pt \starttext \startTEXpage[foregroundstyle=\devnagari] \stopmkiipreamble \startmkiipostamble \stopTEXpage \stoptext \stopmkiipostamble \starttext Check if this works. \startmkii \startlines जाति न पूछो साधु की, पूछ लीजिए ग्यान। मोल करो तलवार के, पड़ा रहन दो म्यान।। \stoplines \stopmkii \stoptext % \inlinemkii does not currently work with pre- and postamble Aditya [1]: https://github.com/adityam/filter/blob/dev/
On Fri, 2011-06-24 at 03:06 -0400, Aditya Mahajan wrote:
If you really have to do it this way .... the dev version of the filter module [1] supports pre and postambles (@Mojca: you needed these for gnuplot module). You can use:
\usemodule[filter]
\defineexternalfilter[mkii] [filter={texexec --xtx --result=\externalfilteroutputfile }, output=\externalfilterbasefile.pdf, directory=output, continue=yes, readcommand=\readMKII]
\define[1]\readMKII {\dontleavehmode\externalfigure[#1][location=lohi]}
\startmkiipreamble \enableregime[utf-8] % I don't know how to setup typescripts with xetex % The rending is wrong. I think that one needs to enable % some language specific ligatures \font\devnagari="Lohit-Hindi" at 12pt \starttext \startTEXpage[foregroundstyle=\devnagari] \stopmkiipreamble
\startmkiipostamble \stopTEXpage \stoptext \stopmkiipostamble
\starttext
Check if this works.
\startmkii \startlines जाति न पूछो साधु की, पूछ लीजिए ग्यान। मोल करो तलवार के, पड़ा रहन दो म्यान।। \stoplines \stopmkii
\stoptext % \inlinemkii does not currently work with pre- and postamble
Aditya
Hey Aditya. That's pretty convuluted and a bit too much for one or two words of Sanskrit in a document. I think I'll hold off until there is native straightforward support. Thanks anyways. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
participants (6)
-
Aditya Mahajan
-
Daniel Stender
-
Hans Hagen
-
Khaled Hosny
-
Kip Warner
-
Mojca Miklavec