Re: [NTG-context] ansi codes

2008-11-14 Thread Thomas A. Schmitz

On Oct 1, 2008, at 10:00 PM, Hans Hagen wrote:

 lesser geeks loom in s-fnt-10.tex -)

 Hans

Hi Hans,

the file s-fnt-10.lua needs to be added to the distribution.

Best

Thomas


function fonts.otf.show_all()

local tfmdata = fonts.tfm.id[font.current()]

if tfmdata and tfmdata.shared then
local otfdata = tfmdata.shared.otfdata
if otfdata and otfdata.luatex then
local unicodes = otfdata.luatex.unicodes
tex.sprint(tex.ctxcatcodes,string.format(\\starttabulate[| 
l|r|c|]))
for i, name in ipairs(table.sortedkeys(unicodes)) do
local unicode = unicodes[name]
if unicode = 0 then
tex.sprint(tex.ctxcatcodes,string.format(\\NC %s \ 
\NC %s \\NC \\char%s \\NC\\NR,name,unicode,unicode))
end
end
tex.sprint(tex.ctxcatcodes,string.format(\\stoptabulate))
end
end

end

function fonts.show_all()

local tfmdata = fonts.tfm.id[font.current()]

if tfmdata and tfmdata.shared then
local chars = tfmdata.characters
tex.sprint(tex.ctxcatcodes,string.format(\\starttabulate[|l|r| 
r|c|]))
for k, v in ipairs(table.sortedkeys(chars)) do
tex.sprint(tex.ctxcatcodes,string.format(\\NC %s\\NC %s\ 
\NC \\char%s\\NC %s\\NC\\NR,chars[v].name or  
unknown,v,v,chars[v].index))
end
tex.sprint(tex.ctxcatcodes,string.format(\\stoptabulate))
end

end

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-10-03 Thread Alan Stone
On Wed, Oct 1, 2008 at 10:00 PM, Hans Hagen [EMAIL PROTECTED] wrote:

 Mojca Miklavec wrote:
  On Wed, Oct 1, 2008 at 2:57 PM, Alan Stone wrote:
  Is there a (preferably free) Linux or Windows font tool out there which
  allows to print a font's characters and corresponding character codes ?
 
  Geeks do it with LuaTeX :)
 
  I'm not sure if this still works since I have no luatex here, but in
  theory you can play with something like this:
 
  % do whatever you want with it
  \def\mychar#1#2{#1: #2\crlf}
 
  \starttext
  \ctxlua{
fontname = 'texgyrepagella-regular.otf'
tfmdata = fonts.tfm.read_and_define(file: .. fontname, 655360)
 
w = tfmdata.characters
for i=0,10 do
if w[i] then
tex.sprint(\\strut\\mychar{ .. i, }{\\type{,
 w[i].name, }})
end
end
  }
  \stoptext

 lesser geeks loom in s-fnt-10.tex -)

 Hans



Is something missing to make it work ? See attachements.

Tried with WXP  LNX.

-- 
Best,
Alan

* texexec --lua foo
* ConTeXt  ver: 2008.10.01 19:13 MKIV  fmt: 2008.10.3  int: english/english
* Ubuntu 8.04 Hardy Heron (Desktop)


s-fnt-10.tex
Description: TeX document


s-fnt-10.log
Description: Binary data
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-10-01 Thread Alan Stone
Wonderful !

Is there a (preferably free) Linux or Windows font tool out there which
allows to print a font's characters and corresponding character codes ?


On Tue, Sep 30, 2008 at 4:16 PM, Taco Hoekwater [EMAIL PROTECTED] wrote:



 Alan Stone wrote:
  On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  On Tue, 30 Sep 2008 12:23:56 +0200
  Alan Stone [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
How do you typeset font characters by their ansi code number, ex.
  Alt+33
(21h) ?
 
  \char 21 % hex
  \char 33  % decimal
 
 
  Thanks Taco.
 
  It didn't work as expected. It outputs exclamation points.

 OK, fetched the font.

  \starttypescript [sans] [combinumerals]
   \setups [font:fallback:sans]
   \definefontsynonym [sans][CombinumeralsRegular]
   \definefontsynonym [sansBold][CombinumeralsBold]
  \stoptypescript

 Two changes are needed here

 [Sans]   instead of   [sans]
 [SansBold]   instead of   [sansBold]

  \starttext
  %\showcharacters
  %\page

 Have to add a font switching command here:

   \switchtobodyfont[combinumerals,ss]

 Best wishes,
 Taco

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-10-01 Thread Taco Hoekwater


Alan Stone wrote:
 Wonderful !
 
 Is there a (preferably free) Linux or Windows font tool out there which 
 allows to print a font's characters and corresponding character codes ?

I use fontforge: http://fontforge.sourceforge.net/

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-10-01 Thread Mojca Miklavec
On Wed, Oct 1, 2008 at 2:57 PM, Alan Stone wrote:

 Is there a (preferably free) Linux or Windows font tool out there which
 allows to print a font's characters and corresponding character codes ?

Geeks do it with LuaTeX :)

