Re: [NTG-context] Script to automatically generate typescripts

2010-06-07 Thread Thomas Floeren
Michael Murphy  wrote on Thursday, June 03, 2010 6:52 PM:

 
 Please send me bug reports / feature requests if you use it!



Thank you for this script. I'm sure I'll have good use of it!

I just did a quick test with Myriad Pro, and it works nicely.

Some minor suggestions for usability:

1. If there is no 'typescripts' directory, the typescript and test-file should
be created just in the same directory as the oftsmkr file (so it's easier to
use it anywhere outside the texmf-tree).

2. In the test-file, I had to replace '\start' and '\stop' with '\starttext'
and '\stoptext' (otherwise it doesn't work on my sytem). 

3. The line '\usetypescriptfile [nameofthetypescriptfile]' should be
included in the test-file. So the test-file will use the typescript file if it
is in the same directory as the test-file.

4. All the '\definefontalternative' definitions which you print in the
terminal output could be included in the test-file. So the test-file would
work out-of-the-box. 


Thanks for sharing your script!

Best wishes

Thomas

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Mojca Miklavec
On Fri, Jun 4, 2010 at 09:32, luigi scarso wrote:

 2) why python ? We have lua in luatex; mkiv has a lot of lua code about fonts.

Hmmm ... the guy who spent most of his time in community trying to
make python work with ConTeXt is now complaining about the programming
language? Come on ... :)

Whenever I write something I use the language I master most (even if
it's not the most suitable language for that task), so I guess that
must be the reason. But if the script proves to be useful, it's still
short enough that anyone could convert it to Lua to get rid of
dependencies on yet another language.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Hans Hagen

On 4-6-2010 10:03, Mojca Miklavec wrote:

On Fri, Jun 4, 2010 at 09:32, luigi scarso wrote:


2) why python ? We have lua in luatex; mkiv has a lot of lua code about fonts.


Hmmm ... the guy who spent most of his time in community trying to
make python work with ConTeXt is now complaining about the programming
language? Come on ... :)

Whenever I write something I use the language I master most (even if
it's not the most suitable language for that task), so I guess that
must be the reason. But if the script proves to be useful, it's still
short enough that anyone could convert it to Lua to get rid of
dependencies on yet another language.


indeed; th ecore programs with context are on lua as it makes us 
independent of other installed programs but additional tools can be in 
any language (perl, ruby, python etc)


in that sense i think that Michael's script is for otf what texfont.rb 
is/was for type 1 so it's a nice addition


i'm not sure if a binary is needed as most users can simply install python

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread luigi scarso
On Fri, Jun 4, 2010 at 10:37 AM, Hans Hagen pra...@wxs.nl wrote:
 On 4-6-2010 10:03, Mojca Miklavec wrote:
 Whenever I write something I use the language I master most (even if
 it's not the most suitable language for that task), so I guess that
 must be the reason. But if the script proves to be useful, it's still
 short enough that anyone could convert it to Lua to get rid of
 dependencies on yet another language.
sorry, but you can not program PIC controller with bash just because
you know bash better than assembly


 indeed; th ecore programs with context are on lua as it makes us independent
 of other installed programs but additional tools can be in any language
 (perl, ruby, python etc)
Other languages are fine of course, but in this context lua is best choice.
Lua is all we need.



-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Vyatcheslav Yatskovsky



I will probably package it as an .exe when I get the option handling done.


Would be great for average Windows users ;)

--
Best Regards,
Vyatcheslav Yatskovsky
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Michael Murphy

On 04/06/2010 10:50, luigi scarso wrote:

On Fri, Jun 4, 2010 at 10:37 AM, Hans Hagenpra...@wxs.nl  wrote:

On 4-6-2010 10:03, Mojca Miklavec wrote:

Whenever I write something I use the language I master most (even if
it's not the most suitable language for that task), so I guess that
must be the reason.


As I said, it started out as a private project, but just wanted to see 
if others found it useful. It is not at all like the 'simplefonts' 
module, since it has absolutely no integration with ConTeXt. It simply 
reads in .otf files and spits out typescripts, which can then be used in 
ConTeXt.


I will try to get an .exe out in the next few days. I'm also starting to 
think that it might be possible to use otfinfo from the lcdf typetools 
to get information about a font, rather than trying to work it out from 
the filename. This might mean being able to use fonts other than those 
from Adobe, which would be nice.


--
Michael Murphy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Mojca Miklavec
On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:

 I'm also starting to
 think that it might be possible to use otfinfo from the lcdf typetools to
 get information about a font

Just note: you can get an enormous amount of font information with luatex.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread luigi scarso
On Fri, Jun 4, 2010 at 11:52 AM, Michael Murphy
michael.mur...@uni-ulm.de wrote:
 I will try to get an .exe out in the next few days. I'm also starting to
 think that it might be possible to use otfinfo from the lcdf typetools to
 get information about a font, rather than trying to work it out from the
 filename. This might mean being able to use fonts other than those from
 Adobe, which would be nice.
You can also see
ttx: is written in python
http://sourceforge.net/projects/fonttools/

-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Mojca Miklavec
On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:

 As I said, it started out as a private project, but just wanted to see if
 others found it useful.

What about presenting your work at the ConTeXt conference and in MAPS magazine?

You'll be able to meet the biggest ConTeXt gurus there, learn a lot
from them, Luigi will give you a short lesson on Why I switched from
Python to Lua and The first few steps in Lua for font lovers and
you should be able to work the author of simplefonts module
face-to-face to join the best of his and your work ...

We might even have an official discussion on the schedule about
typescripts and how to simplify and/or improve them.

And of course the delicious Czech beer ...

http://meeting.contextgarden.net/

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Hans Hagen

On 4-6-2010 12:21, Mojca Miklavec wrote:


We might even have an official discussion on the schedule about
typescripts and how to simplify and/or improve them.


.. and how those hugs polish font collections spoil any systematic 
approach -)


-
  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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Hans Hagen

On 4-6-2010 10:23, luigi scarso wrote:


(I hope one day we will end without ruby and perl for mkiv too, if reasonable) .


not much perl used in context tools nowadays and not that much ruby 
either in mkiv related tools



Of course perl, ruby. python,put_your_favorite_language_here
are all goods programming languages
but mixing them together not always make a good pie .


italian restaurants in NL have quite some choices in pizza .. any 
combination possible -)


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread luigi scarso
On Fri, Jun 4, 2010 at 12:00 PM, Mojca Miklavec
mojca.miklavec.li...@gmail.com wrote:
 On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:

 I'm also starting to
 think that it might be possible to use otfinfo from the lcdf typetools to
 get information about a font

 Just note: you can get an enormous amount of font information with luatex.
