How do you typeset font characters by their ansi code number, ex. Alt+33 (21h) ? -- 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
On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater
On Tue, 30 Sep 2008 12:23:56 +0200 "Alan Stone"
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
Alan Stone wrote:
On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater
mailto:taco@elvenkind.com> wrote: On Tue, 30 Sep 2008 12:23:56 +0200 "Alan Stone"
mailto:software.list.1es9s@gmail.com> 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
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
Alan Stone wrote:
On Tue, Sep 30, 2008 at 1:37 PM, Taco Hoekwater
mailto:taco@elvenkind.com> wrote: On Tue, 30 Sep 2008 12:23:56 +0200 "Alan Stone"
mailto:software.list.1es9s@gmail.com> 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
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
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,100000 do if w[i] then tex.sprint("\\strut\\mychar{" .. i, "}{\\type{", w[i].name, "}}") end end } \stoptext Mojca
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,100000 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 -----------------------------------------------------------------
On Wed, Oct 1, 2008 at 10:00 PM, 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,100000 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)
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
participants (5)
-
Alan Stone
-
Hans Hagen
-
Mojca Miklavec
-
Taco Hoekwater
-
Thomas A. Schmitz