I'm not sure if this still works since I have no luatex here, but in
theory you can play with something like this:

% do whatever you want with it
\def\mychar#1#2{#1: #2\crlf}

\starttext
\ctxlua{
fontname = 'texgyrepagella-regular.otf'
tfmdata = fonts.tfm.read_and_define(file: .. fontname, 655360)

w = tfmdata.characters
for i=0,10 do
if w[i] then
tex.sprint(\\strut\\mychar{ .. i, }{\\type{, 
w[i].name, }})
end
end
}
\stoptext

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-10-01 Thread Hans Hagen
Mojca Miklavec wrote:
 On Wed, Oct 1, 2008 at 2:57 PM, Alan Stone wrote:
 Is there a (preferably free) Linux or Windows font tool out there which
 allows to print a font's characters and corresponding character codes ?
 
 Geeks do it with LuaTeX :)
 
 I'm not sure if this still works since I have no luatex here, but in
 theory you can play with something like this:
 
 % do whatever you want with it
 \def\mychar#1#2{#1: #2\crlf}
 
 \starttext
 \ctxlua{
   fontname = 'texgyrepagella-regular.otf'
   tfmdata = fonts.tfm.read_and_define(file: .. fontname, 655360)
 
   w = tfmdata.characters
   for i=0,10 do
   if w[i] then
   tex.sprint(\\strut\\mychar{ .. i, }{\\type{, 
 w[i].name, }})
   end
   end
 }
 \stoptext

lesser geeks loom in s-fnt-10.tex -)

Hans


-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-09-30 Thread Taco Hoekwater
On Tue, 30 Sep 2008 12:23:56 +0200
Alan Stone [EMAIL PROTECTED] wrote:

 How do you typeset font characters by their ansi code number, ex. Alt+33
 (21h) ?

\char 21 % hex
\char 33  % decimal


Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-09-30 Thread Alan Stone
On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater [EMAIL PROTECTED] wrote:

 On Tue, 30 Sep 2008 12:23:56 +0200
 Alan Stone [EMAIL PROTECTED] wrote:

  How do you typeset font characters by their ansi code number, ex. Alt+33
  (21h) ?

 \char 21 % hex
 \char 33  % decimal


Thanks Taco.

It didn't work as expected. It outputs exclamation points.

- font: combinumerals ( http://www.fontsite.com/bonusfonts/cnfree_tt.zip )
- font encoding type: symbol
- supported unicode ranges: general punctuation

What's missing here ?

\starttypescript [sans] [combinumerals]
 \definefontsynonym [CombinumeralsRegular][name:combinumerals]
[features=default]
 \definefontsynonym [CombinumeralsBold]
[name:combinumeralsbold][features=default]
\stoptypescript

\starttypescript [sans] [combinumerals]
 \setups [font:fallback:sans]
 \definefontsynonym [sans][CombinumeralsRegular]
 \definefontsynonym [sansBold][CombinumeralsBold]
\stoptypescript

\starttypescript [combinumerals]
 \definetypeface [combinumerals] [ss] [sans] [combinumerals] [default]
\stoptypescript

\usetypescript[combinumerals]

\starttext
%\showcharacters
%\page
\char 33
\blank
\char 21
\stoptext

-- 
Best,
Alan

Ubuntu 8.04 Hardy Heron (Desktop)
  * ConTeXt  ver: 2008.09.16 19:49 MKIV  fmt: 2008.9.20  int:
english/english  (ConTeXt minimals installation)
  * texexec --lua foo
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] ansi codes

2008-09-30 Thread Taco Hoekwater


Alan Stone wrote:
 On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 On Tue, 30 Sep 2008 12:23:56 +0200
 Alan Stone [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 
   How do you typeset font characters by their ansi code number, ex.
 Alt+33
   (21h) ?
 
 \char 21 % hex
 \char 33  % decimal
 
 
 Thanks Taco.
 
 It didn't work as expected. It outputs exclamation points.

OK, fetched the font.

 \starttypescript [sans] [combinumerals]
  \setups [font:fallback:sans]
  \definefontsynonym [sans][CombinumeralsRegular]
  \definefontsynonym [sansBold][CombinumeralsBold]
 \stoptypescript

Two changes are needed here

[Sans]   instead of   [sans]
[SansBold]   instead of   [sansBold]

 \starttext
 %\showcharacters
 %\page

Have to add a font switching command here:

   \switchtobodyfont[combinumerals,ss]

Best wishes,
Taco
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___