Just a note x you : where is showttf ?



-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread luigi scarso
On Fri, Jun 4, 2010 at 12:21 PM, Mojca Miklavec
mojca.miklavec.li...@gmail.com wrote:
 On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:

 As I said, it started out as a private project, but just wanted to see if
 others found it useful.

 What about presenting your work at the ConTeXt conference and in MAPS 
 magazine?

 You'll be able to meet the biggest ConTeXt gurus there, learn a lot
 from them, Luigi will give you a short lesson on Why I switched from
 Python to Lua
Because it's better
That's all folks -- free time now

The best presentation ever, even better than Taco's one at last eurotex meeting.

I switched from python to Lua x context, this is true;
I'm still using it for other tasks, particularly  Plone,
and sometimes sagemath.
It's not a bad language at all.

-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Khaled Hosny
On Fri, Jun 04, 2010 at 12:29:32PM +0200, luigi scarso wrote:
 On Fri, Jun 4, 2010 at 12:21 PM, Mojca Miklavec
 mojca.miklavec.li...@gmail.com wrote:
  On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:
 
  As I said, it started out as a private project, but just wanted to see if
  others found it useful.
 
  What about presenting your work at the ConTeXt conference and in MAPS 
  magazine?
 
  You'll be able to meet the biggest ConTeXt gurus there, learn a lot
  from them, Luigi will give you a short lesson on Why I switched from
  Python to Lua
 Because it's better
 That's all folks -- free time now
 
 The best presentation ever, even better than Taco's one at last eurotex 
 meeting.
 
 I switched from python to Lua x context, this is true;
 I'm still using it for other tasks, particularly  Plone,
 and sometimes sagemath.
 It's not a bad language at all.

When it comes to writing non-luatex code, I'll pick python anytime of
the day, a light language with almost no standard library is not what
one always need.


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Vnpenguin
On Fri, Jun 4, 2010 at 11:52, Michael Murphy michael.mur...@uni-ulm.de wrote:
 On 04/06/2010 10:50, luigi scarso wrote:

 On Fri, Jun 4, 2010 at 10:37 AM, Hans Hagenpra...@wxs.nl  wrote:

 On 4-6-2010 10:03, Mojca Miklavec wrote:

 Whenever I write something I use the language I master most (even if
 it's not the most suitable language for that task), so I guess that
 must be the reason.

 As I said, it started out as a private project, but just wanted to see if
 others found it useful. It is not at all like the 'simplefonts' module,
 since it has absolutely no integration with ConTeXt. It simply reads in .otf
 files and spits out typescripts, which can then be used in ConTeXt.

 I will try to get an .exe out in the next few days. I'm also starting to
 think that it might be possible to use otfinfo from the lcdf typetools to
 get information about a font, rather than trying to work it out from the
 filename. This might mean being able to use fonts other than those from
 Adobe, which would be nice.


Although a Perl user, I like your Python script, Michael !

Thanks
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Michael Murphy

On 04/06/2010 13:16, Khaled Hosny wrote:

On Fri, Jun 04, 2010 at 12:29:32PM +0200, luigi scarso wrote:

On Fri, Jun 4, 2010 at 12:21 PM, Mojca Miklavec
mojca.miklavec.li...@gmail.com  wrote:

On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:


As I said, it started out as a private project, but just wanted to see if
others found it useful.


What about presenting your work at the ConTeXt conference and in MAPS magazine?

You'll be able to meet the biggest ConTeXt gurus there, learn a lot
from them, Luigi will give you a short lesson on Why I switched from
Python to Lua

Because it's better
That's all folks -- free time now

The best presentation ever, even better than Taco's one at last eurotex meeting.

I switched from python to Lua x context, this is true;
I'm still using it for other tasks, particularly  Plone,
and sometimes sagemath.
It's not a bad language at all.


When it comes to writing non-luatex code, I'll pick python anytime of
the day, a light language with almost no standard library is not what
one always need.



Oh God, I really didn't want to generate all this fuss, it's really a 
_very_ primitive script. If I have more time, I'll certainly look into 
Lua, but I chose Python because:


a. it handles complicated string operations, io, regex, etc right out of 
the box, all of which were needed.
b. I'm slightly above noob level with python, as opposed to almost every 
other language (except Fortran, which was not exactly a front-runner)
c. I'm rather more than ignorant about almost every other font tool out 
there


I just reckoned that there has got to be a good way of automatically 
writing those long, complicated typescripts. I did start such a thing in 
emacs, but then realised that its not a very portable solution (although 
I do have a whole bunch of macros for converting LaTeX and AMSmath code 
into ConTeXt if anyone is interested).

--
Michael Murphy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Mojca Miklavec
On Fri, Jun 4, 2010 at 18:08, Michael Murphy wrote:
 On 04/06/2010 12:00, Mojca Miklavec wrote:

 Just note: you can get an enormous amount of font information with luatex.

 If you can get so much information out of LuaTeX, why do we need typescripts
 in the first place?

1.) The typescripts have been written long before LuaTeX existed.
2.) The typescripts still work is almost exactly the same way as they did before
3.) Your can read a lot of information about a specific font (which
features are available, which glyphs exist etc. etc. etc.), but that
still doesn't give you any information about which fonts you want to
combine together and which features you want to use.

Take Antykwa Półtawskiego. It comes as regular/italic, in 4 weights
(light, normal, medium, bold), in 5 widths (extended, semi-extended,
normal, semi-condensed, condensed), about 5 encodings for MKII. You
need to tell to ConTeXt somehow whether you want to combine light and
medium or normal weight and bold, or maybe normal with semi-extended
bold, you may want the size to adapt automatically when you change
font size. There is also no reliable way to determine which fonts
belong together. You still need to assign a font with a variant
somehow.

Reading info about a font doesn't really solve the problem of being
able to automatically assign rm, bf, bi etc., but I admit that there
*IS* room for improvement for font handling mechanism in a more
user-friendly way (and lua can be of enormous help of course).

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-04 Thread Hans Hagen

On 4-6-2010 6:08, Michael Murphy wrote:

On 04/06/2010 12:00, Mojca Miklavec wrote:

On Fri, Jun 4, 2010 at 11:52, Michael Murphy wrote:


I'm also starting to
think that it might be possible to use otfinfo from the lcdf
typetools to
get information about a font


Just note: you can get an enormous amount of font information with
luatex.



If you can get so much information out of LuaTeX, why do we need
typescripts in the first place?


because it's the only watertight way; other approaches use heuristics

it all depends on the situation

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-03 Thread Vyatcheslav Yatskovsky

Hi,

Looks very impressive. A lot of code )

Is it usable under Windows? Never run Python scripts before.


Hi all,

after spending many hours on a typescript only to accidentally delete
it, I thought that there should be a better way to write them. Hence I
wrote a python script to do just that.


--
Best Regards,
Vyatcheslav Yatskovsky
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Script to automatically generate typescripts

2010-06-03 Thread Michael Murphy

On 03/06/2010 23:33, Vyatcheslav Yatskovsky wrote:

Hi,

Looks very impressive. A lot of code )

Is it usable under Windows? Never run Python scripts before.


Hi all,

after spending many hours on a typescript only to accidentally delete
it, I thought that there should be a better way to write them. Hence I
wrote a python script to do just that.




I haven't tested it extensively, but it seems to run on windows. I will 
probably package it as an .exe when I get the option handling done.


You will need to install python before you can run the script.

--

Michael Murphy
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___